Skip to content

Commit

Permalink
Closes #514
Browse files Browse the repository at this point in the history
  • Loading branch information
ea4k committed Dec 11, 2023
1 parent 16d9f99 commit 5763962
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ TBD - 2.4
WIP: - Bugfix: Started to reduce the possibility of SQLi tje use of prepared statements.
bool QSO::add()
Finish add, think/create/review QSO::modify, update: QString MainWindow::readDataFromUI()
- Bugfix: All Gridsquares are now listed when Export to ADIF is used (Closes #514)

Jun - 2.3.2
- Bugfix: KLog was not starting when started in clean installations.(Closes #599)(TNX cwross)
Expand Down
26 changes: 13 additions & 13 deletions src/dataproxy_sqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3624,7 +3624,7 @@ QList<int> DataProxy_SQLite::getQSOsListLoTWToSend(const QString &_stationCallsi

QStringList DataProxy_SQLite::getGridsToBeSent(const QString &_stationCallsign, const QDate &_startDate, const QDate &_endDate, const ExportMode _em, bool _justModified, int _logN)
{
//qDebug() << Q_FUNC_INFO << " - Start";
//qDebug() << Q_FUNC_INFO << " - Start";
QStringList grids;
grids.clear ();

Expand All @@ -3636,17 +3636,17 @@ QStringList DataProxy_SQLite::getGridsToBeSent(const QString &_stationCallsign,
QString _queryST_string;
if (util->isValidCall(_stationCallsign, true))
{
//qDebug() << Q_FUNC_INFO << " - Valid Call: " << _stationCallsign;
//qDebug() << Q_FUNC_INFO << " - Valid Call: " << _stationCallsign;
_queryST_string = QString("station_callsign='%1'").arg(_stationCallsign);
}
else if (_stationCallsign == "ALL")
{
//qDebug() << Q_FUNC_INFO << " - ALL Calls";
//qDebug() << Q_FUNC_INFO << " - ALL Calls";
_queryST_string = QString("((station_callsign!='ALL') OR (station_callsign IS NULL) OR (station_callsign=''))");
}
else
{
//qDebug() << Q_FUNC_INFO << " - Else calls";
//qDebug() << Q_FUNC_INFO << " - Else calls";
_queryST_string = QString("((station_callsign='') OR (station_callsign IS NULL))");
}

Expand All @@ -3657,7 +3657,7 @@ QStringList DataProxy_SQLite::getGridsToBeSent(const QString &_stationCallsign,
}
else
{
_query_justQueued = QString("lotw_qsl_sent!='1'");
_query_justQueued = QString("((lotw_qsl_sent!='1') OR (lotw_qsl_sent IS NULL))");
}

QString _query_logNumber;
Expand All @@ -3674,7 +3674,7 @@ QStringList DataProxy_SQLite::getGridsToBeSent(const QString &_stationCallsign,
QSqlQuery query;

bool sqlOK = query.exec(queryString);
//qDebug() << Q_FUNC_INFO << ": " << query.lastQuery ();
//qDebug() << Q_FUNC_INFO << ": " << query.lastQuery ();

if (sqlOK)
{
Expand All @@ -3695,12 +3695,12 @@ QStringList DataProxy_SQLite::getGridsToBeSent(const QString &_stationCallsign,
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().nativeErrorCode(), query.lastQuery());
query.finish();
grids.sort ();
//qDebug() << Q_FUNC_INFO << " - END-1";
//qDebug() << Q_FUNC_INFO << " - END-1";
return grids;
}
query.finish();
grids.sort();
//qDebug() << Q_FUNC_INFO << " - END";
//qDebug() << Q_FUNC_INFO << " - END";
return grids;
}

Expand Down Expand Up @@ -9958,15 +9958,15 @@ int DataProxy_SQLite::addQSOQuery(const QSqlQuery &_q)
QSqlQuery query = _q;
if (query.exec ())
{
qDebug() << Q_FUNC_INFO << " - QSO Added!";
//qDebug() << Q_FUNC_INFO << " - QSO Added!";
return 1;
}
else
{
qDebug() << Q_FUNC_INFO << " - QSO NOT Added!";
qDebug() << Q_FUNC_INFO << " - Error: " << query.lastError ().databaseText ();
qDebug() << Q_FUNC_INFO << " - Error text: " << query.lastError ().text ();
qDebug() << Q_FUNC_INFO << " - Error query: " << query.lastQuery ();
//qDebug() << Q_FUNC_INFO << " - QSO NOT Added!";
//qDebug() << Q_FUNC_INFO << " - Error: " << query.lastError ().databaseText ();
//qDebug() << Q_FUNC_INFO << " - Error text: " << query.lastError ().text ();
//qDebug() << Q_FUNC_INFO << " - Error query: " << query.lastQuery ();
return -1;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/widgets/adiflotwexportwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,17 +243,17 @@ void AdifLoTWExportWidget::fillStationMyGridComboBox()

if (util->isValidCall(stationCallsignComboBox->currentText()))
{
//qDebug() << Q_FUNC_INFO << " - ValidCall: " << stationCallsignComboBox->currentText();
qDebug() << Q_FUNC_INFO << " - ValidCall: " << stationCallsignComboBox->currentText();
grids.append (dataProxy->getGridsToBeSent (stationCallsignComboBox->currentText(), startDate->date(), endDate->date(), currentExportMode, true, logNumber));
}
else if (stationCallsignComboBox->currentIndex() == 0)
{ // Not defined call
//qDebug() << Q_FUNC_INFO << " - Not Defined" ;
qDebug() << Q_FUNC_INFO << " - Not Defined" ;
grids.append (dataProxy->getGridsToBeSent ("NOT", startDate->date(), endDate->date(), currentExportMode, true, logNumber));
}
else
{ //ALL calls
//qDebug() << Q_FUNC_INFO << " - ALL Calls" ;
qDebug() << Q_FUNC_INFO << " - ALL Calls" ;
//myGridSquareComboBox->addItem(tr("ALL"));
grids.append (dataProxy->getGridsToBeSent ("ALL", startDate->date(), endDate->date(), currentExportMode, false, logNumber));
}
Expand Down

0 comments on commit 5763962

Please sign in to comment.