From c2ec277cfcd663b10ad53ded0778c6519569db12 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Mon, 12 Nov 2018 04:00:55 +0000 Subject: [PATCH] Fix assert when resetting empty Fox log table --- models/FoxLog.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/models/FoxLog.cpp b/models/FoxLog.cpp index 204095c9a..7703abdbf 100644 --- a/models/FoxLog.cpp +++ b/models/FoxLog.cpp @@ -45,7 +45,7 @@ FoxLog::impl::impl () setEditStrategy (QSqlTableModel::OnManualSubmit); 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 ("grid"), Qt::Horizontal, tr ("Grid")); setHeaderData (fieldIndex ("report_sent"), Qt::Horizontal, tr ("Sent")); @@ -114,7 +114,10 @@ bool FoxLog::dupe (QString const& call, QString const& band) const void FoxLog::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 (); + } }