mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-21 19:55:20 -05:00
Fix debug assert in CabrilloLogModel on reset of model with no rows
This commit is contained in:
parent
dd931c490f
commit
5fdf0bdff4
@ -54,8 +54,8 @@ CabrilloLog::impl::impl (Configuration const * configuration)
|
||||
|
||||
setEditStrategy (QSqlTableModel::OnManualSubmit);
|
||||
setTable ("cabrillo_log");
|
||||
setHeaderData (fieldIndex ("frequency"), Qt::Horizontal, tr ("Frequency"));
|
||||
setHeaderData (fieldIndex ("when"), Qt::Horizontal, tr ("Date and Time"));
|
||||
setHeaderData (fieldIndex ("frequency"), Qt::Horizontal, tr ("Freq(kHz)"));
|
||||
setHeaderData (fieldIndex ("when"), Qt::Horizontal, tr ("Date & Time(UTC)"));
|
||||
setHeaderData (fieldIndex ("call"), Qt::Horizontal, tr ("Call"));
|
||||
setHeaderData (fieldIndex ("exchange_sent"), Qt::Horizontal, tr ("Sent"));
|
||||
setHeaderData (fieldIndex ("exchange_rcvd"), Qt::Horizontal, tr ("Rcvd"));
|
||||
@ -104,9 +104,12 @@ bool CabrilloLog::dupe (Frequency frequency, QString const& call) const
|
||||
|
||||
void CabrilloLog::reset ()
|
||||
{
|
||||
ConditionalTransaction transaction {*m_};
|
||||
SQL_error_check (*m_, &QSqlTableModel::removeRows, 0, m_->rowCount (), QModelIndex {});
|
||||
transaction.submit ();
|
||||
if (m_->rowCount ())
|
||||
{
|
||||
ConditionalTransaction transaction {*m_};
|
||||
SQL_error_check (*m_, &QSqlTableModel::removeRows, 0, m_->rowCount (), QModelIndex {});
|
||||
transaction.submit ();
|
||||
}
|
||||
}
|
||||
|
||||
void CabrilloLog::export_qsos (QTextStream& stream) const
|
||||
|
Loading…
Reference in New Issue
Block a user