Updating code

This commit is contained in:
d 2024-06-16 19:39:49 +02:00
parent 9ee9793237
commit 144b4f94ee
25 changed files with 788 additions and 804 deletions

View File

@ -1,6 +1,7 @@
TODO: Update the DB (modes table) updateToLatest() => updateTo026
WIP: Try to optimize bool DataProxy_SQLite::fillEmptyDXCCInTheLog()
WIP: Working in the update of the table awarddxcc in DB class
WIP: - Bugfix: DB in alternative locations was not always found. (WIP #706)
TESTS to do during RC releases:
- ADIF log Import
@ -33,6 +34,7 @@ TBD - 2.4
- Bugfix: CQ & ITU zones may be wrong for callsigns from specific DXCC if coming from WSJTX.
- Bugfix: ClubLog date was not properly managed.
Mar 2024 - 2.3.4
- BugFix: After Editing a QSO, lotw_qsl_rcvd is emptied (Closes #656, #659) (TNX N6PAZ, EA5WA)
- Bugfix: Keep data of SAT tab when entering a QSO stopped working. (TNX EA5WA)

7
src/TROUBLESHOUTING Normal file
View File

@ -0,0 +1,7 @@
Linux - Raspbian
Error message in the console when KLog start:
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
Solution: install qt6-wayland package
sudo apt install qt6-wayland

View File

@ -358,7 +358,7 @@ void AwardsWidget::showAwards()
showDXMarathon(selectedYear);
emit debugLog(Q_FUNC_INFO, "END", logLevel);
qDebug() << Q_FUNC_INFO << " - END";
//qDebug() << Q_FUNC_INFO << " - END";
}
void AwardsWidget::showDXMarathon(const int _year)

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,6 @@ class DataBase : public QObject
public:
DataBase(const QString &_parentClass, const QString &_DBName);
//DataBase(const QString &_softVersion, bool inmemoryonly = false);
DataBase(const QString &_parentClass, const QString &_softVersion, const QString &_DBName);
//virtual ~DataBase();
~DataBase();
@ -164,9 +163,8 @@ private:
bool recreateTableLog();
bool createTableLog(bool temp = false); // false creates the production DB. True a temporal one.
bool createTableLogs(const bool real=true); // real = true creates the production DB. False a temporal one.
bool recreateTableEntity();
bool createTableEntity(const bool NoTmp);
bool updateTableEntity();
bool recreateTableEntity();
bool createTableClubLogStatus();
bool populateTableClubLogStatus();

View File

@ -31,38 +31,36 @@
DataProxy_SQLite::DataProxy_SQLite(const QString &_parentFunction, const QString &_softVersion)
{
#ifdef QT_DEBUG
//qDebug() << Q_FUNC_INFO << _softVersion << _parentFunction;
qDebug() << Q_FUNC_INFO << _softVersion << _parentFunction;
#else
//qDebug() << Q_FUNC_INFO << "Running a release build";
qDebug() << Q_FUNC_INFO << "Running a release build";
#endif
(void)_parentFunction;
//qDebug() << Q_FUNC_INFO << ": " << _softVersion << _parentFunction;
qDebug() << Q_FUNC_INFO << ": " << _softVersion << _parentFunction;
logLevel = None;
//qDebug() << Q_FUNC_INFO << " - 45";
qDebug() << Q_FUNC_INFO << " - 45";
util = new Utilities(Q_FUNC_INFO);
//qDebug() << Q_FUNC_INFO << " - 46";
qDebug() << Q_FUNC_INFO << " - 46";
util->setVersion(_softVersion);
//qDebug() << Q_FUNC_INFO << " - 47";
qDebug() << Q_FUNC_INFO << " - 47";
util->setCallValidation(false);
//qDebug() << Q_FUNC_INFO << " - 48";
qDebug() << Q_FUNC_INFO << " - 48: " << util->getKLogDBFile();
db = new DataBase(Q_FUNC_INFO, _softVersion, util->getKLogDBFile());
//qDebug() << Q_FUNC_INFO << " - 49";
qDebug() << Q_FUNC_INFO << " - 49";
dbCreated = db->createConnection(Q_FUNC_INFO);
//qDebug() << Q_FUNC_INFO << " - 50";
qDebug() << Q_FUNC_INFO << " - 50";
util->setLongPrefixes(getLongPrefixes());
//qDebug() << Q_FUNC_INFO << " - 51";
qDebug() << Q_FUNC_INFO << " - 51";
util->setSpecialCalls(getSpecialCallsigns());
//qDebug() << Q_FUNC_INFO << " - 52";
qDebug() << Q_FUNC_INFO << " - 52";
qso = new QSO;
//qDebug() << Q_FUNC_INFO << " - 53";
//qDebug() << Q_FUNC_INFO << " - 54";
qDebug() << Q_FUNC_INFO << " - 53";
searching = false;
executionN = 0;
connect(db, SIGNAL(debugLog(QString, QString, DebugLogLevel)), this, SLOT(slotCaptureDebugLogs(QString, QString, DebugLogLevel)) );
//qDebug() << Q_FUNC_INFO << " - END";
qDebug() << Q_FUNC_INFO << " - END";
logEvent (Q_FUNC_INFO, "END", Debug);
}
@ -2170,7 +2168,7 @@ QStringList DataProxy_SQLite::getFilteredLocators(const QString &_band, const QS
bool DataProxy_SQLite::updateAwardDXCC()
{
qDebug() << Q_FUNC_INFO << " - Start";
//qDebug() << Q_FUNC_INFO << " - Start";
fillEmptyDXCCInTheLog();
return db->updateAwardDXCCTable();
//qDebug() << Q_FUNC_INFO << " - END";
@ -6218,7 +6216,7 @@ int DataProxy_SQLite::getQSOsWithContinent(const QString &_cont, const int _logN
bool sqlOK;
if (_logNumber < 0)
{
queryString = QString("SELECT COUNT (DISTINCT id) FROM log where cont = '%1'").arg(_cont);
queryString = QString("SELECT COUNT (DISTINCT id) FROM log where continent = '%1'").arg(_cont);
}
else
{
@ -6546,34 +6544,39 @@ bool DataProxy_SQLite::addNewLog (const QStringList _qs)
bool DataProxy_SQLite::doesThisLogExist(const int _log)
{
qDebug() << "DataProxy_SQLite::doesThisLogExist: " << QString::number(_log);
qDebug() << "DataProxy_SQLite::doesThisLogExist - Name:" << db->getDBName();
//qDebug() << "DataProxy_SQLite::doesThisLogExist: " << QString::number(_log);
//qDebug() << "DataProxy_SQLite::doesThisLogExist - Name:" << db->getDBName();
QSqlQuery query;
//SELECT COUNT (*) FROM log WHERE lognumber='3'
//SELECT COUNT (*) FROM logs WHERE id='1'
QString queryString = QString("SELECT id FROM logs WHERE id='%1'").arg(_log);
QString queryString = QString("SELECT COUNT (*) FROM logs WHERE id='%1'").arg(_log);
bool sqlOK = query.exec(queryString);
qDebug() << Q_FUNC_INFO << " query: " << query.lastQuery() ;
//qDebug() << Q_FUNC_INFO << " query: " << query.lastQuery() ;
if (!sqlOK)
{
qDebug() << Q_FUNC_INFO << " - END False 1";
//qDebug() << Q_FUNC_INFO << " - END False 1";
return false;
}
if (!query.next())
{
qDebug() << Q_FUNC_INFO << " - END False 2";
//qDebug() << Q_FUNC_INFO << " - END False 2";
return false;
}
if (!query.isValid())
{
qDebug() << Q_FUNC_INFO << " - END False 3";
//qDebug() << Q_FUNC_INFO << " - END False 3";
return false;
}
int i = query.value(0).toInt();
qDebug() << Q_FUNC_INFO << " - Value: " << QString::number(i);
qDebug() << Q_FUNC_INFO << " - END TRUE";
return (query.value(0).toInt() >0);
/*
//int i = query.value(0).toInt();
//qDebug() << Q_FUNC_INFO << " - Value: " << QString::number(i);
//qDebug() << Q_FUNC_INFO << " - END TRUE";
return true;
if (sqlOK)
@ -6583,20 +6586,20 @@ bool DataProxy_SQLite::doesThisLogExist(const int _log)
if (query.isValid())
{
query.finish();
qDebug() << "DataProxy_SQLite::doesThisLogExist: END TRUE" ;
//qDebug() << "DataProxy_SQLite::doesThisLogExist: END TRUE" ;
return true;
}
else
{
query.finish();
qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 1" ;
//qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 1" ;
return false;
}
}
else
{
query.finish();
qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 2" ;
//qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 2" ;
return false;
}
}
@ -6604,11 +6607,12 @@ bool DataProxy_SQLite::doesThisLogExist(const int _log)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().nativeErrorCode(), query.lastQuery());
query.finish();
qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 3" ;
//qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 3" ;
return false;
}
qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 4" ;
//qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 4" ;
return false;
*/
}
int DataProxy_SQLite::getContinentIdFromContinentShortName(const QString &_n)
@ -6649,8 +6653,8 @@ QString DataProxy_SQLite::getContinentShortNameFromEntity(const int _n)
// SELECT DISTINCT dxcc, bandid, modeid, id, lognumber from log WHERE qsl_rcvd='Y' OR lotw_qsl_rcvd='Y' GROUP BY dxcc, bandid, modeid
QSqlQuery query;
QString queryString= QString("SELECT cont FROM entity WHERE dxcc='%1'").arg(_n);
//QString queryString= QString("SELECT continent.shortname FROM entity JOIN continent ON entity.cont=continent.shortname WHERE dxcc='%1'").arg(_n);
QString queryString= QString("SELECT continent FROM entity WHERE dxcc='%1'").arg(_n);
//QString queryString= QString("SELECT continent.shortname FROM entity JOIN continent ON entity.continent=continent.shortname WHERE dxcc='%1'").arg(_n);
bool sqlOK = query.exec(queryString);
if (sqlOK)

View File

@ -127,7 +127,6 @@ void DXCCStatusWidget::update()
{
emit debugLog (Q_FUNC_INFO, "Start", Debug);
//qDebug() << Q_FUNC_INFO << ": " << QTime::currentTime().toString("HH:mm:ss");
//int entities = world->getHowManyEntities();
int entities = dataProxy->getMaxEntityID(false);
if (!awards->updateDXCCBandsStatus (-1)) // We update all
{

View File

@ -222,7 +222,6 @@ void DXClusterWidget::connectToDXCluster()
dxClusterListWidget->addItem (new dxClusterSpotItem(dxClusterListWidget, tr("Trying to connect to the server") + "\n", awards->getDefaultColor()));
}
void DXClusterWidget::slotClusterDisplayError(QAbstractSocket::SocketError socketError)
{
//qDebug() << Q_FUNC_INFO;
@ -354,6 +353,8 @@ void DXClusterWidget::slotClusterDataArrived()
if (spot.valid)
{
qDebug() << Q_FUNC_INFO << " - Spot IS valid";
qDebug() << Q_FUNC_INFO << " - Spot Freq: " << spot.freq.toQString();
_entityStatus.entityId = world->getQRZARRLId(spot.dxcall);
spotBand = QString::number(dataProxy->getBandIdFromFreq(spot.freq.toDouble()) );
@ -585,14 +586,14 @@ bool DXClusterWidget::isConnected()
DXSpot DXClusterWidget::readItem(const QString _stringSpot)
{
//qDebug() << Q_FUNC_INFO;
qDebug() << Q_FUNC_INFO;
DXSpot spot = DXSpot();
spot.valid = false;
if (_stringSpot.length()<5)
return spot;
Frequency _fr;
//Frequency _fr;
//dxClusterString = ((item->data(0)).toString()).simplified();
@ -614,6 +615,7 @@ DXSpot DXClusterWidget::readItem(const QString _stringSpot)
spot.freq.fromQString((fields.at(3)), KHz);
spot.dxcall = fields.at(4);
spot.valid = true;
qDebug() << Q_FUNC_INFO << ": Identified: Freq1: " << spot.freq.toQString();
}
else if (fields.last().endsWith(">"))
{ // 14250.0 EA0XXX 12-Apr-2020 2140Z Comment <EA0XX>
@ -622,6 +624,8 @@ DXSpot DXClusterWidget::readItem(const QString _stringSpot)
spot.freq.fromQString((fields.at(0)), KHz);
spot.dxcall = fields.at(1);
spot.valid = true;
qDebug() << Q_FUNC_INFO << ": Identified: Freq2: " << spot.freq.toQString();
}
else if ((fields.at(0) == "To" ) && (fields.at(1) == "ALL" ))
{ // To ALL Comment

93
src/dxcluster/dxspot.cpp Normal file
View File

@ -0,0 +1,93 @@
/***************************************************************************
dxspot.cpp - description
-------------------
begin : apr 2024
copyright : (C) 2024 by Jaime Robles
email : jaime@robles.es
***************************************************************************/
/*****************************************************************************
* This file is part of KLog. *
* *
* KLog is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* KLog is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with KLog. If not, see <https://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include "dxspot.h"
DXSpot::DXSpot()
{
valid = false;
}
DXSpot::DXSpot(DXSpot *_other)
{
dxcall = _other->dxcall;
spotter = _other->spotter;
freq = _other->freq; // Might need a copy constructor for Frequency as well
comment = _other->comment;
dateTime = _other->dateTime;
clickStatus = _other->clickStatus;
valid = _other->valid;
}
DXSpot::~DXSpot(){}
void DXSpot::clear()
{
dxcall.clear();
freq.clear();
spotter.clear();
dateTime.currentDateTimeUtc();
valid = false;
clickStatus = NoClick;
}
void DXSpot::operator=(DXSpot const &_other)
{
dxcall = _other.dxcall;
freq = _other.freq; // Might need a copy constructor for Frequency as well
spotter = _other.spotter;
comment = _other.comment;
dateTime = _other.dateTime;
clickStatus = _other.clickStatus;
valid = _other.valid;
}
void DXSpot::setValid(const bool _v){valid = _v;}
bool DXSpot::isValid(){return valid;}
void DXSpot::setDXCall(const QString &_c){dxcall = _c;}
QString DXSpot::getDxCall(){return dxcall;}
void DXSpot::setSpotter(const QString &_c){spotter = _c;}
QString DXSpot::getSpotter(){return spotter;}
void DXSpot::setComment(const QString &c){comment = c;}
QString DXSpot::getComment(){return comment;}
void DXSpot::setDateTime(const QDateTime &d){if (d.isValid()) dateTime = d;}
QDateTime DXSpot::getDateTime(){ return dateTime;}
void DXSpot::setClickStatus(const MouseClicks &_s ){clickStatus = _s;}
bool DXSpot::getClickStatus(){return clickStatus;}
void DXSpot::setFrequency(Frequency f)
{
if (f.isValid())
freq = f;
}
Frequency DXSpot::getFrequency()
{
return &freq;
}

80
src/dxcluster/dxspot.h Normal file
View File

@ -0,0 +1,80 @@
#ifndef DXSPOT_H
#define DXSPOT_H
/***************************************************************************
dxspot.h - description
-------------------
begin : Apr 2024
copyright : (C) 2024 by Jaime Robles
email : jaime@robles.es
***************************************************************************/
/*****************************************************************************
* This file is part of KLog. *
* *
* KLog is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* KLog is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with KLog. If not, see <https://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
/*
This class implements DXSpot.
*/
#include <QObject>
#include <QDateTime>
#include "../klogdefinitions.h"
#include "../frequency.h"
class DXSpot : public QObject
{
Q_OBJECT
friend class tst_DXSpot;
public:
DXSpot();
DXSpot(DXSpot *_other);
~DXSpot();
void operator=(DXSpot const &_other);
void clear();
void setValid(const bool _v);
bool isValid();
void setDXCall(const QString &c);
QString getDxCall();
void setSpotter(const QString &c);
QString getSpotter();
void setComment(const QString &c);
QString getComment();
void setDateTime(const QDateTime &d);
QDateTime getDateTime();
void setClickStatus(const MouseClicks &_s );
bool getClickStatus();
void setFrequency(Frequency f);
Frequency getFrequency();
signals:
private:
QString dxcall;
Frequency freq;
QString spotter;
QString comment;
QDateTime dateTime;
MouseClicks clickStatus;
bool valid;
};
#endif // DXSPOT_H

View File

@ -36,17 +36,7 @@ Frequency::Frequency(const double _f, FreqUnits _u)
{
freq = normalize(_f, _u);
}
//Frequency::Frequency(const QString &_parentName){}
/*
Frequency::Frequency(const QString &_parentName, const Frequency &_f)
{
if(this != &_f)
{
*this = _f;
}
}
*/
Frequency::~Frequency(){}
void Frequency::clear()

View File

@ -334,7 +334,7 @@ void MainWindow::checkHomeDir()
void MainWindow::init()
{
qDebug() << Q_FUNC_INFO << " - Start - " << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - Start - " << (QTime::currentTime()).toString("HH:mm:ss") ;
logLevel = Debug;
logEvent(Q_FUNC_INFO, "Start", Debug);
checkHomeDir();
@ -342,13 +342,13 @@ void MainWindow::init()
checkDebugFile();
qDebug() << Q_FUNC_INFO << " - 00" ;
//qDebug() << Q_FUNC_INFO << " - 00" ;
util->setLongPrefixes(dataProxy->getLongPrefixes());
util->setSpecialCalls(dataProxy->getSpecialCallsigns());
qDebug() << Q_FUNC_INFO << " - 000" ;
//qDebug() << Q_FUNC_INFO << " - 000" ;
setupDialog->init(softwareVersion, 0, configured);
qDebug() << Q_FUNC_INFO << " - 01" ;
//qDebug() << Q_FUNC_INFO << " - 01" ;
filemanager->init();
@ -367,7 +367,7 @@ void MainWindow::init()
//Default band/modes
bands << "10M" << "15M" << "20M" << "40M" << "80M" << "160M";
modes << "SSB" << "CW";
qDebug() << Q_FUNC_INFO << " - 00" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 00" << (QTime::currentTime()).toString("HH:mm:ss") ;
hamlibActive = false;
hamlibModeNotADIFSupported = false;
@ -379,7 +379,7 @@ void MainWindow::init()
setCleaning(false);
qDebug() << Q_FUNC_INFO << " - 10" ;
//qDebug() << Q_FUNC_INFO << " - 10" ;
dxClusterWidget->init();
@ -404,7 +404,7 @@ void MainWindow::init()
selectedYear = 0;
defaultMode = 1;
defaultBand = 1;
qDebug() << Q_FUNC_INFO << " - 20" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 20" << (QTime::currentTime()).toString("HH:mm:ss") ;
currentMode = 1;
currentModeShown = currentMode;
@ -419,7 +419,7 @@ void MainWindow::init()
UDPServerStart = false; // By default the UDP server is started
qDebug() << Q_FUNC_INFO << " - 30" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 30" << (QTime::currentTime()).toString("HH:mm:ss") ;
currentEntity = -1; // To optimize the calls to different world methods if the entity does not change. Used in slotQRZTextChanged
previousEntity = -1;// To optimize the calls to different world methods if the entity does not change.
@ -450,7 +450,7 @@ void MainWindow::init()
dxclusterSendSpotsToMap = false;
keepSatPage = false;
qDebug() << Q_FUNC_INFO << " - 40" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 40" << (QTime::currentTime()).toString("HH:mm:ss") ;
clublogActive = false;
clublogRealTime = false;
@ -461,7 +461,7 @@ void MainWindow::init()
callingUpdate = false; // to control whether the update is mannually launched or at the begining
setModifying(false);
qDebug() << Q_FUNC_INFO << " - 50" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 50" << (QTime::currentTime()).toString("HH:mm:ss") ;
selectedYear = (dateTime->currentDateTime()).date().year();
loggWinAct->setShortcut(Qt::CTRL | Qt::Key_L);
@ -486,22 +486,22 @@ void MainWindow::init()
checkExistingData();
readSettingsFile();
qDebug() << Q_FUNC_INFO << " - 70" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 70" << (QTime::currentTime()).toString("HH:mm:ss") ;
mapWindow->init();
qDebug() << Q_FUNC_INFO << " - 71" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 71" << (QTime::currentTime()).toString("HH:mm:ss") ;
logWindow->createlogPanel(currentLog);
qDebug() << Q_FUNC_INFO << " - 72" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 72" << (QTime::currentTime()).toString("HH:mm:ss") ;
awards->setManageModes(manageMode);
qDebug() << Q_FUNC_INFO << " - 73" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 73" << (QTime::currentTime()).toString("HH:mm:ss") ;
if (dataProxy->getNumberOfManagedLogs()<1)
{
qDebug() << Q_FUNC_INFO << " - 73.1" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 73.1" << (QTime::currentTime()).toString("HH:mm:ss") ;
openSetup(6);
qDebug() << Q_FUNC_INFO << " - 73.2" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 73.2" << (QTime::currentTime()).toString("HH:mm:ss") ;
}
qDebug() << Q_FUNC_INFO << " - 74" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 74" << (QTime::currentTime()).toString("HH:mm:ss") ;
awardsWidget->fillOperatingYears();
awardsWidget->showAwards();
@ -510,37 +510,37 @@ void MainWindow::init()
dxClusterWidget->setCurrentLog(currentLog);
dxClusterAssistant->init();
qDebug() << Q_FUNC_INFO << " - 80" << (QTime::currentTime()).toString("HH:mm:ss") ;
qDebug() << Q_FUNC_INFO << ": calling Software update ..." << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 80" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << ": calling Software update ..." << (QTime::currentTime()).toString("HH:mm:ss") ;
checkVersions();
qDebug() << Q_FUNC_INFO << " - 90" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 90" << (QTime::currentTime()).toString("HH:mm:ss") ;
currentBandShown = dataProxy->getIdFromBandName(mainQSOEntryWidget->getBand());
qDebug() << Q_FUNC_INFO << " - 91" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 91" << (QTime::currentTime()).toString("HH:mm:ss") ;
currentModeShown = dataProxy->getIdFromModeName(mainQSOEntryWidget->getMode());
qDebug() << Q_FUNC_INFO << " - 92" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 92" << (QTime::currentTime()).toString("HH:mm:ss") ;
currentBand = currentBandShown;
currentMode = currentModeShown;
timerInfoBars = new QTimer(this);
qDebug() << Q_FUNC_INFO << " - Calling createUI" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - Calling createUI" << (QTime::currentTime()).toString("HH:mm:ss") ;
createUI();
qDebug() << Q_FUNC_INFO << " - Calling slotClearButtonClicked" << (QTime::currentTime()).toString("HH:mm:ss") ;
qDebug() << Q_FUNC_INFO << " - 100";
//qDebug() << Q_FUNC_INFO << " - Calling slotClearButtonClicked" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - 100";
slotClearButtonClicked(Q_FUNC_INFO);
qDebug() << Q_FUNC_INFO << " - 110";
//qDebug() << Q_FUNC_INFO << " - 110";
infoWidget->showInfo(-1);
qDebug() << Q_FUNC_INFO << " - 120";
//qDebug() << Q_FUNC_INFO << " - 120";
//lotwTQSLpath = util->getTQSLsPath() + util->getTQSLsFileName();
world->readWorld ();
upAndRunning = true;
mainQSOEntryWidget->setUpAndRunning(upAndRunning);
qDebug() << Q_FUNC_INFO << " - 130";
//qDebug() << Q_FUNC_INFO << " - 130";
applySettings ();
qDebug() << Q_FUNC_INFO << " - END" << (QTime::currentTime()).toString("HH:mm:ss") ;
//qDebug() << Q_FUNC_INFO << " - END" << (QTime::currentTime()).toString("HH:mm:ss") ;
logEvent(Q_FUNC_INFO, "END", Debug);
}
@ -5334,7 +5334,7 @@ void MainWindow::slotAnalyzeDxClusterSignal(DXSpot _spot)
void MainWindow::slotDXClusterSpotArrived(const QString _dxCall, const double _freq)
{
qDebug() << Q_FUNC_INFO << ": " << _dxCall;
//qDebug() << Q_FUNC_INFO << ": " << _dxCall;
//qDebug() << Q_FUNC_INFO << ": " << _freq.toQString();
//(void)_dxCall;
//(void)_freq;
@ -5347,14 +5347,13 @@ void MainWindow::slotDXClusterSpotArrived(const QString _dxCall, const double _f
pQSO.status = ATNO;
//pQSO.freq = _freq;
dxClusterAssistant->newDXClusterSpot(pQSO);
qDebug() << Q_FUNC_INFO << ": Calling assistant with DXCall Valid: " << _dxCall;
//qDebug() << Q_FUNC_INFO << ": Calling assistant with DXCall Valid: " << _dxCall;
//qDebug() << Q_FUNC_INFO << ": Calling assistant with Freq: " << _freq.toQString();
//dxClusterAssistant->newDXClusterSpot(_dxCall, ATNO, _freq.toDouble());
}
else
{
qDebug() << Q_FUNC_INFO << ": DXCall not valid: " << _dxCall;
//qDebug() << Q_FUNC_INFO << ": DXCall not valid: " << _dxCall;
}
@ -6484,7 +6483,7 @@ void MainWindow::slotNewLogLevel(DebugLogLevel l)
bool MainWindow::loadSettings()
{
logEvent(Q_FUNC_INFO, "Start", Debug);
qDebug() << Q_FUNC_INFO << " - Start";
//qDebug() << Q_FUNC_INFO << " - Start";
QSettings settings(util->getCfgFile (), QSettings::IniFormat);
//qDebug() << Q_FUNC_INFO << " - 10 - General";
@ -6548,14 +6547,14 @@ bool MainWindow::loadSettings()
dxClusterWidget->loadSettings ();
settings.endGroup ();
qDebug() << Q_FUNC_INFO << " - 60 - colors";
//qDebug() << Q_FUNC_INFO << " - 60 - colors";
settings.beginGroup ("Colors");
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
qDebug() << Q_FUNC_INFO << " - 61 - NewOneColor: " << settings.value("NewOneColor").toString();
//qDebug() << Q_FUNC_INFO << " - 61 - NewOneColor: " << settings.value("NewOneColor").toString();
newOneColor.fromString(QAnyStringView((settings.value ("NewOneColor", "#FF0000").toString ())));
//newOneColor.setNamedColor(settings.value ("NewOneColor", "#FF0000").toString ());
qDebug() << Q_FUNC_INFO << " - 61 - NewOneColor-2: " << newOneColor.name(QColor::HexRgb);
//qDebug() << Q_FUNC_INFO << " - 61 - NewOneColor-2: " << newOneColor.name(QColor::HexRgb);
neededColor.fromString(QAnyStringView((settings.value ("NeededColor","#FF8C00").toString ())));
workedColor.fromString(QAnyStringView((settings.value ("WorkedColor", "#FFD700").toString ())));
confirmedColor.fromString(QAnyStringView((settings.value ("ConfirmedColor", "#32CD32").toString ())));

View File

@ -188,28 +188,28 @@ void SetupDialog::connectActions()
void SetupDialog::setData(const QString &_softwareVersion, const int _page, const bool _alreadyConfigured)
{
qDebug() << Q_FUNC_INFO << " - " << _softwareVersion << "/" << QString::number(_page);
//qDebug() << Q_FUNC_INFO << " - " << _softwareVersion << "/" << QString::number(_page);
logEvent(Q_FUNC_INFO, "Start", Debug);
nolog = !(haveAtleastOneLog());
firstTime = !_alreadyConfigured;
if (firstTime)
{
qDebug() << Q_FUNC_INFO << " - Running for the FIRST time";
//qDebug() << Q_FUNC_INFO << " - Running for the FIRST time";
}
else
{
qDebug() << Q_FUNC_INFO << " - Running NOT for the FIRST time";
//qDebug() << Q_FUNC_INFO << " - Running NOT for the FIRST time";
miscPage->setUseDefaultDBPath(miscPage->getDefaultDBPath());
}
qDebug() << Q_FUNC_INFO << " - 10";
//qDebug() << Q_FUNC_INFO << " - 10";
setSoftVersion(_softwareVersion);
qDebug() << Q_FUNC_INFO << " - 20";
//qDebug() << Q_FUNC_INFO << " - 20";
slotReadConfigData ();
qDebug() << Q_FUNC_INFO << " - 30";
//qDebug() << Q_FUNC_INFO << " - 30";
setPage(_page);
qDebug() << Q_FUNC_INFO << " - 40";
//qDebug() << Q_FUNC_INFO << " - 40";
logEvent(Q_FUNC_INFO, "END", Debug);
qDebug() << Q_FUNC_INFO << " - END";
//qDebug() << Q_FUNC_INFO << " - END";
}
void SetupDialog::setSoftVersion(const QString &_softwareVersion)
@ -338,22 +338,22 @@ void SetupDialog::loadDarkMode()
bool SetupDialog::loadSettings()
{
qDebug() << Q_FUNC_INFO << " - Start";
//qDebug() << Q_FUNC_INFO << " - Start";
if (!QFile::exists(util->getCfgFile ()))
{
qDebug() << Q_FUNC_INFO << " - Nothing to load";
//qDebug() << Q_FUNC_INFO << " - Nothing to load";
return false;
}
QSettings settings(util->getCfgFile (), QSettings::IniFormat);
qDebug() << Q_FUNC_INFO << " - 10 - General";
//qDebug() << Q_FUNC_INFO << " - 10 - General";
version = settings.value ("Version").toString();
//latestBackup = settings.value ("LatestBackup").toString ();
qDebug() << Q_FUNC_INFO << " - 20 - user";
//qDebug() << Q_FUNC_INFO << " - 20 - user";
userDataPage->loadSettings();
qDebug() << Q_FUNC_INFO << " - 30 - bands";
//qDebug() << Q_FUNC_INFO << " - 30 - bands";
settings.beginGroup ("BandMode");
QStringList listAux;
@ -372,23 +372,23 @@ bool SetupDialog::loadSettings()
bandModePage->setActiveBands (bands);
settings.endGroup ();
qDebug() << Q_FUNC_INFO << " - 40 - logview";
//qDebug() << Q_FUNC_INFO << " - 40 - logview";
logViewPage->loadSettings ();
qDebug() << Q_FUNC_INFO << " - 50 - dxcluster";
//qDebug() << Q_FUNC_INFO << " - 50 - dxcluster";
dxClusterPage->loadSettings ();
qDebug() << Q_FUNC_INFO << " - 60 - colors";
//qDebug() << Q_FUNC_INFO << " - 60 - colors";
colorsPage->loadSettings ();
qDebug() << Q_FUNC_INFO << " - 70 - misc";
//qDebug() << Q_FUNC_INFO << " - 70 - misc";
miscPage->loadSettings ();
qDebug() << Q_FUNC_INFO << " - 80 - logs";
//qDebug() << Q_FUNC_INFO << " - 80 - logs";
logsPage->loadSettings();
qDebug() << Q_FUNC_INFO << " - 90 - elog";
//qDebug() << Q_FUNC_INFO << " - 90 - elog";
eLogPage->loadSettings ();
qDebug() << Q_FUNC_INFO << " - 100 - UDP";
//qDebug() << Q_FUNC_INFO << " - 100 - UDP";
UDPPage->loadSettings ();
qDebug() << Q_FUNC_INFO << " - 110 - Sats";
//qDebug() << Q_FUNC_INFO << " - 110 - Sats";
hamlibPage->loadSettings ();
qDebug() << Q_FUNC_INFO << " - 120 - END";
//qDebug() << Q_FUNC_INFO << " - 120 - END";
return true;
}
@ -465,12 +465,12 @@ void SetupDialog::slotOkButtonClicked()
void SetupDialog::slotReadConfigData()
{
qDebug() << Q_FUNC_INFO << " - Start";
//qDebug() << Q_FUNC_INFO << " - Start";
logEvent(Q_FUNC_INFO, "Start", Debug);
if (firstTime)
//if (!QFile::exists (util->getCfgFile ()))
{
qDebug() << Q_FUNC_INFO << " - FirstTime";
//qDebug() << Q_FUNC_INFO << " - FirstTime";
setDefaults();
bands.removeDuplicates();
modes.removeDuplicates();
@ -479,9 +479,9 @@ void SetupDialog::slotReadConfigData()
bandModePage->setActiveBands(bands);
//logViewPage->setActiveFields(logViewFields);
}
qDebug() << Q_FUNC_INFO << " - 30";
//qDebug() << Q_FUNC_INFO << " - 30";
loadSettings();
qDebug() << Q_FUNC_INFO << " - 40";
//qDebug() << Q_FUNC_INFO << " - 40";
//dxClusterPage->setDxclusterServersComboBox(dxClusterServers);
//dxClusterPage->setSelectedDxClusterServer(dxClusterServerToUse);
@ -500,7 +500,7 @@ void SetupDialog::slotReadConfigData()
bandModePage->setActiveBands(bands);
//logViewPage->setActiveFields(logViewFields);
qDebug() << Q_FUNC_INFO << " - END";
//qDebug() << Q_FUNC_INFO << " - END";
logEvent(Q_FUNC_INFO, "END", Debug);
}
@ -592,7 +592,7 @@ bool SetupDialog::isValidMode (const QString &b)
void SetupDialog::setDefaults()
{
qDebug() << Q_FUNC_INFO << " - Start";
//qDebug() << Q_FUNC_INFO << " - Start";
logEvent(Q_FUNC_INFO, "Start", Debug);
miscPage->setRealTime("TRUE");
miscPage->setUTCTime("TRUE");
@ -636,7 +636,7 @@ void SetupDialog::setDefaults()
bands << "10M" << "12M" << "15M" << "17M" << "20M" << "40M" << "80M" << "160M";
bands.removeDuplicates();
}
qDebug() << Q_FUNC_INFO << " - END";
//qDebug() << Q_FUNC_INFO << " - END";
logEvent(Q_FUNC_INFO, "END", Debug);
}

View File

@ -429,7 +429,7 @@ void SetupPageLogs::showEvent(QShowEvent *event)
void SetupPageLogs::saveSettings()
{
qDebug() << Q_FUNC_INFO ;
//qDebug() << Q_FUNC_INFO ;
Utilities util(Q_FUNC_INFO);
QSettings settings(util.getCfgFile (), QSettings::IniFormat);
//settings.beginGroup ("Logs");
@ -439,31 +439,31 @@ void SetupPageLogs::saveSettings()
void SetupPageLogs::loadSettings()
{
qDebug() << Q_FUNC_INFO << " - Start";
//qDebug() << Q_FUNC_INFO << " - Start";
Utilities util(Q_FUNC_INFO);
qDebug() << Q_FUNC_INFO << " - 00";
//qDebug() << Q_FUNC_INFO << " - 00";
QSettings settings(util.getCfgFile (), QSettings::IniFormat);
qDebug() << Q_FUNC_INFO << " - 01";
//qDebug() << Q_FUNC_INFO << " - 01";
int i = settings.value("SelectedLog").toInt();
qDebug() << Q_FUNC_INFO << " - 02";
//qDebug() << Q_FUNC_INFO << " - 02";
if (!dataProxy->doesThisLogExist(i))
{
qDebug() << Q_FUNC_INFO << " - 10";
//qDebug() << Q_FUNC_INFO << " - 10";
i = 0;
while((!dataProxy->doesThisLogExist(i)) && (i <500))
{//TODO If a user has more than 500 logs it may fail...
i++;
//qDebug() << Q_FUNC_INFO << " - Log: " << QString::number(i);
}
qDebug() << Q_FUNC_INFO << " - 49";
//qDebug() << Q_FUNC_INFO << " - 49";
}
qDebug() << Q_FUNC_INFO << " - 50";
//qDebug() << Q_FUNC_INFO << " - 50";
selectedLog = i;
qDebug() << Q_FUNC_INFO << " - 51";
//qDebug() << Q_FUNC_INFO << " - 51";
logsView->selectRow(1);
qDebug() << Q_FUNC_INFO << " - 52";
//qDebug() << Q_FUNC_INFO << " - 52";
QModelIndex index = logsModel->index(selectedLog, 0);
qDebug() << Q_FUNC_INFO << " - 53";
//qDebug() << Q_FUNC_INFO << " - 53";
logsView->setCurrentIndex(index);
qDebug() << Q_FUNC_INFO << " - END";
//qDebug() << Q_FUNC_INFO << " - END";
}

View File

@ -153,7 +153,7 @@ void SetupPageWorldEditor::createWorldPanel()
worldView->setColumnHidden(columns, false);
columns = rec.indexOf("dxcc");
worldView->setColumnHidden(columns, false);
columns = rec.indexOf("cont");
columns = rec.indexOf("continent");
worldView->setColumnHidden(columns, false);
columns = rec.indexOf("cqz");
worldView->setColumnHidden(columns, false);
@ -210,7 +210,7 @@ void SetupPageWorldEditor::createWorldModel()
worldModel->setHeaderData(nameCol, Qt::Horizontal, tr("Entity"));
nameCol = rec.indexOf("dxcc");
worldModel->setHeaderData(nameCol, Qt::Horizontal, tr("ARRL ID"));
nameCol = rec.indexOf("cont");
nameCol = rec.indexOf("continent");
worldModel->setHeaderData(nameCol, Qt::Horizontal, tr("Continent"));
nameCol = rec.indexOf("cqz");
worldModel->setHeaderData(nameCol, Qt::Horizontal, tr("CQ Zone"));

View File

@ -94,6 +94,7 @@ HEADERS += setupdialog.h \
database.h \
dataproxy_sqlite.h \
downloadcty.h \ \
dxcluster/dxspot.h \
frequency.h \
dxccstatuswidget.h \
dxcluster/dxcluster.h \
@ -173,6 +174,7 @@ SOURCES += main.cpp \
charts/statsfieldperbandwidget.cpp \
dxcluster/dxcluster.cpp \
dxcluster/dxclusterassistant.cpp \
dxcluster/dxspot.cpp \
elogqrzlog.cpp \
eqslutilities.cpp \
frequency.cpp \

View File

@ -529,7 +529,33 @@ QString Utilities::getDBPath()
QString Utilities::getKLogDBFile()
{ // Returns the full path to the main DB
return getDBPath() + "/logbook.dat";
qDebug() << Q_FUNC_INFO << " - Start";
QSettings settings(getCfgFile (), QSettings::IniFormat);
qDebug() << Q_FUNC_INFO << " - CFG: " << getCfgFile();
QString dbFile;
QString filename = "/logbook.dat";
if (!QFile::exists(getCfgFile ()))
return getDBPath() + filename;
//qDebug() << Q_FUNC_INFO << " - Config file DOES NOT Exist";
//CRITICAL ERROR TO BE MANAGED, KLOG SHOULD STOP
settings.beginGroup ("Misc");
if (!settings.contains("DBPath"))
{
//qDebug() << Q_FUNC_INFO << " - DBPath DOES NOT Exist, returning default";
return getDBPath() + filename;
}
dbFile = settings.value("DBPath").toString () + filename;
qDebug() << Q_FUNC_INFO << "DBPath: " << dbFile;
if (QFile::exists(dbFile))
return dbFile;
qDebug() << Q_FUNC_INFO << " - DBPath file DOES NOT Exist, returning default";
return getDBPath() + filename;
}
QString Utilities::getKLogDBBackupFile()

View File

@ -591,13 +591,13 @@ bool World::addEntity(const QString &_name, const int _cq, const int _itu, const
{
QSqlQuery query;
query.prepare("INSERT INTO entity (name, cqz, ituz, cont, latitude, longitude, utc, dxcc, mainprefix) "
query.prepare("INSERT INTO entity (name, cqz, ituz, continent, latitude, longitude, utc, dxcc, mainprefix) "
"VALUES (:name, :cqz, :ituz, :cont, :lat, :lon, :utc, :dxcc, :mainpref)");
query.bindValue(":name", _name); // name
query.bindValue(":cqz", _cq); // CQ
query.bindValue(":ituz", _itu); // ITU
query.bindValue(":cont", _contId); // Cont
query.bindValue(":continent", _contId); // Cont
query.bindValue(":lat", _lat); // Lat
query.bindValue(":lon", _lon); // Lon
query.bindValue(":utc", _utc); // UTC

View File

@ -3,6 +3,7 @@ SUBDIRS=\
tst_main \
tst_wizard \
tst_adif \
tst_dxspot \
tst_frequency \
tst_utilities \
tst_mainqsoentrywidget \

View File

@ -309,16 +309,23 @@ void tst_DataBase::test_checks()
void tst_DataBase::test_CreateDB()
{
qDebug() << Q_FUNC_INFO << "000";
Utilities util(Q_FUNC_INFO);
qDebug() << Q_FUNC_INFO << "001";
QFile file(util.getCTYFile());
qDebug() << Q_FUNC_INFO << "003";
QCOMPARE( file.exists(), true); // Check if the CTYDAT file is available
qDebug() << Q_FUNC_INFO << "003";
DataProxy_SQLite dataProxy(Q_FUNC_INFO, version);
//qDebug() << Q_FUNC_INFO << "003";
qDebug() << Q_FUNC_INFO << "004";
World world(&dataProxy, Q_FUNC_INFO);
qDebug() << Q_FUNC_INFO << "005";
QCOMPARE(world.create(util.getCTYFile()), true); // Read the CTY.CSV file into the DB
qDebug() << Q_FUNC_INFO << "006";
QCOMPARE(db->hasTheTableData("entity"), true);
qDebug() << Q_FUNC_INFO << "007";
QCOMPARE(db->hasTheTableData("prefixesofentity"), true);
qDebug() << Q_FUNC_INFO << "999";
}
@ -383,10 +390,15 @@ void tst_DataBase::cleanup()
void tst_DataBase::test_Constructor()
{
qDebug() << Q_FUNC_INFO << "- Start";
QString _version = QString ("99.9");
qDebug() << Q_FUNC_INFO << "- 001";
util = new Utilities(Q_FUNC_INFO);
qDebug() << Q_FUNC_INFO << "- 002";
db = new DataBase(Q_FUNC_INFO, _version, util->getKLogDBFile());
qDebug() << Q_FUNC_INFO << "- 003";
QCOMPARE(db->createConnection(Q_FUNC_INFO), true);
qDebug() << Q_FUNC_INFO << " - END";
}
QTEST_APPLESS_MAIN(tst_DataBase)

View File

@ -0,0 +1,124 @@
/***************************************************************************
tst_dxspot.h - description
-------------------
begin : Apr 2024
copyright : (C) 2024 by Jaime Robles
email : jaime@robles.es
***************************************************************************/
/****************************************************************************
* This file is part of Testing suite of KLog. *
* *
* KLog is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* The testing suite of KLog is distributed in the hope that it will *
* be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Testing suite of KLog. *
* If not, see <https://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include <QtTest>
#include <QDateTime>
#include "../../src/dxcluster/dxspot.h"
#include "../../src/klogdefinitions.h"
#include "QtCore/qobject.h"
#include "QtCore/qtmetamacros.h"
#include "QtTest/qtestcase.h"
class tst_DXSpot : public QObject
{
Q_OBJECT
public:
tst_DXSpot();
~tst_DXSpot();
private slots:
void initTestCase(); //will be called before the first test function is executed.
//void initTestCase_data(); // will be called to create a global test data table.
void cleanupTestCase(); //will be called after the last test function was executed.
void test_Constructors();
void test_Basic();
private:
DXSpot *spot;
};
tst_DXSpot::tst_DXSpot()
{
spot = new DXSpot;
}
tst_DXSpot::~tst_DXSpot()
{
delete(spot);
}
void tst_DXSpot::initTestCase()
{
spot->clear();
}
void tst_DXSpot::cleanupTestCase()
{
//qDebug("Called after last test.");
}
void tst_DXSpot::test_Constructors()
{
DXSpot spot1;
QVERIFY2(!spot1.isValid(), "Constructor-1 not working");
spot1.setValid(true);
DXSpot spot2(&spot1);
QVERIFY2(spot2.isValid(), "Constructor-2 not working");
}
void tst_DXSpot::test_Basic()
{
spot->clear();
QVERIFY2(!spot->isValid(), "Clear not working");
spot->setValid(true);
QVERIFY2(spot->isValid(), "setValid not working");
spot->setDXCall("EA0XX");
QVERIFY2(spot->getDxCall() == "EA0XX", "dxCall not working");
spot->setSpotter("EA0XX");
QVERIFY2(spot->getSpotter() == "EA0XX", "spotter not working");
spot->setComment("Comment");
QVERIFY2(spot->getComment() == "Comment", "comment not working");
QDateTime t = QDateTime::currentDateTime();
spot->setDateTime(t);
QVERIFY2(spot->getDateTime() == t, "dateTime not working");
//enum MouseClicks {NoClick, RightClick, SingleClick, DoubleClick};
spot->setClickStatus(NoClick);
QVERIFY2(spot->getClickStatus() == NoClick, "Click Status 0 not working");
spot->setClickStatus(RightClick);
QVERIFY2(spot->getClickStatus() == RightClick, "Click Status 1 not working");
spot->setClickStatus(SingleClick);
QVERIFY2(spot->getClickStatus() == SingleClick, "Click Status 2 not working");
spot->setClickStatus(DoubleClick);
QVERIFY2(spot->getClickStatus() == DoubleClick, "Click Status 3 not working");
}
QTEST_APPLESS_MAIN(tst_DXSpot)
#include "tst_dxspot.moc"

View File

@ -0,0 +1,31 @@
QT += testlib
CONFIG += qt console warn_on depend_includepath testcase
CONFIG -= app_bundle
TEMPLATE = app
#QMAKE_CXXFLAGS += -Wall -Wextra -Werror
#QMAKE_CFLAGS += -Wall -Wextra -Werror
HEADERS += \
../../src/frequency.h \
../../src/dxcluster/dxspot.h \
../../src/klogdefinitions.h
SOURCES += tst_dxspot.cpp \
../../src/dxcluster/dxspot.cpp \
../../src/frequency.cpp
isEmpty(QMAKE_LRELEASE) {
win32|os2:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]\lrelease.exe
else:QMAKE_LRELEASE = $$[QT_INSTALL_BINS]/lrelease
unix {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease-qt5 }
} else {
!exists($$QMAKE_LRELEASE) { QMAKE_LRELEASE = lrelease }
}
}

View File

@ -1,8 +1,8 @@
/***************************************************************************
tst_Frequency.h - description
tst_frequency.h - description
-------------------
begin : Jan 2021
copyright : (C) 2021 by Jaime Robles
begin : Apr 2024
copyright : (C) 2024 by Jaime Robles
email : jaime@robles.es
***************************************************************************/

View File

@ -14,7 +14,7 @@ HEADERS += \
../../src/klogdefinitions.h
SOURCES += tst_frequency.cpp \
../../src/frequency.cpp \
../../src/frequency.cpp