diff --git a/core/MembershipQE.cpp b/core/MembershipQE.cpp index 01a58d05..521e6136 100644 --- a/core/MembershipQE.cpp +++ b/core/MembershipQE.cpp @@ -554,25 +554,25 @@ void ClubStatusQuery::getClubStatus(const QString &in_callsign, while ( ++records && query.next() ) { QString clubid = query.value(0).toString(); - QVariant band = query.value(1); - QVariant mode = query.value(2); + QString band = query.value(1).toString(); + QString mode = query.value(2).toString(); QVariant confirmed = query.value(3); - QVariant current_mode = query.value(4); + QString current_mode = query.value(4).toString(); qCDebug(runtime) << "Processing" << currentProcessedClub << clubid - << band.isNull() << band - << mode.isNull() << mode - << confirmed.isNull() << confirmed - << current_mode.isNull(); + << band.isEmpty() << band + << mode.isEmpty() << mode + << confirmed.toString().isEmpty() << confirmed + << current_mode.isEmpty(); // the select generates starting line for a new club // Changing the club if ( currentProcessedClub != clubid - && band.isNull() - && mode.isNull() - && confirmed.isNull() - && current_mode.isNull() ) + && band.isEmpty() + && mode.isEmpty() + && confirmed.toString().isEmpty() + && current_mode.isEmpty() ) { if ( !currentProcessedClub.isEmpty() ) { @@ -591,10 +591,10 @@ void ClubStatusQuery::getClubStatus(const QString &in_callsign, if ( currentProcessedClub == clubid ) { - if ( band.toString() == in_band ) + if ( band == in_band ) { bandMatched = true; - if ( mode.toString() == current_mode.toString() ) + if ( mode == current_mode ) { bandModeMatched = true; @@ -605,7 +605,7 @@ void ClubStatusQuery::getClubStatus(const QString &in_callsign, } } - if ( mode.toString() == current_mode.toString() ) + if ( mode == current_mode ) { modeMatched = true; } diff --git a/core/main.cpp b/core/main.cpp index 2114b254..29de409f 100644 --- a/core/main.cpp +++ b/core/main.cpp @@ -408,7 +408,7 @@ int main(int argc, char* argv[]) QString lang = parser.value(forceLanguage); app.setOrganizationName("hamradio"); - app.setApplicationName("QLog" + ((environment.isNull()) ? "" : environment.prepend("-"))); + app.setApplicationName("QLog" + ((environment.isEmpty()) ? "" : environment.prepend("-"))); /* If the Style parameter is not present then use a default - Fusion style */ if ( !stylePresent ) diff --git a/data/Data.cpp b/data/Data.cpp index 1a4c292f..4ab289b0 100644 --- a/data/Data.cpp +++ b/data/Data.cpp @@ -184,24 +184,24 @@ DxccStatus Data::dxccStatus(int dxcc, const QString &band, const QString &mode) if ( query.next() ) { - if ( query.value(0).isNull() ) + if ( query.value(0).toString().isEmpty() ) return DxccStatus::NewEntity; - if ( query.value(1).isNull() ) + if ( query.value(1).toString().isEmpty() ) { - if ( query.value(2).isNull() ) + if ( query.value(2).toString().isEmpty() ) return DxccStatus::NewBandMode; else return DxccStatus::NewBand; } - if ( query.value(2).isNull() ) + if ( query.value(2).toString().isEmpty() ) return DxccStatus::NewMode; - if ( query.value(3).isNull() ) + if ( query.value(3).toString().isEmpty() ) return DxccStatus::NewSlot; - if ( query.value(4).isNull() ) + if ( query.value(4).toString().isEmpty() ) return DxccStatus::Worked; else return DxccStatus::Confirmed; diff --git a/ui/AlertWidget.cpp b/ui/AlertWidget.cpp index 0690a625..fd45d811 100644 --- a/ui/AlertWidget.cpp +++ b/ui/AlertWidget.cpp @@ -131,11 +131,11 @@ void AlertWidget::restoreTableHeaderState() { FCT_IDENTIFICATION; - const QVariant &state = settings.value("alert/state"); + const QByteArray &state = settings.value("alert/state").toByteArray(); - if (!state.isNull()) + if (!state.isEmpty()) { - ui->alertTableView->horizontalHeader()->restoreState(state.toByteArray()); + ui->alertTableView->horizontalHeader()->restoreState(state); } } diff --git a/ui/DxWidget.cpp b/ui/DxWidget.cpp index 29594fb7..0f68bb02 100644 --- a/ui/DxWidget.cpp +++ b/ui/DxWidget.cpp @@ -793,31 +793,32 @@ void DxWidget::restoreWidgetSetting() FCT_IDENTIFICATION; QSettings settings; - QVariant state = settings.value("dxc/dxtablestate"); + QByteArray state = settings.value("dxc/dxtablestate").toByteArray(); - if (!state.isNull()) + if (!state.isEmpty()) { - ui->dxTable->horizontalHeader()->restoreState(state.toByteArray()); + ui->dxTable->horizontalHeader()->restoreState(state); } - state = settings.value("dxc/wcytablestate"); + state = settings.value("dxc/wcytablestate").toByteArray(); - if (!state.isNull()) + if (!state.isEmpty()) { - ui->wcyTable->horizontalHeader()->restoreState(state.toByteArray()); + ui->wcyTable->horizontalHeader()->restoreState(state); } - state = settings.value("dxc/wwvtablestate"); + state = settings.value("dxc/wwvtablestate").toByteArray(); - if (!state.isNull()) + if (!state.isEmpty()) { - ui->wwvTable->horizontalHeader()->restoreState(state.toByteArray()); + ui->wwvTable->horizontalHeader()->restoreState(state); } - state = settings.value("dxc/toalltablestate"); - if (!state.isNull()) + state = settings.value("dxc/toalltablestate").toByteArray(); + + if (!state.isEmpty()) { - ui->toAllTable->horizontalHeader()->restoreState(state.toByteArray()); + ui->toAllTable->horizontalHeader()->restoreState(state); } int fontsize = settings.value("dxc/consolefontsize", -1).toInt(); diff --git a/ui/LogbookWidget.cpp b/ui/LogbookWidget.cpp index c8416e23..d858e10a 100644 --- a/ui/LogbookWidget.cpp +++ b/ui/LogbookWidget.cpp @@ -139,9 +139,9 @@ LogbookWidget::LogbookWidget(QWidget *parent) : ui->contactTable->setItemDelegateForColumn(LogbookModel::COLUMN_UKSMG, new UnitFormatDelegate("", 0, 1, ui->contactTable)); QSettings settings; - QVariant logbookState = settings.value("logbook/state"); - if (!logbookState.isNull()) { - ui->contactTable->horizontalHeader()->restoreState(logbookState.toByteArray()); + const QByteArray &logbookState = settings.value("logbook/state").toByteArray(); + if (!logbookState.isEmpty()) { + ui->contactTable->horizontalHeader()->restoreState(logbookState); } else { /* Hide all */ diff --git a/ui/RigWidget.cpp b/ui/RigWidget.cpp index 5e754fdc..a5c6db59 100644 --- a/ui/RigWidget.cpp +++ b/ui/RigWidget.cpp @@ -197,7 +197,7 @@ void RigWidget::bandComboChanged(const QString &newBand) double newFreq = record.value("start_freq").toDouble(); - if ( ! record.value("last_seen_freq").isNull() ) + if ( ! record.value("last_seen_freq").toString().isEmpty() ) { newFreq = record.value("last_seen_freq").toDouble(); } diff --git a/ui/WsjtxWidget.cpp b/ui/WsjtxWidget.cpp index d730b027..3e98dc76 100644 --- a/ui/WsjtxWidget.cpp +++ b/ui/WsjtxWidget.cpp @@ -335,11 +335,11 @@ void WsjtxWidget::restoreTableHeaderState() FCT_IDENTIFICATION; QSettings settings; - QVariant state = settings.value("wsjtx/state"); + const QByteArray &state = settings.value("wsjtx/state").toByteArray(); - if (!state.isNull()) + if (!state.isEmpty()) { - ui->tableView->horizontalHeader()->restoreState(state.toByteArray()); + ui->tableView->horizontalHeader()->restoreState(state); } }