Skip to content

Commit 5d6cfc5

Browse files
committed
Entity data is available on first start again
1 parent b581242 commit 5d6cfc5

File tree

8 files changed

+114
-112
lines changed

8 files changed

+114
-112
lines changed

src/Changelog

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
On first start, Locator is not identified
2-
BUG: When adding EA KLog finds Spain, if EA4 is added, it fails to find the DXCC.
3-
Find ONE single master place to do that calculation. Maybe World()??
1+
TODO: When adding a QSO the DXCC list is not updated
2+
43

5-
TODO-Bug: Add QSOs from wsjtx does not work. Failure close to int QSO::toDB(int _qsoId) Maybe related to QSO dupe (it was already fixed)
64
Complete: void MainWindow::slotQSOReceived(const QSO &_qso) to add the QSO
75

6+
TODO: Remove, if possible the QSO instance from the DataProxy_SQLite constructor
87

98
TODO-Test: Add tests to test the subsivisions
109
TODO-Test: the copy constructor of QSO
1110

12-
11+
TODO: Reuse the bool World::insertPrefixes to read QSOs from a file so we can insert the whole log at once of in 500 or 1000 QSO blocks
1312
BUG: When entering/modifying a QSO there is an error related to awarddxcc table not existing
1413
TODO: After update, it is needed to restart KLog to be able to use the primary subdivisions
1514
TODO-Bug: Review void tst_MainWindowInputQSO::test_GridLineEdit()

src/dataproxy_sqlite.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7365,7 +7365,7 @@ QHash<QString, int> DataProxy_SQLite::getWorldData()
73657365
{
73667366
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().text(), query.lastQuery());
73677367
query.finish();
7368-
//qDebug() << Q_FUNC_INFO << "END-FAIL1";
7368+
//qDebug() << Q_FUNC_INFO << "END-FAIL-1 - !sqlOK";
73697369
return world;
73707370
}
73717371
else
@@ -7374,7 +7374,7 @@ QHash<QString, int> DataProxy_SQLite::getWorldData()
73747374
{
73757375
if (query.isValid())
73767376
{
7377-
//qDebug() << Q_FUNC_INFO << QString("Pref/Ent = %1/%2").arg((query.value(0)).toString()).arg((query.value(1)).toInt());
7377+
//qDebug() << Q_FUNC_INFO << QString("Pref/Ent = %1/%2").arg((query.value(0)).toString()).arg((query.value(1)).toInt());
73787378
pref = (query.value(0)).toString();
73797379
if (pref.startsWith('='))
73807380
{
@@ -7386,14 +7386,14 @@ QHash<QString, int> DataProxy_SQLite::getWorldData()
73867386
{
73877387
query.finish();
73887388
world.clear();
7389-
//qDebug() << Q_FUNC_INFO << "END-FAIL";
7389+
//qDebug() << Q_FUNC_INFO << "END-FAIL - Query not valid";
73907390
return world;
73917391
}
73927392
}
73937393
}
73947394
query.finish();
73957395
//qDebug() << Q_FUNC_INFO << "END";
7396-
//qDebug() << Q_FUNC_INFO << ": count: " << QString::number(world.count());
7396+
//qDebug() << Q_FUNC_INFO << ": count: " << QString::number(world.count());
73977397
return world;
73987398
}
73997399

src/dxcluster/dxcluster.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void DXClusterWidget::addData()
169169

