mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-24 21:28:41 -05:00
Fix assert when resetting empty Fox log table
This commit is contained in:
parent
31b6120e60
commit
c2ec277cfc
@ -45,7 +45,7 @@ FoxLog::impl::impl ()
|
|||||||
|
|
||||||
setEditStrategy (QSqlTableModel::OnManualSubmit);
|
setEditStrategy (QSqlTableModel::OnManualSubmit);
|
||||||
setTable ("fox_log");
|
setTable ("fox_log");
|
||||||
setHeaderData (fieldIndex ("when"), Qt::Horizontal, tr ("Date and Time"));
|
setHeaderData (fieldIndex ("when"), Qt::Horizontal, tr ("Date & Time(UTC)"));
|
||||||
setHeaderData (fieldIndex ("call"), Qt::Horizontal, tr ("Call"));
|
setHeaderData (fieldIndex ("call"), Qt::Horizontal, tr ("Call"));
|
||||||
setHeaderData (fieldIndex ("grid"), Qt::Horizontal, tr ("Grid"));
|
setHeaderData (fieldIndex ("grid"), Qt::Horizontal, tr ("Grid"));
|
||||||
setHeaderData (fieldIndex ("report_sent"), Qt::Horizontal, tr ("Sent"));
|
setHeaderData (fieldIndex ("report_sent"), Qt::Horizontal, tr ("Sent"));
|
||||||
@ -113,8 +113,11 @@ bool FoxLog::dupe (QString const& call, QString const& band) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FoxLog::reset ()
|
void FoxLog::reset ()
|
||||||
|
{
|
||||||
|
if (m_->rowCount ())
|
||||||
{
|
{
|
||||||
ConditionalTransaction transaction {*m_};
|
ConditionalTransaction transaction {*m_};
|
||||||
SQL_error_check (*m_, &QSqlTableModel::removeRows, 0, m_->rowCount (), QModelIndex {});
|
SQL_error_check (*m_, &QSqlTableModel::removeRows, 0, m_->rowCount (), QModelIndex {});
|
||||||
transaction.submit ();
|
transaction.submit ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user