Skip to content

Commit

Permalink
KLog-2.3-4RC2 File import and export tests
Browse files Browse the repository at this point in the history
  • Loading branch information
d authored and d committed Jan 28, 2024
1 parent dec6ed9 commit 7bc1a88
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 25 deletions.
6 changes: 3 additions & 3 deletions src/adif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ bool Adif::isValidFreq(const QString &_b)
return true;
}
/* if (!_ok)
qDebug() << Q_FUNC_INFO << ": Freq NOK: NOK" ;
//qDebug() << Q_FUNC_INFO << ": Freq NOK: NOK" ;
if (f<=0)
qDebug() << Q_FUNC_INFO << ": Freq NOK: f=0" ;
//qDebug() << Q_FUNC_INFO << ": Freq NOK: f=0" ;
else
qDebug() << Q_FUNC_INFO << ": Freq NOK: NOT-KNOWN" ;*/
//qDebug() << Q_FUNC_INFO << ": Freq NOK: NOT-KNOWN" ;*/
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/dataproxy_sqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9457,7 +9457,7 @@ QString DataProxy_SQLite::getADIFQSO(const int _qsoId)
nameCol = rec.indexOf("sfi");
if (nameCol>=0)
{
qDebug() << Q_FUNC_INFO << ": Exporting SFI";
//qDebug() << Q_FUNC_INFO << ": Exporting SFI";
aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
if ((aux.length())>0){
ADIFqso.append("<SFI:" + QString::number(aux.length()) + ">" + aux + " ");
Expand Down
24 changes: 12 additions & 12 deletions src/filemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1621,19 +1621,19 @@ QList<int> FileManager::adifLoTWReadLog(const QString& tfileName, const int logN

bool FileManager::adifReadLog2(const QString& tfileName, const int logN)
{
qDebug() << Q_FUNC_INFO << " - Start: " << tfileName << "/" << QString::number(logN);
//qDebug() << Q_FUNC_INFO << " - Start: " << tfileName << "/" << QString::number(logN);
QFile file( tfileName );
if (!file.exists ())
{
qDebug() << Q_FUNC_INFO << " - END: file does not exist";
//qDebug() << Q_FUNC_INFO << " - END: file does not exist";
return false;
}
int qsos = howManyQSOsInFile (file);
qDebug() << Q_FUNC_INFO << " - QSOs: " << QString::number(qsos);
//qDebug() << Q_FUNC_INFO << " - QSOs: " << QString::number(qsos);
qint64 pos = passHeader (file); // Position in the file to calculate where the header ends
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) /* Flawfinder: ignore */
{
qDebug() << Q_FUNC_INFO << " File not found" ;
//qDebug() << Q_FUNC_INFO << " File not found" ;
return false;
}

Expand All @@ -1647,7 +1647,7 @@ bool FileManager::adifReadLog2(const QString& tfileName, const int logN)
//line.clear();
qso.clear ();

qDebug() << Q_FUNC_INFO << ": Progress defined" ;
//qDebug() << Q_FUNC_INFO << ": Progress defined" ;
QProgressDialog progress(tr("Writing ADIF file..."), tr("Abort writing"), 0, qsos, this);
progress.setMaximum(qsos);
progress.setWindowModality(Qt::WindowModal);
Expand All @@ -1657,7 +1657,7 @@ bool FileManager::adifReadLog2(const QString& tfileName, const int logN)
int step = util->getProgresStepForDialog(qsos);
int i = 0;
bool noMoreQSO = false;
qDebug() << Q_FUNC_INFO << ": We start the while" ;
//qDebug() << Q_FUNC_INFO << ": We start the while" ;
while ((!file.atEnd()) && (!noMoreQSO))
{
// One line is read and splitted into the list of fields
Expand All @@ -1669,7 +1669,7 @@ bool FileManager::adifReadLog2(const QString& tfileName, const int logN)
// until we reach the end of file
line.clear();
line.append(file.readLine().trimmed().toUpper());
qDebug() << Q_FUNC_INFO << ": Reading the line: " << line ;
//qDebug() << Q_FUNC_INFO << ": Reading the line: " << line ;
fields << line.split("<", QT_SKIP);
while (!fields.isEmpty())
{
Expand Down Expand Up @@ -1703,7 +1703,7 @@ bool FileManager::adifReadLog2(const QString& tfileName, const int logN)
}
if ( progress.wasCanceled() )
{
qDebug() << Q_FUNC_INFO << QString(": Progress Cancelled") ;
//qDebug() << Q_FUNC_INFO << QString(": Progress Cancelled") ;
QMessageBox msgBox;
msgBox.setWindowTitle(tr("KLog - User cancelled"));
QString aux = QString(tr("You have canceled the file import. The file will be removed and no data will be imported.") + "\n" + tr("Do you still want to cancel?"));
Expand All @@ -1726,9 +1726,9 @@ bool FileManager::adifReadLog2(const QString& tfileName, const int logN)
}
//qDebug() << Q_FUNC_INFO << QString(": Field process finished: ").arg(fieldToAnalyze) ;
}
qDebug() << Q_FUNC_INFO << QString(": List of fields is empty!") ;
//qDebug() << Q_FUNC_INFO << QString(": List of fields is empty!") ;
}
qDebug() << Q_FUNC_INFO << QString(": End of File or no more QSOs") ;
//qDebug() << Q_FUNC_INFO << QString(": End of File or no more QSOs") ;
file.close ();
progress.setValue(qsos); // Closes the progressDialog

Expand Down Expand Up @@ -4070,9 +4070,9 @@ void FileManager::writeQuery(QSqlQuery query, QTextStream &out, const ExportMode
if (nameCol>=0)
{
aux = (query.value(nameCol)).toString();
qDebug() << Q_FUNC_INFO << ": FREQ_TX-1: " << aux;
//qDebug() << Q_FUNC_INFO << ": FREQ_TX-1: " << aux;
aux = util->checkAndFixASCIIinADIF(aux);
qDebug() << Q_FUNC_INFO << ": FREQ_TX-2: " << aux;
//qDebug() << Q_FUNC_INFO << ": FREQ_TX-2: " << aux;
double freqTX = aux.toDouble();
qso.setFreqTX(freqTX);
}
Expand Down
16 changes: 8 additions & 8 deletions src/qso.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,11 @@ int QSO::getLogId()

bool QSO::setFreqTX(const double _f)
{
qDebug() << Q_FUNC_INFO << ": " << QString::number(_f);
//qDebug() << Q_FUNC_INFO << ": " << QString::number(_f);
if (_f>0)
{
freq_tx = _f;
qDebug() << Q_FUNC_INFO << ":-2 " << QString::number(freq_tx);
//qDebug() << Q_FUNC_INFO << ":-2 " << QString::number(freq_tx);
setBandFromFreq(freq_tx);
if (freq_rx<=0)
setFreqRX(freq_tx);
Expand Down Expand Up @@ -2841,16 +2841,16 @@ int QSO::toDB(int _qsoId)
//qDebug() << Q_FUNC_INFO << " - executing query";
if (query.exec())
{
qDebug() << Q_FUNC_INFO << QString(": QSO ADDED/Modified: %1 - %2").arg(callsign).arg(getDateTimeOn().toString("yyyyMMdd-hhmm"));
//qDebug() << Q_FUNC_INFO << QString(": QSO ADDED/Modified: %1 - %2").arg(callsign).arg(getDateTimeOn().toString("yyyyMMdd-hhmm"));
//qDebug() << Q_FUNC_INFO << ": QSO ADDED/Modified: " << query.lastQuery ();
return 1;//db->getLastInsertedQSO();
}
else
{
qDebug() << Q_FUNC_INFO << QString(": QSO NOT ADDED/Modified: %1 - %2").arg(callsign).arg(_qsoId);
//qDebug() << Q_FUNC_INFO << QString(": QSO NOT ADDED/Modified: %1 - %2").arg(callsign).arg(_qsoId);
//qDebug() << Q_FUNC_INFO << ": QSO NOT ADDED/Modified: " << query.lastQuery ();
qDebug() << Q_FUNC_INFO << ": Error: " << query.lastError().databaseText();
qDebug() << Q_FUNC_INFO << ": Error: " << query.lastError().nativeErrorCode();
//qDebug() << Q_FUNC_INFO << ": Error: " << query.lastError().databaseText();
//qDebug() << Q_FUNC_INFO << ": Error: " << query.lastError().nativeErrorCode();
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().nativeErrorCode(), query.lastQuery());
return -2;
}
Expand Down Expand Up @@ -3265,11 +3265,11 @@ QString QSO::getADIF()
if (forceInit) // Only relevant if true
adifStr.append(adif->getADIFField ("force_init", adif->getADIFBoolFromBool(getForceInit()) ));

qDebug() << Q_FUNC_INFO << ": Printing FREQ: " << QString::number(freq_tx);
//qDebug() << Q_FUNC_INFO << ": Printing FREQ: " << QString::number(freq_tx);
if (adif->isValidFreq(QString::number(freq_tx)))
adifStr.append(adif->getADIFField ("freq", QString::number(freq_tx)));

qDebug() << Q_FUNC_INFO << ": Printing FREQ_RX";
//qDebug() << Q_FUNC_INFO << ": Printing FREQ_RX";
if ((adif->isValidFreq(QString::number(freq_rx))) && (freq_tx != freq_rx))
adifStr.append(adif->getADIFField ("freq_rx", QString::number(freq_rx) ));

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.4-RC2
PKGVERSION = 2.3.4-RC3
VERSION = 2.3.4

DEFINES += APP_VERSION=\\\"$$VERSION\\\"
Expand Down

0 comments on commit 7bc1a88

Please sign in to comment.