170170
void DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked( QListWidgetItem * item )
171171
{
172-
qDebug() << Q_FUNC_INFO << item->text();
172+
//qDebug() << Q_FUNC_INFO << item->text();
173173

174174
QStringList ql;
175175
ql.clear();
@@ -380,7 +380,7 @@ void DXClusterWidget::slotClusterDataArrived()
380380

381381

382382
dxSpotColor = awards->getQRZDXStatusColor(_entityStatus);
383-
qDebug() << Q_FUNC_INFO << " - Color Status-1 " << dxSpotColor.name();
383+
//qDebug() << Q_FUNC_INFO << " - Color Status-1 " << dxSpotColor.name();
384384
if (showDxMarathon)
385385
{
386386
if (awards->isDXMarathonNeed(_entityStatus.entityId, world->getQRZCqz(spot.getDxCall()), QDateTime::currentDateTime().date().year(), currentLog))

src/dxcluster/dxspot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ void DXSpot::setFrequency(Frequency f)
118118
{
119119
if (f.isValid())
120120
freq = f;
121-
qDebug() << Q_FUNC_INFO << ": " << freq.toQString(MHz);
121+
//qDebug() << Q_FUNC_INFO << ": " << freq.toQString(MHz);
122122
}
123123

124124
Frequency DXSpot::getFrequency()

src/main.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -341,27 +341,29 @@ int main(int argc, char *argv[])
341341
db->~DataBase();
342342
//qDebug() << Q_FUNC_INFO << " - 99" << (QTime::currentTime()).toString("HH:mm:ss");
343343
}
344-
//qDebug() << Q_FUNC_INFO << " - 100 " << (QTime::currentTime()).toString("HH:mm:ss");
344+
//qDebug() << Q_FUNC_INFO << " - 100 - Show" << (QTime::currentTime()).toString("HH:mm:ss");
345345
splash.show();
346-
//qDebug() << Q_FUNC_INFO << " - 101 " << (QTime::currentTime()).toString("HH:mm:ss");
346+
//qDebug() << Q_FUNC_INFO << " - 101 " << (QTime::currentTime()).toString("HH:mm:ss");
347347
splash.showMessage ("Creating window...");
348-
//qDebug() << Q_FUNC_INFO << " - 102 " << (QTime::currentTime()).toString("HH:mm:ss");
348+
//qDebug() << Q_FUNC_INFO << " - 102 " << (QTime::currentTime()).toString("HH:mm:ss");
349+
349350
MainWindow mw(version);
350-
//qDebug() << Q_FUNC_INFO << " - 103 " << (QTime::currentTime()).toString("HH:mm:ss");
351351
splash.showMessage ("Initializing window...");
352-
//qDebug() << Q_FUNC_INFO << " - 104 " << (QTime::currentTime()).toString("HH:mm:ss");
352+
//qDebug() << Q_FUNC_INFO << " - 103 " << (QTime::currentTime()).toString("HH:mm:ss");
353+
354+
//qDebug() << Q_FUNC_INFO << " - 104 " << (QTime::currentTime()).toString("HH:mm:ss");
353355
mw.init();
354-
//qDebug() << Q_FUNC_INFO << " - 105 " << (QTime::currentTime()).toString("HH:mm:ss");
356+
//qDebug() << Q_FUNC_INFO << " - 105 " << (QTime::currentTime()).toString("HH:mm:ss");
355357
splash.showMessage ("Checking for new versions...");
356-
//qDebug() << Q_FUNC_INFO << " - 106 " << (QTime::currentTime()).toString("HH:mm:ss");
358+
//qDebug() << Q_FUNC_INFO << " - 106 " << (QTime::currentTime()).toString("HH:mm:ss");
357359
mw.checkIfNewVersion();
358-
//qDebug() << Q_FUNC_INFO << " - 107 " << (QTime::currentTime()).toString("HH:mm:ss");
360+
//qDebug() << Q_FUNC_INFO << " - 107 " << (QTime::currentTime()).toString("HH:mm:ss");
359361
splash.showMessage ("Checking if backup is needed...");
360-
//qDebug() << Q_FUNC_INFO << " - 108 " << (QTime::currentTime()).toString("HH:mm:ss");
362+
//qDebug() << Q_FUNC_INFO << " - 108 " << (QTime::currentTime()).toString("HH:mm:ss");
361363
mw.recommendBackupIfNeeded();
362-
//qDebug() << Q_FUNC_INFO << " - 109 " << (QTime::currentTime()).toString("HH:mm:ss");
364+
//qDebug() << Q_FUNC_INFO << " - 109 " << (QTime::currentTime()).toString("HH:mm:ss");
363365
splash.showMessage ("Showing window...");
364-
//qDebug() << Q_FUNC_INFO << " - 110 " << (QTime::currentTime()).toString("HH:mm:ss");
366+
//qDebug() << Q_FUNC_INFO << " - 110 " << (QTime::currentTime()).toString("HH:mm:ss");
365367
mw.show();
366368
//qDebug() << Q_FUNC_INFO << " - 111 " << (QTime::currentTime()).toString("HH:mm:ss");
367369
splash.finish(&mw);

src/mainwindow.cpp

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void MainWindow::showNotWar()
9191

9292
MainWindow::MainWindow(const QString &tversion)
9393
{
94-
//qDebug() << Q_FUNC_INFO << ": " << " Ver: " << tversion << QTime::currentTime().toString("hh:mm:ss") ;
94+
//qDebug() << Q_FUNC_INFO << ": " << " Ver: " << tversion << QTime::currentTime().toString("hh:mm:ss") ;
9595
//logEvent(Q_FUNC_INFO, "Start: " + _klogDir + "/" + tversion, Debug);
9696
showKLogLogWidget = new ShowKLogLogWidget;
9797
showErrorDialog = new ShowErrorDialog();
@@ -112,13 +112,14 @@ MainWindow::MainWindow(const QString &tversion)
112112
QRZCOMAutoCheckAct = new QAction(tr("Always check the current callsign in QRZ.com"), this);
113113

114114
//qDebug() << "MainWindow::MainWindow: Debug File: "<< util->getDebugLogFile() ;
115-
116-
115+
dataProxy = new DataProxy_SQLite(Q_FUNC_INFO, softwareVersion);
116+
world = new World(dataProxy, Q_FUNC_INFO);
117+
world->create(util->getCTYFile());
117118
//qDebug() << Q_FUNC_INFO << ": BEFORE HAMLIB " << QTime::currentTime().toString("hh:mm:ss") ;
118119
hamlib = new HamLibClass();
119120
//qDebug() << Q_FUNC_INFO << ": AFTER HAMLIB " << QTime::currentTime().toString("hh:mm:ss") ;
120121

121-
dataProxy = new DataProxy_SQLite(Q_FUNC_INFO, softwareVersion);
122+
122123
//qDebug() << Q_FUNC_INFO << ": AFTER dataproxy ";
123124
lotwUtilities = new LoTWUtilities(util->getHomeDir (), softwareVersion, Q_FUNC_INFO, dataProxy);
124125
//qDebug() << Q_FUNC_INFO << ": AFTER lotwUtilities";
@@ -134,25 +135,25 @@ MainWindow::MainWindow(const QString &tversion)
134135

135136
elogQRZcom = new eLogQrzLog(dataProxy, Q_FUNC_INFO, softwareVersion);
136137

137-
//qDebug() << Q_FUNC_INFO << ": 00083: " << QTime::currentTime().toString("hh:mm:ss") ;
138+
//qDebug() << Q_FUNC_INFO << ": 00083: " << QTime::currentTime().toString("hh:mm:ss") ;
138139
updateSatsData = new UpdateSatsData(dataProxy);
139-
//qDebug() << Q_FUNC_INFO << ": 00084: " << QTime::currentTime().toString("hh:mm:ss") ;
140+
//qDebug() << Q_FUNC_INFO << ": 00084: " << QTime::currentTime().toString("hh:mm:ss") ;
140141
statsWidget = new StatisticsWidget(dataProxy);
141-
//qDebug() << Q_FUNC_INFO << ": 00085: " << QTime::currentTime().toString("hh:mm:ss") ;
142+
//qDebug() << Q_FUNC_INFO << ": 00085: " << QTime::currentTime().toString("hh:mm:ss") ;
142143
infoLabel1 = new QLabel(tr("Status bar ..."));
143144
infoLabel2 = new QLabel(tr("DX Entity"));
144145

145-
//qDebug() << "MainWindow::MainWindow: 00086" << QTime::currentTime().toString("hh:mm:ss") ;
146+
//qDebug() << "MainWindow::MainWindow: 00086" << QTime::currentTime().toString("hh:mm:ss") ;
146147
logWindow = new LogWindow(dataProxy, this);
147148
//qDebug() << Q_FUNC_INFO << ": 00087: " << QTime::currentTime().toString("hh:mm:ss") ;
148149

149150
searchWidget = new SearchWidget(dataProxy, this);
150151
//qDebug() << Q_FUNC_INFO << ": 00087.1: " << QTime::currentTime().toString("hh:mm:ss") ;
151152
//advancedSearchWidget = new AdvancedSearchWidget(dataProxy, this);
152-
//qDebug() << "MainWindow::MainWindow: 00087.2" << QTime::currentTime().toString("hh:mm:ss") ;
153+
//qDebug() << "MainWindow::MainWindow: 00087.2" << QTime::currentTime().toString("hh:mm:ss") ;
153154
infoWidget = new InfoWidget(dataProxy, this);
154155

155-
//qDebug() << Q_FUNC_INFO << ": 00088: " << QTime::currentTime().toString("hh:mm:ss") ;
156+
//qDebug() << Q_FUNC_INFO << ": 00088: " << QTime::currentTime().toString("hh:mm:ss") ;
156157
awardsWidget = new AwardsWidget(dataProxy, this);
157158

158159
//qDebug() << Q_FUNC_INFO << ": 0009: " << QTime::currentTime().toString("hh:mm:ss") ;
@@ -164,19 +165,19 @@ MainWindow::MainWindow(const QString &tversion)
164165

165166
statusBarMessage = tr("Starting KLog");
166167

167-
//qDebug() << Q_FUNC_INFO << ": 40: " << QTime::currentTime().toString("hh:mm:ss") ;
168-
world = new World(dataProxy, Q_FUNC_INFO);
168+
//qDebug() << Q_FUNC_INFO << ": 40: " << QTime::currentTime().toString("hh:mm:ss") ;
169+
169170

170171
//qDebug() << Q_FUNC_INFO << ": 50: " << QTime::currentTime().toString("hh:mm:ss") ;
171172

172-
//qDebug() << Q_FUNC_INFO << ": 51: " << QTime::currentTime().toString("hh:mm:ss") ;
173+
//qDebug() << Q_FUNC_INFO << ": 51: " << QTime::currentTime().toString("hh:mm:ss") ;
173174
setupDialog = new SetupDialog(dataProxy, this);
174175

175176
//qDebug() << Q_FUNC_INFO << ": satTabWidget to be created " ;
176177
satTabWidget = new MainWindowSatTab(dataProxy);
177-
//qDebug() << Q_FUNC_INFO << ": 52: " << QTime::currentTime().toString("hh:mm:ss") ;
178+
//qDebug() << Q_FUNC_INFO << ": 52: " << QTime::currentTime().toString("hh:mm:ss") ;
178179
QSOTabWidget = new MainWindowInputQSO(dataProxy);
179-
//qDebug() << Q_FUNC_INFO << ": 53: " << QTime::currentTime().toString("hh:mm:ss") ;
180+
//qDebug() << Q_FUNC_INFO << ": 53: " << QTime::currentTime().toString("hh:mm:ss") ;
180181
myDataTabWidget = new MainWindowMyDataTab(dataProxy);
181182
//qDebug() << Q_FUNC_INFO << ": 54: " << QTime::currentTime().toString("hh:mm:ss") ;
182183
commentTabWidget = new MainWindowInputComment();
@@ -186,14 +187,14 @@ MainWindow::MainWindow(const QString &tversion)
186187
eQSLTabWidget = new MainWindowInputEQSL(dataProxy);
187188
//qDebug() << Q_FUNC_INFO << ": 57: " << QTime::currentTime().toString("hh:mm:ss") ;
188189
QSLTabWidget = new MainWindowInputQSL(dataProxy);
189-
//qDebug() << Q_FUNC_INFO << ": 58: " << QTime::currentTime().toString("hh:mm:ss") ;
190+
//qDebug() << Q_FUNC_INFO << ": 58: " << QTime::currentTime().toString("hh:mm:ss") ;
190191
mainQSOEntryWidget = new MainQSOEntryWidget(dataProxy);
191192

192-
//qDebug() << Q_FUNC_INFO << ": locator to be created 59" << QTime::currentTime().toString("hh:mm:ss") ;
193+
//qDebug() << Q_FUNC_INFO << ": locator to be created 59" << QTime::currentTime().toString("hh:mm:ss") ;
193194
locator = new Locator();
194195

195196
mainWidget = new QWidget(this);
196-
//qDebug() << Q_FUNC_INFO << ": 60 " << QTime::currentTime().toString("hh:mm:ss") ;
197+
//qDebug() << Q_FUNC_INFO << ": 60 " << QTime::currentTime().toString("hh:mm:ss") ;
197198

198199
dateTime = std::make_unique<QDateTime>();
199200
// UI DX
@@ -205,7 +206,7 @@ MainWindow::MainWindow(const QString &tversion)
205206
dxClusterWidget = new DXClusterWidget(dataProxy, this);
206207
dxClusterAssistant = new DXClusterAssistant(Q_FUNC_INFO);
207208

208-
//qDebug() << Q_FUNC_INFO << ": Awards to be created " << QTime::currentTime().toString("hh:mm:ss") ;
209+
//qDebug() << Q_FUNC_INFO << ": Awards to be created " << QTime::currentTime().toString("hh:mm:ss") ;
209210
awards = new Awards(dataProxy, Q_FUNC_INFO);
210211
//qDebug() << Q_FUNC_INFO << ": Awards created " << QTime::currentTime().toString("hh:mm:ss") ;
211212
// </UI>
@@ -215,7 +216,7 @@ MainWindow::MainWindow(const QString &tversion)
215216
exit(0);
216217
}
217218

218-
//qDebug() << Q_FUNC_INFO << ": Software update to be created " << QTime::currentTime().toString("hh:mm:ss") ;
219+
//qDebug() << Q_FUNC_INFO << ": Software update to be created " << QTime::currentTime().toString("hh:mm:ss") ;
219220
softUpdate = new SoftwareUpdate(softwareVersion);
220221
//qDebug() << Q_FUNC_INFO << ": FileManager to be created " << QTime::currentTime().toString("hh:mm:ss") ;
221222

@@ -231,7 +232,7 @@ MainWindow::MainWindow(const QString &tversion)
231232
showAdifImportWidget = new ShowAdifImportWidget(dataProxy, Q_FUNC_INFO);
232233

233234
logEvent(Q_FUNC_INFO, "END", Debug);
234-
//qDebug() << Q_FUNC_INFO << ": END " << QTime::currentTime().toString("hh:mm:ss") ;
235+
//qDebug() << Q_FUNC_INFO << ": END " << QTime::currentTime().toString("hh:mm:ss") ;
235236
}
236237

