Skip to content

Commit

Permalink
klog 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ea4k committed Oct 23, 2022
1 parent 2c62af2 commit 4db50d3
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 21 deletions.
62 changes: 52 additions & 10 deletions src/dataproxy_sqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5951,6 +5951,7 @@ bool DataProxy_SQLite::setWAZAwardStatus(const int _qsoId)
query.finish();
return true;
}

bool DataProxy_SQLite::addDXCCEntitySubdivision(const QString &_name, const QString &_short, const QString &_pref,
const QString &_group, const int _regId,
const int _dxcc, const int _cq, const int _itu,
Expand Down Expand Up @@ -5995,8 +5996,6 @@ bool DataProxy_SQLite::addDXCCEntitySubdivision(const QString &_name, const QStr
return true;
}



int DataProxy_SQLite::getNumberOfManagedLogs()
{
//qDebug() << "DataProxy_SQLite::getNumberOfManagedLogs" << QT_ENDL;
Expand Down Expand Up @@ -6058,7 +6057,6 @@ int DataProxy_SQLite::getMaxLogNumber()
//return -1;
}


QStringList DataProxy_SQLite::getListOfManagedLogs()
{
//This function returns the list of log IDs that are being managed
Expand Down Expand Up @@ -6177,7 +6175,57 @@ QStringList DataProxy_SQLite::getStationCallSignsFromLog(const int _log)
return calls;
}

QStringList DataProxy_SQLite::getStationCallSignsFromLogWithLoTWPendingToSend(const int _log)
{
//qDebug() << Q_FUNC_INFO;
QString queryString;

if (doesThisLogExist(_log))
{
queryString = QString("SELECT DISTINCT station_callsign FROM log WHERE lotw_qsl_sent='Q' AND lognumber='%1'").arg(_log);
}
else
{
queryString = QString("SELECT DISTINCT station_callsign FROM log WHERE lotw_qsl_sent='Q'");
}

QSqlQuery query;
bool sqlOK = query.exec(queryString);

if (!sqlOK)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().nativeErrorCode(), query.lastQuery());
query.finish();
//
//qDebug() << Q_FUNC_INFO << "END-2 - fail";
return QStringList();
}

QStringList calls = QStringList();
while(query.next())
{
if (query.isValid())
{
queryString = (query.value(0)).toString();
if (queryString.length()>2)
{
calls.append(queryString);
}
//qDebug() << Q_FUNC_INFO << ": " << queryString;
}
else
{
query.finish();
//qDebug() << Q_FUNC_INFO << ": END-1 - fail";
return QStringList();
}
}
query.finish();
calls.removeDuplicates();
calls.sort();
//qDebug() << Q_FUNC_INFO << ": END";
return calls;
}

QString DataProxy_SQLite::getOperatorsFromLog(const int _log)
{
Expand Down Expand Up @@ -6422,7 +6470,6 @@ bool DataProxy_SQLite::fillEmptyDXCCInTheLog()
return true;
}


int DataProxy_SQLite::getHowManyQSOInLog(const int _log)
{
QString queryString = QString();
Expand Down Expand Up @@ -6823,8 +6870,6 @@ bool DataProxy_SQLite::addNewLog (const QStringList _qs)
//return false;
}



bool DataProxy_SQLite::doesThisLogExist(const int _log)
{
//qDebug() << "DataProxy_SQLite::doesThisLogExist: " << QString::number(_log) << QT_ENDL;
Expand Down Expand Up @@ -6871,7 +6916,6 @@ bool DataProxy_SQLite::doesThisLogExist(const int _log)
//return false;
}


int DataProxy_SQLite::getContinentIdFromContinentShortName(const QString &_n)
{
if (_n.length()!=2)
Expand Down Expand Up @@ -7111,7 +7155,6 @@ QStringList DataProxy_SQLite::filterValidFields(const QStringList &_fields)
return returningFields;
}


int DataProxy_SQLite::getITUzFromPrefix(const QString &_p)
{
QSqlQuery query;
Expand Down Expand Up @@ -7334,6 +7377,7 @@ int DataProxy_SQLite::getEntityIdFromName(const QString &_e)
}
}
}

