mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 04:11:16 -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);
|
setEditStrategy (QSqlTableModel::OnManualSubmit);
|
||||||
setTable ("cabrillo_log");
|
setTable ("cabrillo_log");
|
||||||
setHeaderData (fieldIndex ("frequency"), Qt::Horizontal, tr ("Frequency"));
|
setHeaderData (fieldIndex ("frequency"), Qt::Horizontal, tr ("Freq(kHz)"));
|
||||||
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 ("exchange_sent"), Qt::Horizontal, tr ("Sent"));
|
setHeaderData (fieldIndex ("exchange_sent"), Qt::Horizontal, tr ("Sent"));
|
||||||
setHeaderData (fieldIndex ("exchange_rcvd"), Qt::Horizontal, tr ("Rcvd"));
|
setHeaderData (fieldIndex ("exchange_rcvd"), Qt::Horizontal, tr ("Rcvd"));
|
||||||
@ -104,9 +104,12 @@ bool CabrilloLog::dupe (Frequency frequency, QString const& call) const
|
|||||||
|
|
||||||
void CabrilloLog::reset ()
|
void CabrilloLog::reset ()
|
||||||
{
|
{
|
||||||
ConditionalTransaction transaction {*m_};
|
if (m_->rowCount ())
|
||||||
SQL_error_check (*m_, &QSqlTableModel::removeRows, 0, m_->rowCount (), QModelIndex {});
|
{
|
||||||
transaction.submit ();
|
ConditionalTransaction transaction {*m_};
|
||||||
|
SQL_error_check (*m_, &QSqlTableModel::removeRows, 0, m_->rowCount (), QModelIndex {});
|
||||||
|
transaction.submit ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CabrilloLog::export_qsos (QTextStream& stream) const
|
void CabrilloLog::export_qsos (QTextStream& stream) const
|
||||||
|
Loading…
Reference in New Issue
Block a user