237238
MainWindow::~MainWindow()
@@ -453,14 +454,15 @@ void MainWindow::checkHomeDir()
453454

454455
void MainWindow::init()
455456
{
456-
//qDebug() << Q_FUNC_INFO << " - Start - " << (QTime::currentTime()).toString("HH:mm:ss") ;
457+
//qDebug() << Q_FUNC_INFO << " - Start - " << (QTime::currentTime()).toString("HH:mm:ss") ;
457458
logLevel = Debug;
458459
logEvent(Q_FUNC_INFO, "Start", Debug);
459460
checkHomeDir();
460461
checkDebugFile();
461462

462463
//qDebug() << Q_FUNC_INFO << " - 00" ;
463-
world->readWorld();
464+
//world->readWorld();
465+
//world->create(util->getCTYFile());
464466
//util->setLongPrefixes(dataProxy->getLongPrefixes());
465467
//util->setSpecialCalls(dataProxy->getSpecialCallsigns());
466468

@@ -538,7 +540,7 @@ void MainWindow::init()
538540
//qDebug() << Q_FUNC_INFO << " - 130";
539541

540542
applySettings ();
541-
//qDebug() << Q_FUNC_INFO << " - END" << (QTime::currentTime()).toString("HH:mm:ss") ;
543+
//qDebug() << Q_FUNC_INFO << " - END" << (QTime::currentTime()).toString("HH:mm:ss") ;
542544
logEvent(Q_FUNC_INFO, "END", Debug);
543545
}
544546