QStringList DataProxy_SQLite::getEntiNameISOAndPrefixFromId(const int _dxcc)
{
//qDebug() << Q_FUNC_INFO << ": " << QString::number(_dxcc);
Expand Down Expand Up @@ -7544,7 +7588,6 @@ int DataProxy_SQLite::getDXCCFromPrefix(const QString &_p)
//return -4;
}


bool DataProxy_SQLite::isNewCQz(int _c)
{
QSqlQuery query;
Expand Down Expand Up @@ -7919,7 +7962,6 @@ int DataProxy_SQLite::getHowManyEntities()
}
}


int DataProxy_SQLite::getMaxEntityID(bool limit)
{
//SELECT MAX (dxcc) FROM entity WHERE dxcc<1000
Expand Down
1 change: 1 addition & 0 deletions src/dataproxy_sqlite.h
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ class DataProxy_SQLite : public QObject
int getMaxLogNumber();
QString getStationCallSignFromLog(const int _log);
QStringList getStationCallSignsFromLog(const int _log);
QStringList getStationCallSignsFromLogWithLoTWPendingToSend(const int _log);
QString getOperatorsFromLog(const int _log);
QString getCommentsFromLog(const int _log);
QString getLogDateFromLog(const int _log);
Expand Down
2 changes: 1 addition & 1 deletion src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ CONFIG -=depend_includepath
#CONFIG += release
TEMPLATE = app

PKGVERSION = 2.3~RC5
PKGVERSION = 2.3
VERSION = 2.3

DEFINES += APP_VERSION=\\\"$$VERSION\\\"
Expand Down
22 changes: 12 additions & 10 deletions src/widgets/adiflotwexportwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,32 +160,34 @@ void AdifLoTWExportWidget::fillStationCallsignComboBox()
stationCallsignComboBox->addItem(tr("All"));
//qDebug() << "AdifLoTWExportWidget::fillStationCallsignComboBox-4" << QT_ENDL;
}
//qDebug() << "AdifLoTWExportWidget::fillStationCallsignComboBox-99" << QT_ENDL;
stationCallsignComboBox->addItems(dataProxy->getStationCallSignsFromLog(logNumber));

//qDebug() << "AdifLoTWExportWidget::fillStationCallsignComboBox-99" << QString::number(currentExportMode);
stationCallsignComboBox->addItems(dataProxy->getStationCallSignsFromLogWithLoTWPendingToSend(logNumber));
//qDebug() << "AdifLoTWExportWidget::fillStationCallsignComboBox-END" << QT_ENDL;
}

void AdifLoTWExportWidget::fillStationMyGridComboBox()
{
//qDebug() << Q_FUNC_INFO << " - Start";
// GUardar el locator que hay ahora
// limpiar y rellenar el combo.
// Si el locator anterior está en la lista nueva, seleccionarlo.
//Llamar a fillTable ();
// Keep the grid that is shown now
// clean and fill the combo.
// If the saved locator is in the list, it is selected.

QString tempGrid = myGridSquareComboBox->currentText ();
myGridSquareComboBox->clear();
myGridSquareComboBox->addItem(tr("Not defined"));
// getGridsToBeSent(const QString &_stationCallsign, const QDate &_startDate, const QDate &_endDate, bool _justModified=true, int _logN = -1)

QStringList grids;
grids.clear ();
grids.append (dataProxy->getGridsToBeSent (stationCallsignComboBox->currentText(), startDate->date(), endDate->date(), true, logNumber));
myGridSquareComboBox->addItems(grids);

QString aux;
foreach(aux, grids)

if (myGridSquareComboBox->findText(tempGrid, Qt::MatchCaseSensitive) >= 0)
{
//qDebug() << Q_FUNC_INFO << ": " << aux;
myGridSquareComboBox->setCurrentIndex(myGridSquareComboBox->findText(tempGrid, Qt::MatchCaseSensitive));
}

//qDebug() << Q_FUNC_INFO << " - END";
}

Expand Down

0 comments on commit 4db50d3

Please sign in to comment.