@@ -5147,14 +5149,14 @@ void MainWindow::slotAnalyzeDxClusterSignal(const DXSpot &_spot)
51475149
logEvent(Q_FUNC_INFO, "Start", Debug);
51485150

51495151
DXSpot spot = _spot;
5150-
if (spot.isValid())
5151-
qDebug() << Q_FUNC_INFO << " - Spot is Valid";
5152-
else
5153-
qDebug() << Q_FUNC_INFO << " - Spot is NOT Valid";
5154-
qDebug() << Q_FUNC_INFO << ": spot-dxCall : " << spot.getDxCall();
5155-
qDebug() << Q_FUNC_INFO << ": spot-Spotter : " << spot.getSpotter();
5156-
qDebug() << Q_FUNC_INFO << ": spot-Freq : " << spot.getFrequency().toQString();
5157-
qDebug() << Q_FUNC_INFO << ": spot-Comment : " << spot.getComment();
5152+
//if (spot.isValid())
5153+
//qDebug() << Q_FUNC_INFO << " - Spot is Valid";
5154+
//else
5155+
//qDebug() << Q_FUNC_INFO << " - Spot is NOT Valid";
5156+
//qDebug() << Q_FUNC_INFO << ": spot-dxCall : " << spot.getDxCall();
5157+
//qDebug() << Q_FUNC_INFO << ": spot-Spotter : " << spot.getSpotter();
5158+
//qDebug() << Q_FUNC_INFO << ": spot-Freq : " << spot.getFrequency().toQString();
5159+
//qDebug() << Q_FUNC_INFO << ": spot-Comment : " << spot.getComment();
51585160

51595161
EntityStatus _entityStatus;
51605162
_entityStatus.entityId = world->getQRZARRLId(spot.getDxCall());

src/setuppages/setuppageuserdata.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
#include "setuppageuserdata.h"
2828
#include "../callsign.h"
2929

30+
3031
SetupPageUserDataPage::SetupPageUserDataPage(DataProxy_SQLite *dp, QWidget *parent) : QWidget(parent){
31-
qDebug() << Q_FUNC_INFO << " - Start";
32+
//qDebug() << Q_FUNC_INFO << " - Start";
3233
slotQRZRunning = false;
3334
locator = new Locator();
3435
util = new Utilities(Q_FUNC_INFO);
@@ -244,7 +245,7 @@ SetupPageUserDataPage::~SetupPageUserDataPage()
244245
//qDebug() << Q_FUNC_INFO << " - Start";
245246
delete(locator);
246247
delete(util);
247-
delete(world);
248+
//delete(world);
248249
delete(defaultPalette);
249250
delete(wrongPalette);
250251
delete(dataProxy);
@@ -277,14 +278,14 @@ void SetupPageUserDataPage::slotEnterKeyPressed()
277278

278279
void SetupPageUserDataPage::slotQRZTextChanged()
279280
{
280-
qDebug() << Q_FUNC_INFO << " - Start";
281+
//qDebug() << Q_FUNC_INFO << " - Start";
281282
if (slotQRZRunning)
282283
{
283-
qDebug() << Q_FUNC_INFO << " - END-1";
284+
//qDebug() << Q_FUNC_INFO << " - END-1";
284285
return;
285286
}
286287
slotQRZRunning = true;
287-
qDebug() << Q_FUNC_INFO << " - " << maincallsignLineEdit->text() << " / Length: " << QString::number((maincallsignLineEdit->text()).size());
288+
//qDebug() << Q_FUNC_INFO << " - " << maincallsignLineEdit->text() << " / Length: " << QString::number((maincallsignLineEdit->text()).size());
288289

289290
int i = maincallsignLineEdit->cursorPosition();
290291

@@ -335,7 +336,7 @@ int SetupPageUserDataPage::getITUz()
335336

336337
bool SetupPageUserDataPage::setMainCallsign(const QString &_qrz)
337338
{
338-
qDebug() << Q_FUNC_INFO << ": " << _qrz;
339+
//qDebug() << Q_FUNC_INFO << ": " << _qrz;
339340
Callsign callsign(_qrz);
340341
if (!callsign.isValid())
341342
return false;

0 commit comments

Comments
 (0)