diff --git a/AUTHORS b/AUTHORS
index 0ba3fa45..c34a8602 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,5 +1,5 @@
Jaime Robles, EA4K - (2002-today)
-Akihiro Koda, JL3OXR - (2016, 2020)
+Akihiro Koda, JL3OXR - (2016-2017)
Andrew Goldie, ZL2ACG - (2009-2010)
Translators:
diff --git a/COPYING b/COPYING
index 2a000655..94a9ed02 100644
--- a/COPYING
+++ b/COPYING
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see .
+ along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
-.
+.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
-.
+.
diff --git a/Changelog b/Changelog
index d0a06f68..5fea0f96 100644
--- a/Changelog
+++ b/Changelog
@@ -1,54 +1,5 @@
-May 2020 - 1.1
-- Improvement: Search widget has been improved.
-- Improvement: Callsigns are always checked to be a good callsign before they are saved to the log, imported and exported to ADIF.
-- Improvement: Removed some death code.
-- Improvement: If TX Freq & RX Freq are the same, only TX Freq is exported.
-- Improvement: New functions to check calls when importing ADIF logs.
-- Improvement: Improved how CTY.CSV (country files) is working.
-- UI: Widget to show the QSOs to be exported to ADIF & LoTW.
-- UI: Widget to show the QSOs updated from ADIF & LoTW.
-- UI: Clear the UI also clears the status of a DXCC in the Band status widget.
-- UI: Added a checkbox to easily enable/disable the real time in the QSO entry box.
-- UI: Passwords are now hidden in the UI when entered.
-- BugFix: Only QSOs are now updated when data is uploaded from LoTW.
-- BugFix: DXCC & WAZ information was updated twice when removing a QSO.
-- BugFix: DXCC & WAZ count.
-- BugFix: Fixed one SQL query on satellite.
-- Bugfix: Fixed the print function. (JL3OXR).
-- Translations: Catalan (TNX Txema), Spanish (EA4K).
-
-April 2020 - 1.0.1
-- BugFix: UTC time was not properly managed, specially in the date.
-
-March 2020 - 1.0
-- UI: Removed the first column inthe DXCC widget to make it more user friendly.
-- UI: Created a widget to manage the Main QSO entry to make KLog more modular.
-- UI: eQSL & LoTW are marked as queued to be sent by default if the user activates it in the setup.
-- UI: Added the title to some QMessage boxes that were missing.
-- UI: Improved the usability of creating new logs or editing existing logs in the setup.
-- New feature: Integrate TQSL to upload QSOs to LoTW directly from KLog.
-- New feature: You can check a call in QRZ.com by right-clicking in the call from the log.
-- New feature: You can check a call in DXHeat.com by right-clicking in the call from the log.
-- New feature: It is now possible to save in a file all the DX-Cluster activity.
-- Improvement: Added https to the cty.dat download.
-- Improvement: Added the https to download.klog.xyz
-- Improvement: Propagation modes are now sorted in the Propagation mode combobox.
-- Improvement: Four new tips added.
-- Improvement: eQSL & LoTW dates are updated always that are modified to any status.
-- Improvement: If a QSO does not have a freq, a default freq based on the band is assigned if edited.
-- Improvement: Removed some deprecated functions.
-- Improvement: Improved the way KLog checks for a wrong call (IARU rules applied).
-- Improvement: Improved the way KLog checks for a wrong IOTA reference.
-- Removed the functionality to sort the log based on Date & Time columns.
-- Removed one console message about a duplicated database connection.
-- Bugfix: It was not possible to include new dxcluster servers in the setup.
-- Bugfix: The default value of RST in some digital modes using SNR were not properly shown.
-- Bugfix: In translated instances of KLog, Propagation mode was sometimes not properly saved when no propagation mode eas selected.
-- BugFix: Locator in SAT widget was not always not correctly evaluated as correct.
-- Updated translations: Catalan (TNX Txema), Croatian (TNX M0NKC), Finnish (TNX Kristjan), Spanish (EA4K).
-
February 2020 - 0.9.9.1
-- BugFix: Bands & modes where sometimes duplicated in the combobox (TNX G4MKT).
+- BugFix: Bands & Modes where sometimes duplicated in the combobox (TNX G4MKT).
January 2020 - 0.9.9
- UI: Created a widget to manage the Awards to make KLog more modular.
@@ -585,7 +536,7 @@ The information comming from all the appearances of a call in the log is grouped
- New feature: KLog ask the user for a comment when Importing a TLF log (for example
to note that those QSO are from an specific contest or whatever).
- Bug fixed: When selecting a DX-Spot from the DX-Cluster it did not overwrote the name.
-- Bug fixed: When writing the log, there was an space missing before the .
+- Bug fixed: When writting the log, there was an space missing before the .
It is just a "cosmetic" fix, not a real bug.
- Bug fixed: The same with the QSL card status.
- Bug fixed: KLog now recognises all the prefix that appears in cty.dat file with
diff --git a/KLog.pro b/KLog.pro
index 69143cd8..4f584ab2 100644
--- a/KLog.pro
+++ b/KLog.pro
@@ -1,302 +1,291 @@
-CONFIG += app_bundle
-CONFIG += static
-CONFIG -=depend_includepath
-#CONFIG += release
-TEMPLATE = app
-VERSION = 1.1
-DEFINES += APP_VERSION="$$VERSION"
-
-APP_NAME = KLog
-DEFINES += APP_NAME="$$APP_NAME"
-
-APP_UNIX_NAME = klog
-DEFINES += APP_UNIX_NAME="$$APP_UNIX_NAME"
-
-message(Building $${APP_NAME} $${VERSION})
-message(Qt $$[QT_VERSION] in $$[QT_INSTALL_PREFIX])
-
-#DEFINES *= QT_NO_DEBUG_OUTPUT
-DEFINES *= QT_USE_QSTRINGBUILDER
-DEFINES *= QT_STRICT_ITERATORS
-
-TARGET = $${APP_UNIX_NAME}
-
-QT += core \
- gui \
- sql \
- network \
- serialport \
- printsupport \
- charts \
- widgets
-
-greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4)
-{
- macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
-}
-
-HEADERS += setupdialog.h \
- aboutdialog.h \
- awardswidget.h \
- lotwutilities.h \
- mainqsoentrywidget.h \
- mainwindow.h \
- pstrotatorsupport.h \
- widgets/adiflotwexportwidget.h \
- widgets/showadifimportwidget.h \
- world.h \
- logwindow.h \
- filemanager.h \
- database.h \
- locator.h \
- dxcluster.h \
- awards.h \
- startwizard.h \
- downloadcty.h \
- dataproxy_sqlite.h \
- mainwindowsattab.h \
- awarddxmarathon.h \
- elogclublog.h \
- softwareupdate.h \
- softwareupdatedialog.h \
- utilities.h \
- dxccstatuswidget.h \
- mainwindowmydatatab.h \
- mainwindowinputcomment.h \
- mainwindowinputothers.h \
- mainwindowinputeqsl.h \
- mainwindowinputqsl.h \
- logmodel.h \
- searchwidget.h \
- infowidget.h \
- showerrordialog.h \
- udpserver.h \
- statisticswidget.h \
- charts/barchartstats.h \
- updatesatsdata.h \
- hamlibclass.h \
- tipsdialog.h \
- worldmapwidget.h \
- widgets/rotator.h \
- widgets/rotatorcontrol.h \
- setuppages/setuppageinterfaceswindows.h \
- setuppages/setuppagelotw.h \
- setuppages/setuppagemisc.h \
- setuppages/setuppageuserdata.h \
- setuppages/setuppagedxcluster.h \
- setuppages/setuppagecolors.h \
- setuppages/setuppagelogs.h \
- setuppages/setuppageworldeditor.h \
- setuppages/setuppagesats.h \
- setuppages/setuppagesatsnew.h \
- setuppages/setuppagehamlib.h \
- setuppages/setuppagelogsnew.h \
- setuppages/setuppageclublog.h \
- setuppages/setuppagebandmode.h \
- setuppages/setupentitydialog.h \
- setuppages/setuppageudp.h \
- charts/statsgeneralchartwidget.h \
- charts/statsqsosperyearbarchartwidget.h \
- charts/statsentitiesperyearbarchartwidget.h \
- charts/statscqzperyearbarchartwidget.h \
- charts/statsqsosperbandbarchartwidget.h \
- charts/statsqsospermodebarchartwidget.h \
- charts/statsqsosperdxccbarchartwidget.h \
- charts/statsqsospercontinentbarchartwidget.h \
- charts/statsqsosperhourbarchartwidget.h \
- charts/statsqsospermonthbarchartwidget.h \
- charts/statsworkedconfirmedpiechartwidget.h \
- charts/statsworkedsentpiechartwidget.h \
- charts/statssentconfirmedpiechartwidget.h
-
-message(Sources)
-
-SOURCES += main.cpp \
- aboutdialog.cpp \
- awardswidget.cpp \
- lotwutilities.cpp \
- mainqsoentrywidget.cpp \
- mainwindow.cpp \
- pstrotatorsupport.cpp \
- setupdialog.cpp \
- widgets/adiflotwexportwidget.cpp \
- widgets/rotator.cpp \
- widgets/rotatorcontrol.cpp \
- widgets/showadifimportwidget.cpp \
- world.cpp \
- logwindow.cpp \
- filemanager.cpp \
- database.cpp \
- dataproxy_sqlite.cpp \
- downloadcty.cpp \
- dxcluster.cpp \
- locator.cpp \
- awards.cpp \
- setuppages/setuppageinterfaceswindows.cpp \
- setuppages/setuppagelotw.cpp \
- setuppages/setuppagemisc.cpp \
- setuppages/setuppageuserdata.cpp \
- setuppages/setuppagedxcluster.cpp \
- setuppages/setuppagecolors.cpp \
- setuppages/setuppagelogs.cpp \
- setuppages/setuppageworldeditor.cpp \
- setuppages/setuppagelogsnew.cpp \
- setuppages/setuppageclublog.cpp \
- setuppages/setuppagebandmode.cpp \
- setuppages/setuppageudp.cpp \
- setuppages/setuppagesats.cpp \
- setuppages/setuppagesatsnew.cpp \
- setuppages/setuppagehamlib.cpp \
- setuppages/setupentitydialog.cpp \
- startwizard.cpp \
- mainwindowsattab.cpp \
- awarddxmarathon.cpp \
- elogclublog.cpp \
- softwareupdate.cpp \
- softwareupdatedialog.cpp \
- utilities.cpp \
- dxccstatuswidget.cpp \
- mainwindowmydatatab.cpp \
- mainwindowinputcomment.cpp \
- mainwindowinputothers.cpp \
- mainwindowinputeqsl.cpp \
- mainwindowinputqsl.cpp \
- logmodel.cpp \
- searchwidget.cpp \
- infowidget.cpp \
- showerrordialog.cpp \
- udpserver.cpp \
- statisticswidget.cpp \
- charts/barchartstats.cpp \
- updatesatsdata.cpp \
- charts/statsgeneralchartwidget.cpp \
- charts/statsqsosperyearbarchartwidget.cpp \
- charts/statsentitiesperyearbarchartwidget.cpp \
- charts/statscqzperyearbarchartwidget.cpp \
- charts/statsqsospermodebarchartwidget.cpp \
- charts/statsqsosperdxccbarchartwidget.cpp \
- charts/statsqsospercontinentbarchartwidget.cpp \
- charts/statsqsosperhourbarchartwidget.cpp \
- charts/statsqsospermonthbarchartwidget.cpp \
- charts/statsworkedconfirmedpiechartwidget.cpp \
- charts/statsworkedsentpiechartwidget.cpp \
- charts/statssentconfirmedpiechartwidget.cpp \
- charts/statsqsosperbandbarchartwidget.cpp \
- hamlibclass.cpp \
- tipsdialog.cpp \
- worldmapwidget.cpp
-
-
-message (Other files)
-
-OTHER_FILES += \
- README-DEVEL \
- TODO \
- tips-for-devel.txt \
- INSTALL.txt \
- INSTALL-linux \
- INSTALL-win.txt \
- Changelog \
- INSTALL-osx.txt \
- NEWS \
- klog.1 \
- COPYING \
- AUTHORS \
- README
-
-message (More...)
-RESOURCES += klog.qrc
-DESTDIR = build/target/
-OBJECTS_DIR = build/obj/
-MOC_DIR = build/moc/
-RCC_DIR = build/rcc/
-#D_OBJECTS = $(SRC:%.cpp=build/obj/%.o)
-#R_OBJECTS = $(SRC:%.cpp=build/obj/%.o)
-
-# Tell Qt Linguist that we use UTF-8 strings in our sources
-CODECFORTR = UTF-8
-CODECFORSRC = UTF-8
-#include(translations/translations.pri)
-message (Translations)
-
-TRANSLATIONS = translations/klog_es.ts \
- translations/klog_ca.ts \
- translations/klog_da.ts \
- translations/klog_de.ts \
- translations/klog_fi.ts \
- translations/klog_fr.ts \
- translations/klog_hr.ts \
- translations/klog_it.ts \
- translations/klog_pl.ts \
- translations/klog_ja.ts
-
-message(End of translations...)
-
-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 }
- }
-}
-
-updateqm.input = TRANSLATIONS
-updateqm.output = $$DESTDIR/translations/${QMAKE_FILE_BASE}.qm
-updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$DESTDIR/translations/${QMAKE_FILE_BASE}.qm
-updateqm.CONFIG += no_link target_predeps
-QMAKE_EXTRA_COMPILERS += updateqm
-
-
-# deploy
-DISTFILES += Changelog COPYING
-
-unix:!mac {
- DEFINES += APP_LINUX
- CONFIG += c++11
-# Translations should be copied in /usr/share/klog/translations
-# https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
-# QT += dbus
- isEmpty(PREFIX):PREFIX = /usr
- BINDIR = $$PREFIX/bin
- DATADIR = $$PREFIX/share
- PKGDATADIR = $$DATADIR/klog
- INSTALLS += target
- target.path = $$BINDIR
-# DEFINES += DATADIR=\\\"$$DATADIR\\\" \
-# PKGDATADIR=\\\"$$PKGDATADIR\\\"
-# translations.path = /usr/share/klog/translations
- translations.path = $$PKGDATADIR/translations
-# translations.files += build/target/translations/*
- translations.files += $$DESTDIR/translations/*
- #INSTALLS += translations
- datafiles.path = $$PKGDATADIR
- datafiles.files = $$DISTFILES
- INSTALLS += translations
- INSTALLS += datafiles
- LIBS += -lhamlib
-}
-
-macx: {
- ICON = klog.icns
- TARGET = KLog
- CONFIG += c++11
- INCLUDEPATH +=../hamlib/include/
- LIBS += -L"../hamlib/lib" -lhamlib
-}
-
-win32: {
- RC_ICONS = klog.ico
- TARGET = klog
- QMAKE_TARGET_COMPANY = EA4K
- QMAKE_TARGET_DESCRIPTION = Hamradio logging
- LIBS += -L"$$PWD/../libs/hamlib-w32-3.3/lib/gcc" -lhamlib
- INCLUDEPATH += "$$PWD/../libs/hamlib-w32-3.3/include/"
-}
-
-else:
-{
- TARGET = klog
-}
-
+CONFIG += app_bundle
+CONFIG += static
+#CONFIG += release
+TEMPLATE = app
+VERSION = 0.9.9
+DEFINES += APP_VERSION="$$VERSION"
+
+APP_NAME = KLog
+DEFINES += APP_NAME="$$APP_NAME"
+
+APP_UNIX_NAME = klog
+DEFINES += APP_UNIX_NAME="$$APP_UNIX_NAME"
+
+message(Building $${APP_NAME} $${VERSION})
+message(Qt $$[QT_VERSION] in $$[QT_INSTALL_PREFIX])
+
+#DEFINES *= QT_NO_DEBUG_OUTPUT
+DEFINES *= QT_USE_QSTRINGBUILDER
+DEFINES *= QT_STRICT_ITERATORS
+
+TARGET = $${APP_UNIX_NAME}
+
+QT += core \
+ gui \
+ sql \
+ network \
+ serialport \
+ widgets
+
+
+greaterThan(QT_MAJOR_VERSION, 4) {
+ QT += printsupport
+ QT += widgets \
+ charts
+}
+
+
+greaterThan(QT_MAJOR_VERSION, 4):greaterThan(QT_MINOR_VERSION, 4) {
+macx:QMAKE_LFLAGS += -Wl,-rpath,@executable_path/../Frameworks
+}
+
+HEADERS += setupdialog.h \
+ aboutdialog.h \
+ awardswidget.h \
+ logviewsortfilterproxymodel.h \
+ mainwindow.h \
+ world.h \
+ logwindow.h \
+ filemanager.h \
+ database.h \
+ setuppagemisc.h \
+ locator.h \
+ dxcluster.h \
+ awards.h \
+ setuppageuserdata.h \
+ setuppagedxcluster.h \
+ setuppagecolors.h \
+ setuppagelogs.h \
+ setuppageworldeditor.h \
+ setupentitydialog.h \
+ startwizard.h \
+ downloadcty.h \
+ dataproxy_sqlite.h \
+ mainwindowsattab.h \
+ awarddxmarathon.h \
+ setuppagelogsnew.h \
+ setuppageclublog.h \
+ elogclublog.h \
+ softwareupdate.h \
+ softwareupdatedialog.h \
+ utilities.h \
+ dxccstatuswidget.h \
+ mainwindowmydatatab.h \
+ mainwindowinputcomment.h \
+ mainwindowinputothers.h \
+ mainwindowinputeqsl.h \
+ mainwindowinputqsl.h \
+ setuppagebandmode.h \
+ logmodel.h \
+ searchwidget.h \
+ infowidget.h \
+ showerrordialog.h \
+ udpserver.h \
+ setuppageudp.h \
+ statisticswidget.h \
+ charts/barchartstats.h \
+ updatesatsdata.h \
+ charts/statsgeneralchartwidget.h \
+ charts/statsqsosperyearbarchartwidget.h \
+ charts/statsentitiesperyearbarchartwidget.h \
+ charts/statscqzperyearbarchartwidget.h \
+ charts/statsqsosperbandbarchartwidget.h \
+ charts/statsqsospermodebarchartwidget.h \
+ charts/statsqsosperdxccbarchartwidget.h \
+ charts/statsqsospercontinentbarchartwidget.h \
+ charts/statsqsosperhourbarchartwidget.h \
+ charts/statsqsospermonthbarchartwidget.h \
+ charts/statsworkedconfirmedpiechartwidget.h \
+ charts/statsworkedsentpiechartwidget.h \
+ charts/statssentconfirmedpiechartwidget.h \
+ setuppagesats.h \
+ setuppagesatsnew.h \
+ setuppagehamlib.h \
+ hamlibclass.h \
+ tipsdialog.h \
+ worldmapwidget.h
+
+message(Sources)
+
+SOURCES += main.cpp \
+ aboutdialog.cpp \
+ awardswidget.cpp \
+ logviewsortfilterproxymodel.cpp \
+ mainwindow.cpp \
+ setupdialog.cpp \
+ world.cpp \
+ logwindow.cpp \
+ filemanager.cpp \
+ database.cpp \
+ dataproxy_sqlite.cpp \
+ downloadcty.cpp \
+ dxcluster.cpp \
+ setuppagemisc.cpp \
+ locator.cpp \
+ awards.cpp \
+ setuppageuserdata.cpp \
+ setuppagedxcluster.cpp \
+ setuppagecolors.cpp \
+ setuppagelogs.cpp \
+ setuppageworldeditor.cpp \
+ setupentitydialog.cpp \
+ startwizard.cpp \
+ mainwindowsattab.cpp \
+ awarddxmarathon.cpp \
+ setuppagelogsnew.cpp \
+ setuppageclublog.cpp \
+ elogclublog.cpp \
+ softwareupdate.cpp \
+ softwareupdatedialog.cpp \
+ utilities.cpp \
+ dxccstatuswidget.cpp \
+ mainwindowmydatatab.cpp \
+ mainwindowinputcomment.cpp \
+ mainwindowinputothers.cpp \
+ mainwindowinputeqsl.cpp \
+ mainwindowinputqsl.cpp \
+ setuppagebandmode.cpp \
+ logmodel.cpp \
+ searchwidget.cpp \
+ infowidget.cpp \
+ showerrordialog.cpp \
+ udpserver.cpp \
+ setuppageudp.cpp \
+ statisticswidget.cpp \
+ charts/barchartstats.cpp \
+ updatesatsdata.cpp \
+ charts/statsgeneralchartwidget.cpp \
+ charts/statsqsosperyearbarchartwidget.cpp \
+ charts/statsentitiesperyearbarchartwidget.cpp \
+ charts/statscqzperyearbarchartwidget.cpp \
+ charts/statsqsospermodebarchartwidget.cpp \
+ charts/statsqsosperdxccbarchartwidget.cpp \
+ charts/statsqsospercontinentbarchartwidget.cpp \
+ charts/statsqsosperhourbarchartwidget.cpp \
+ charts/statsqsospermonthbarchartwidget.cpp \
+ charts/statsworkedconfirmedpiechartwidget.cpp \
+ charts/statsworkedsentpiechartwidget.cpp \
+ charts/statssentconfirmedpiechartwidget.cpp \
+ charts/statsqsosperbandbarchartwidget.cpp \
+ setuppagesats.cpp \
+ setuppagesatsnew.cpp \
+ setuppagehamlib.cpp \
+ hamlibclass.cpp \
+ tipsdialog.cpp \
+ worldmapwidget.cpp
+
+
+message (Other files)
+
+OTHER_FILES += \
+ README-DEVEL \
+ TODO \
+ tips-for-devel.txt \
+ INSTALL.txt \
+ INSTALL-linux \
+ INSTALL-win.txt \
+ Changelog \
+ INSTALL-osx.txt \
+ NEWS \
+ klog.1 \
+ COPYING \
+ AUTHORS \
+ README
+
+message (More...)
+RESOURCES += klog.qrc
+DESTDIR = build/target/
+OBJECTS_DIR = build/obj/
+MOC_DIR = build/moc/
+RCC_DIR = build/rcc/
+#D_OBJECTS = $(SRC:%.cpp=build/obj/%.o)
+#R_OBJECTS = $(SRC:%.cpp=build/obj/%.o)
+
+# Tell Qt Linguist that we use UTF-8 strings in our sources
+CODECFORTR = UTF-8
+CODECFORSRC = UTF-8
+#include(translations/translations.pri)
+message (Translations)
+
+TRANSLATIONS = translations/klog_es.ts \
+ translations/klog_ca.ts \
+ translations/klog_da.ts \
+ translations/klog_de.ts \
+ translations/klog_fi.ts \
+ translations/klog_fr.ts \
+ translations/klog_hr.ts \
+ translations/klog_it.ts \
+ translations/klog_pl.ts \
+ translations/klog_ja.ts
+
+message(End of translations...)
+
+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 }
+ }
+}
+
+updateqm.input = TRANSLATIONS
+updateqm.output = $$DESTDIR/translations/${QMAKE_FILE_BASE}.qm
+updateqm.commands = $$QMAKE_LRELEASE ${QMAKE_FILE_IN} -qm $$DESTDIR/translations/${QMAKE_FILE_BASE}.qm
+updateqm.CONFIG += no_link target_predeps
+QMAKE_EXTRA_COMPILERS += updateqm
+
+
+# deploy
+DISTFILES += Changelog COPYING
+
+unix:!mac {
+ DEFINES += APP_LINUX
+ CONFIG += c++11
+# Translations should be copied in /usr/share/klog/translations
+# https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
+# QT += dbus
+ isEmpty(PREFIX):PREFIX = /usr
+ BINDIR = $$PREFIX/bin
+ DATADIR = $$PREFIX/share
+ PKGDATADIR = $$DATADIR/klog
+ INSTALLS += target
+ target.path = $$BINDIR
+# DEFINES += DATADIR=\\\"$$DATADIR\\\" \
+# PKGDATADIR=\\\"$$PKGDATADIR\\\"
+# translations.path = /usr/share/klog/translations
+ translations.path = $$PKGDATADIR/translations
+# translations.files += build/target/translations/*
+ translations.files += $$DESTDIR/translations/*
+ #INSTALLS += translations
+ datafiles.path = $$PKGDATADIR
+ datafiles.files = $$DISTFILES
+ INSTALLS += translations
+ INSTALLS += datafiles
+ LIBS += -lhamlib
+
+}
+
+macx: {
+ ICON = klog.icns
+ TARGET = KLog
+ CONFIG += c++11
+ INCLUDEPATH +=../hamlib/include/
+ LIBS += -L"../hamlib/lib" -lhamlib
+}
+
+win32: {
+ RC_ICONS = klog.ico
+ TARGET = klog
+ QMAKE_TARGET_COMPANY = EA4K
+ QMAKE_TARGET_DESCRIPTION = Hamradio logging
+ LIBS += -L"C:/radio/hamlib-w32-3.3/lib/gcc" -lhamlib
+ INCLUDEPATH += "C:/radio/hamlib-w32-3.3/include/"
+}
+
+else:
+{
+ TARGET = klog
+}
+
diff --git a/NEWS b/NEWS
index d4a2a2fe..422b3ba4 100644
--- a/NEWS
+++ b/NEWS
@@ -1,2 +1,2 @@
-Look at https://www.klog.xyz for NEWS of KLog.
-You can also check the Changelog file for the latest updates in the software.
+Look at http://www.klog.xyz for NEWS of KLog.
+You can also check the Changelog file for the latest updates in the software.
\ No newline at end of file
diff --git a/aboutdialog.cpp b/aboutdialog.cpp
index f822d1ba..6a681541 100644
--- a/aboutdialog.cpp
+++ b/aboutdialog.cpp
@@ -9,7 +9,7 @@
AboutDialog::AboutDialog(const QString &tversion, QWidget *parent)
: QDialog(parent)
{
- //qDebug() << "AboutDialog::AboutDialog" << endl;
+ //qDebug() << "AboutDialog::AboutDialog" << endl;
QPixmap pixmap(":/img/klog_256x256.png");
@@ -24,13 +24,13 @@ AboutDialog::AboutDialog(const QString &tversion, QWidget *parent)
const QString description = "KLog " + tversion + "
" +tr("By") +
" EA4K - 2002-2020
" +
tr("KLog is a free logbook for hamradio operators.") +"
" +
- tr("Please be aware that this is a development release and it may contain many bugs.
Backup your data before using this software!") +
+ tr("Please know that this is an BETA release and it may contain many bugs.
Backup your data before using this software!") +
"
" +
- tr("Since 0.6.2, KLog has been fully rewritten to provide a cross-platform application that runs on all major operating systems (Linux, macOS and Windows) and to support new functionality.") +
+ tr("KLog has been fully rewritten from the 0.6.2 to be able to provide a cross-platform application that runs in the main operating systems (Linux, macOS & Windows) and provide new functionalities that KLog was not providing.") +
"
" +
tr("Please provide your review in KLog's eHam review page:") +
"
" +
- "https://www.eham.net/reviews/detail/3118
" +
+ "http://www.eham.net/reviews/detail/3118
" +
tr("Find more information and the latest release at") + "
https://www.klog.xyz
" +
tr("Author") + ": Jaime Robles, EA4K
jaime@robles.es";
@@ -89,7 +89,7 @@ AboutDialog::AboutDialog(const QString &tversion, QWidget *parent)
translatorsLabel->setTextInteractionFlags(Qt::TextBrowserInteraction);
QString privacy = "" + tr("Privacy advisory") + "
" +
- tr("KLog developers have included a feature that reports some user data to the KLog server with the sole purpose of identifying the number of installed versions, to focus development in one direction or another taking into account users' needs.") +
+ tr("KLog developers have included a feature that reports some user data to the KLog server with the sole purpose of identifying the number of installed versions, to focus development in one direction or another taking into account user's needs.") +
"
" + tr("At present, the data that is provided is the following:") +
"- " + tr("Callsign") + "
- " + tr("KLog version") + "
- " + tr("Operating system") + "
" +
tr("Be aware that you can enable/disable this feature from the Misc tab in the Setup page.") + "";
@@ -141,7 +141,7 @@ AboutDialog::AboutDialog(const QString &tversion, QWidget *parent)
setLayout(layout);
- //qDebug() << "AboutDialog::AboutDialog - END" << endl;
+ //qDebug() << "AboutDialog::AboutDialog - END" << endl;
}
AboutDialog::~AboutDialog()
diff --git a/aboutdialog.h b/aboutdialog.h
index 0c54150f..b3acf936 100644
--- a/aboutdialog.h
+++ b/aboutdialog.h
@@ -23,7 +23,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/awarddxmarathon.cpp b/awarddxmarathon.cpp
index 779a429b..6e93a6d5 100644
--- a/awarddxmarathon.cpp
+++ b/awarddxmarathon.cpp
@@ -20,7 +20,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
#include "awarddxmarathon.h"
@@ -28,33 +28,33 @@
DXMarathon::DXMarathon(DataProxy_SQLite *dp)
{
- //qDebug() << "DXMarathon::DXMarathon" << endl;
+ //qDebug() << "DXMarathon::DXMarathon" << endl;
dataProxy = dp;
- //qDebug() << "DXMarathon::DXMarathon - END" << endl;
+ //qDebug() << "DXMarathon::DXMarathon - END" << endl;
}
int DXMarathon::getDXMarathonQSO(const int _year, const int _logNumber)
{
- //qDebug() << "DXMarathon::getDXMarathonQSO: " << QString::number(_year) << endl;
+ //qDebug() << "DXMarathon::getDXMarathonQSO: " << QString::number(_year) << endl;
return dataProxy->getQSOonYear(_year, _logNumber);
}
int DXMarathon::getDXMarathonDXCC(const int _year, const int _logNumber)
{
- //qDebug() << "DXMarathon::getDXMarathonDXCC: " << QString::number(_year) << endl;
+ //qDebug() << "DXMarathon::getDXMarathonDXCC: " << QString::number(_year) << endl;
return dataProxy->getDXCConYear(_year, _logNumber);
}
int DXMarathon::getDXMarathonCQ(const int _year, const int _logNumber)
{
- //qDebug() << "DXMarathon::getDXMarathonCQ: " << QString::number(_year) << endl;
+ //qDebug() << "DXMarathon::getDXMarathonCQ: " << QString::number(_year) << endl;
return dataProxy->getCQzonYear(_year, _logNumber);
}
int DXMarathon::getDXMarathonScore(const int _year, const int _logNumber)
{
- //qDebug() << "DXMarathon::getDXMarathonScore: " << QString::number(_year) << endl;
+ //qDebug() << "DXMarathon::getDXMarathonScore: " << QString::number(_year) << endl;
return ( getDXMarathonDXCC(_year, _logNumber) + getDXMarathonCQ(_year, _logNumber));
diff --git a/awarddxmarathon.h b/awarddxmarathon.h
index 366a45b3..d28a45ea 100644
--- a/awarddxmarathon.h
+++ b/awarddxmarathon.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/awards.cpp b/awards.cpp
index 95d1b68f..89524777 100644
--- a/awards.cpp
+++ b/awards.cpp
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
@@ -30,14 +30,14 @@
Awards::Awards(DataProxy_SQLite *dp, const QString &_parentFunction)
{
- //qDebug() << "Awards::Awards- from: " << _parentFunction << endl;
+ //qDebug() << "Awards::Awards- from: " << _parentFunction << endl;
dataProxy = dp;
//QSqlDatabase db = QSqlDatabase::database("QSQLITE");
world = new World(dataProxy, Q_FUNC_INFO);
- //qDebug() << "Awards::Awards - Before DXMarathon" << endl;
+ //qDebug() << "Awards::Awards - Before DXMarathon" << endl;
dxMarathon = new DXMarathon(dataProxy);
- //qDebug() << "Awards::Awards - After DXMarathon" << endl;
+ //qDebug() << "Awards::Awards - After DXMarathon" << endl;
util = new Utilities();
//world->create();
/*
@@ -61,26 +61,26 @@ Awards::Awards(DataProxy_SQLite *dp, const QString &_parentFunction)
wazWorked.clear();
wazConfirmed.clear();
manageModes = false;
- //qDebug() << "Awards::Awards - END" << endl;
+ //qDebug() << "Awards::Awards - END" << endl;
}
Awards::~Awards() {}
void Awards::setAwardDXCC(const int _qsoId)
{
- //qDebug() << "Awards::setAwardDXCC: _qsoId: " << QString::number(_qsoId) << endl;
+ //qDebug() << "Awards::setAwardDXCC: _qsoId: " << QString::number(_qsoId) << endl;
dataProxy->setDXCCAwardStatus(_qsoId);
}
void Awards::setAwardWAZ(const int _qsoId)
{
- //qDebug() << "Awards::setAwardWAZ: _qsoId: " << QString::number(_qsoId) << endl;
+ //qDebug() << "Awards::setAwardWAZ: _qsoId: " << QString::number(_qsoId) << endl;
dataProxy->setWAZAwardStatus(_qsoId);
}
QString Awards::getQSOofAward (const int _enti, const int _bandid)
{// Returns the QRZ that granted that status in the DXCC
- //qDebug() << "Awards::getQSOofAward: " << QString::number(_enti) << "/" << QString::number(_bandid) << endl;
+ //qDebug() << "Awards::getQSOofAward: " << QString::number(_enti) << "/" << QString::number(_bandid) << endl;
QSqlQuery query;
QString stringQuery = QString();
bool sqlOK = false;
@@ -89,7 +89,7 @@ QString Awards::getQSOofAward (const int _enti, const int _bandid)
stringQuery = QString("SELECT call, qso_date, time_on from log where id=(SELECT qsoid from awarddxcc where dxcc='%1' and band='%2')").arg(_enti).arg(_bandid);
sqlOK = query.exec(stringQuery);
- //qDebug() << "Awards::getQSOofAward: stringQuery: " << stringQuery << endl;
+ //qDebug() << "Awards::getQSOofAward: stringQuery: " << stringQuery << endl;
if (sqlOK)
{
query.next();
@@ -98,13 +98,13 @@ QString Awards::getQSOofAward (const int _enti, const int _bandid)
answer = query.value(0).toString() + " / " + query.value(1).toString() + " / " + query.value(2).toString();
query.finish();
- //qDebug() << "Awards::getQSOofAward: answer: " << answer << endl;
+ //qDebug() << "Awards::getQSOofAward: answer: " << answer << endl;
return answer;
}
else
{
query.finish();
- //qDebug() << "Awards::getQSOofAward: 0" << endl;
+ //qDebug() << "Awards::getQSOofAward: 0" << endl;
return QString();
}
}
@@ -112,7 +112,7 @@ QString Awards::getQSOofAward (const int _enti, const int _bandid)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "Awards::getQSOofAward: Query error" << endl;
+ //qDebug() << "Awards::getQSOofAward: Query error" << endl;
return QString();
}
@@ -120,7 +120,7 @@ QString Awards::getQSOofAward (const int _enti, const int _bandid)
int Awards::getQSOIdofAward (const int _enti, const int _bandid)
{// Returns the QSOid that granted that status in the DXCC
- //qDebug() << "Awards::getQSOIdofAward: " << QString::number(_enti) << "/" << QString::number(_bandid) << endl;
+ //qDebug() << "Awards::getQSOIdofAward: " << QString::number(_enti) << "/" << QString::number(_bandid) << endl;
QSqlQuery query;
QString stringQuery = QString();
bool sqlOK = false;
@@ -129,14 +129,14 @@ int Awards::getQSOIdofAward (const int _enti, const int _bandid)
stringQuery = QString("SELECT qsoid from awarddxcc where dxcc='%1' and band='%2'").arg(_enti).arg(_bandid);
sqlOK = query.exec(stringQuery);
- //qDebug() << "Awards::getQSOIdofAward: stringQuery: " << stringQuery << endl;
+ //qDebug() << "Awards::getQSOIdofAward: stringQuery: " << stringQuery << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
answer = query.value(0).toInt();
- //qDebug() << "Awards::getQSOIdofAward: answer: " << QString::number(answer) << endl;
+ //qDebug() << "Awards::getQSOIdofAward: answer: " << QString::number(answer) << endl;
query.finish();
if (answer>=1)
{
@@ -151,7 +151,7 @@ int Awards::getQSOIdofAward (const int _enti, const int _bandid)
else
{
query.finish();
- //qDebug() << "Awards::getQSOIdofAward: 0" << endl;
+ //qDebug() << "Awards::getQSOIdofAward: 0" << endl;
return -2;
}
}
@@ -159,7 +159,7 @@ int Awards::getQSOIdofAward (const int _enti, const int _bandid)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "Awards::getQSOIdofAward: Query error" << endl;
+ //qDebug() << "Awards::getQSOIdofAward: Query error" << endl;
return -3;
}
@@ -167,23 +167,15 @@ int Awards::getQSOIdofAward (const int _enti, const int _bandid)
int Awards::getDXCCWorked(const int _logNumber)
{
- //qDebug() << "Awards::getDXCCWorked (logNumber): " << QString::number(_logNumber) << endl;
+ //qDebug() << "Awards::getDXCCWorked (logNumber): " << QString::number(_logNumber) << endl;
QSqlQuery query;
QString stringQuery;
bool sqlOK;
- if (dataProxy->doesThisLogExist(_logNumber))
- {
- stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log WHERE dxcc>'0' AND lognumber='%1'").arg(_logNumber);
- }
- else
- {
- stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log WHERE dxcc>'0'");
- }
-
+ stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log where lognumber='%1'").arg(_logNumber);
sqlOK = query.exec(stringQuery);
- //qDebug() << "Awards::getDXCCWorked: stringQuery: " << stringQuery << endl;
+ //qDebug() << "Awards::getDXCCWorked: stringQuery: " << stringQuery << endl;
if (sqlOK)
{
query.next();
@@ -191,12 +183,12 @@ int Awards::getDXCCWorked(const int _logNumber)
{
int v = (query.value(0)).toInt();
query.finish();
- //qDebug() << "Awards::getDXCCWorked: " << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "Awards::getDXCCWorked: " << QString::number((query.value(0)).toInt()) << endl;
return v;
}
else
{
- //qDebug() << "Awards::getDXCCWorked: 0" << endl;
+ //qDebug() << "Awards::getDXCCWorked: 0" << endl;
return 0;
}
}
@@ -204,7 +196,7 @@ int Awards::getDXCCWorked(const int _logNumber)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "Awards::getDXCCWorked: Query error" << endl;
+ //qDebug() << "Awards::getDXCCWorked: Query error" << endl;
return 0;
}
}
@@ -215,15 +207,7 @@ int Awards::getDXCCConfirmed(const int _logNumber)
QSqlQuery query;
QString stringQuery;
bool sqlOK;
- if (dataProxy->doesThisLogExist(_logNumber))
- {
- stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log where qsl_rcvd='Y' AND dxcc!='' AND dxcc >'0' AND lognumber='%1'").arg(_logNumber);
- }
- else
- {
- stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log where qsl_rcvd='Y' AND dxcc!='' AND dxcc >'0'");
- }
-
+ stringQuery = QString("SELECT COUNT (DISTINCT dxcc) FROM log where qsl_rcvd='Y' AND lognumber='%1'").arg(_logNumber);
sqlOK = query.exec(stringQuery);
//qDebug() << "Awards::getDXCCWorked: stringQuery: " << stringQuery << endl;
@@ -239,7 +223,7 @@ int Awards::getDXCCConfirmed(const int _logNumber)
}
else
{
- //qDebug() << "Awards::getDXCCConfirmed: 0" << endl;
+ //qDebug() << "Awards::getDXCCConfirmed: 0" << endl;
return 0;
}
@@ -257,18 +241,12 @@ int Awards::getDXCCConfirmed(const int _logNumber)
int Awards::getWAZWorked(const int _logNumber)
{
- //qDebug() << "Awards::getWAZWorked (logNumber): " << QString::number(_logNumber) << endl;
+ //qDebug() << "Awards::getWAZWorked (logNumber): " << QString::number(_logNumber) << endl;
QSqlQuery query;
QString stringQuery;
- if (dataProxy->doesThisLogExist(_logNumber))
- {
- stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND cqz>'0' AND cqz<'41' AND lognumber='%1')").arg(_logNumber);
- }
- else
- {
- stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND cqz>'0' AND cqz<'41')");
- }
-
+ //stringQuery = QString("SELECT count (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND qsl_rcvd='Y' AND lognumber='%1')").arg(_logNumber);
+ stringQuery = QString("SELECT count (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND lognumber='%1')").arg(_logNumber);
+ //stringQuery = QString("SELECT count (cqz) from (SELECT DISTINCT cqz FROM awardwaz WHERE lognumber='%1' AND cqz <> '')").arg(_logNumber);
bool sqlOK = query.exec(stringQuery);
if (sqlOK)
{
@@ -296,22 +274,13 @@ int Awards::getWAZWorked(const int _logNumber)
int Awards::getWAZConfirmed(const int _logNumber)
{
- //qDebug() << "Awards::getWAZConfirmed (logNumber): " << QString::number(_logNumber) << endl;
+ //qDebug() << "Awards::getWAZConfirmed (logNumber): " << QString::number(_logNumber) << endl;
QSqlQuery query;
QString stringQuery;
//Usar la siguiente para el confirmed
- if (dataProxy->doesThisLogExist(_logNumber))
- {
- stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND cqz>'0' AND cqz<'41' AND qsl_rcvd='Y' AND lognumber='%1')").arg(_logNumber);
- }
- else
- {
- stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND cqz>'0' AND cqz<'41' AND qsl_rcvd='Y')");
- }
-
-
-
+ stringQuery = QString("SELECT count (cqz) FROM (SELECT DISTINCT cqz FROM log WHERE cqz!='' AND qsl_rcvd='Y' AND lognumber='%1')").arg(_logNumber);
+ //stringQuery = QString("SELECT COUNT (cqz) FROM (SELECT DISTINCT cqz FROM awardwaz WHERE lognumber='%1' AND confirmed='1' AND cqz <> '')").arg(_logNumber);
bool sqlOK = query.exec(stringQuery);
if (sqlOK)
{
@@ -354,7 +323,7 @@ bool Awards::isThisSpotConfirmed(const QStringList &_qs)
int Awards::getDXStatus (const QStringList &_qs)
{
- //qDebug() << "Awards::getDXStatus: Entity: " << _qs.at(0) << "/ Band: " << _qs.at(1) << "/ Mode: " << _qs.at(2) << "/ Log: " << _qs.at(3) << endl;
+ //qDebug() << "Awards::getDXStatus: Entity: " << _qs.at(0) << "/ Band: " << _qs.at(1) << "/ Mode: " << _qs.at(2) << "/ Log: " << _qs.at(3) << endl;
// Receives: QStringList _qs;
//_qs << Entity << BandId << << ModeId << lognumber;
@@ -396,7 +365,7 @@ int Awards::getDXStatus (const QStringList &_qs)
if (_qs.length() != 4 )
{
- //qDebug() << "Awards::getDXStatus: Length != 4, return -1" << endl;
+ //qDebug() << "Awards::getDXStatus: Length != 4, return -1" << endl;
return -1;
}
@@ -407,10 +376,10 @@ int Awards::getDXStatus (const QStringList &_qs)
int _logNumber = _qs.at(3).toInt();
int dxccEntity = (_qs.at(0)).toInt();
//int dxccEntity = world->getQRZARRLId(_qs.at(0) );
- //qDebug() << "Awards::getDXStatus: dxccEntity: " << QString::number(dxccEntity) << endl;
+ //qDebug() << "Awards::getDXStatus: dxccEntity: " << QString::number(dxccEntity) << endl;
if (dxccEntity<=0)
{
- //qDebug() << "Awards::getDXStatus: dxccEntity <= 0, return -1" << endl;
+ //qDebug() << "Awards::getDXStatus: dxccEntity <= 0, return -1" << endl;
return -1;
}
@@ -421,7 +390,7 @@ int Awards::getDXStatus (const QStringList &_qs)
if ( (_mode==-1) || (manageModes==false))
{
checkingMode = false;
- //qDebug() << "Awards::getDXStatus: checkingMode = FALSE" << endl;
+ //qDebug() << "Awards::getDXStatus: checkingMode = FALSE" << endl;
}
// dxccStatusMode(const int _ent, const int _mode, const int _logNumber) //-1 error / 0 Not worked / 1 worked / 2 confirmed
@@ -438,13 +407,13 @@ int Awards::getDXStatus (const QStringList &_qs)
checkingMode = false;
}
- //qDebug() << "Awards::getDXStatus: wb=" << QString::number(wb) << " - wm=" << QString::number(wm) << endl;
- //qDebug() << "Awards::getDXStatus: dxccStatus: " << QString::number(dxccStatus(dxccEntity, _logNumber)) << endl;
+ //qDebug() << "Awards::getDXStatus: wb=" << QString::number(wb) << " - wm=" << QString::number(wm) << endl;
+ //qDebug() << "Awards::getDXStatus: dxccStatus: " << QString::number(dxccStatus(dxccEntity, _logNumber)) << endl;
switch(dxccStatus(dxccEntity, _logNumber))
{
case 0:
- //qDebug() << "Awards::getDXStatus: return 0" << endl;
+ //qDebug() << "Awards::getDXStatus: return 0" << endl;
return 0; // ATNO
//break;
case 1: // Worked, not confirmed
@@ -455,18 +424,18 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==1)
{
- //qDebug() << "Awards::getDXStatus: return 4" << endl;
+ //qDebug() << "Awards::getDXStatus: return 4" << endl;
return 4;
}
else
{
- //qDebug() << "Awards::getDXStatus: return 1" << endl;
+ //qDebug() << "Awards::getDXStatus: return 1" << endl;
return 1;
}
}
else
{
- //qDebug() << "Awards::getDXStatus: return 4 nc" << endl;
+ //qDebug() << "Awards::getDXStatus: return 4 nc" << endl;
return 4;
}
case 1: // Worked in this band
@@ -474,23 +443,23 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==1)
{
- //qDebug() << "Awards::getDXStatus: return 3" << endl;
+ //qDebug() << "Awards::getDXStatus: return 3" << endl;
return 3;
}
else
{
- //qDebug() << "Awards::getDXStatus: return 2" << endl;
+ //qDebug() << "Awards::getDXStatus: return 2" << endl;
return 2;
}
}
else
{
- //qDebug() << "Awards::getDXStatus: return 3 nc" << endl;
+ //qDebug() << "Awards::getDXStatus: return 3 nc" << endl;
return 3;
}
default: // ERROR
- //qDebug() << "Awards::getDXStatus: default return -1 - 1" << endl;
+ //qDebug() << "Awards::getDXStatus: default return -1 - 1" << endl;
return -1;
}
case 2: // Confirmed
@@ -500,23 +469,23 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==2)
{
- //qDebug() << "Awards::getDXStatus: return 13" << endl;
+ //qDebug() << "Awards::getDXStatus: return 13" << endl;
return 13;
}
else if (wm==1)
{
- //qDebug() << "Awards::getDXStatus: return 12" << endl;
+ //qDebug() << "Awards::getDXStatus: return 12" << endl;
return 12;
}
else
{
- //qDebug() << "Awards::getDXStatus: return 11" << endl;
+ //qDebug() << "Awards::getDXStatus: return 11" << endl;
return 11;
}
}
else
{
- //qDebug() << "Awards::getDXStatus: return 13 nc" << endl;
+ //qDebug() << "Awards::getDXStatus: return 13 nc" << endl;
return 13;
}
@@ -529,12 +498,12 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==1)
{
- //qDebug() << "Awards::getDXStatus: return 8" << endl;
+ //qDebug() << "Awards::getDXStatus: return 8" << endl;
return 8;
}
else
{
- //qDebug() << "Awards::getDXStatus: return 6" << endl;
+ //qDebug() << "Awards::getDXStatus: return 6" << endl;
return 6;
}
}
@@ -542,12 +511,12 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wm==1)
{
- //qDebug() << "Awards::getDXStatus: return 7" << endl;
+ //qDebug() << "Awards::getDXStatus: return 7" << endl;
return 7;
}
else
{
- //qDebug() << "Awards::getDXStatus: return 5" << endl;
+ //qDebug() << "Awards::getDXStatus: return 5" << endl;
return 5;
}
}
@@ -557,44 +526,44 @@ int Awards::getDXStatus (const QStringList &_qs)
{
if (wb==0)
{
- //qDebug() << "Awards::getDXStatus: return 7 nc" << endl;
+ //qDebug() << "Awards::getDXStatus: return 7 nc" << endl;
return 7;
}
else
{
- //qDebug() << "Awards::getDXStatus: return 8 nc" << endl;
+ //qDebug() << "Awards::getDXStatus: return 8 nc" << endl;
return 8;
}
}
}
else
{
- //qDebug() << "Awards::getDXStatus: return -1 - 2" << endl;
+ //qDebug() << "Awards::getDXStatus: return -1 - 2" << endl;
return -1;
}
default:
- //qDebug() << "Awards::getDXStatus: return -1 default2" << endl;
+ //qDebug() << "Awards::getDXStatus: return -1 default2" << endl;
return -1;
} // END OF SWITCH
- //qDebug() << "Awards::getDXStatus: END, return -1" << endl;
- //return -1;
+ //qDebug() << "Awards::getDXStatus: END, return -1" << endl;
+ return -1;
}
int Awards::dxccStatusBandMode(const int _ent, const int _band, const int _mode, const int _logNumber, bool _checkingMode)
{//-1 error / 0 Not worked / 1 worked / 2 confirmed
- //qDebug() << "Awards::dxccStatusBandMode: " << QString::number(_ent) << "/" << QString::number(_band) << "/" << QString::number(_mode) << endl;
+ //qDebug() << "Awards::dxccStatusBandMode: " << QString::number(_ent) << "/" << QString::number(_band) << "/" << QString::number(_mode) << endl;
QSqlQuery query = QSqlQuery();
QString queryString = QString();
if (_checkingMode)
{
- //qDebug() << "Awards::dxccStatusBandMode: Checking Mode TRUE" << endl;
+ //qDebug() << "Awards::dxccStatusBandMode: Checking Mode TRUE" << endl;
queryString = QString("SELECT confirmed FROM awarddxcc WHERE dxcc='%1' AND band='%2' AND mode='%3' AND lognumber='%4' ").arg(QString::number(_ent)).arg(QString::number(_band)).arg(QString::number(_mode)).arg(QString::number(_logNumber));
}
else
{
- //qDebug() << "Awards::dxccStatusBandMode: Checking Mode FALSE" << endl;
+ //qDebug() << "Awards::dxccStatusBandMode: Checking Mode FALSE" << endl;
queryString = QString("SELECT confirmed FROM awarddxcc WHERE dxcc='%1' AND band='%2' AND lognumber='%3' ").arg(QString::number(_ent)).arg(QString::number(_band)).arg(QString::number(_logNumber));
}
@@ -608,13 +577,13 @@ int Awards::dxccStatusBandMode(const int _ent, const int _band, const int _mode,
{
if(query.value(0).toString() == "1")
{
- //qDebug() << "Awards::dxccStatusBandMode: return - 2" << endl;
+ //qDebug() << "Awards::dxccStatusBandMode: return - 2" << endl;
query.finish();
return 2;
}
else if(query.value(0).toString() == "0")
{
- //qDebug() << "Awards::dxccStatusBandMode: return - 1" << endl;
+ //qDebug() << "Awards::dxccStatusBandMode: return - 1" << endl;
if (status < 1)
{
status = 1;
@@ -627,19 +596,19 @@ int Awards::dxccStatusBandMode(const int _ent, const int _band, const int _mode,
}
else
{ // The query fails...
- //qDebug() << "Awards::dxccStatusBandMode: return - -1" << endl;
+ //qDebug() << "Awards::dxccStatusBandMode: return - -1" << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return -1;
}
- //qDebug() << "Awards::dxccStatusBandMode: return - 0-4" << endl;
+ //qDebug() << "Awards::dxccStatusBandMode: return - 0-4" << endl;
return status;
}
int Awards::dxccStatus(const int _ent, const int _logNumber)
{//-1 error / 0 Not worked / 1 worked / 2 confirmed
- //qDebug() << "Awards::dxccStatus: " << QString::number(_ent) << endl;
+ //qDebug() << "Awards::dxccStatus: " << QString::number(_ent) << endl;
QSqlQuery query = QSqlQuery();
QString queryString = QString();
int worked = 0;
@@ -648,24 +617,24 @@ int Awards::dxccStatus(const int _ent, const int _logNumber)
if (query.exec(queryString))
{
- //qDebug() << "Awards::dxccStatus: query exec OK: " << query.lastQuery() << endl;
+ //qDebug() << "Awards::dxccStatus: query exec OK: " << query.lastQuery() << endl;
while (query.next())
{
- //qDebug() << "Awards::dxccStatus: query VALUE: " << (query.value(0)).toString() << endl;
+ //qDebug() << "Awards::dxccStatus: query VALUE: " << (query.value(0)).toString() << endl;
if ( query.isValid() )
{
- //qDebug() << "Awards::dxccStatus: query valid OK" << endl;
+ //qDebug() << "Awards::dxccStatus: query valid OK" << endl;
if((query.value(0)).toString() == "1")
{
- //qDebug() << "Awards::dxccStatus: value = 1 - return 2" << endl;
+ //qDebug() << "Awards::dxccStatus: value = 1 - return 2" << endl;
query.finish();
return 2;
}
else if((query.value(0)).toString() == "0")
{
- //qDebug() << "Awards::dxccStatus: value = 0 - worked 1" << endl;
+ //qDebug() << "Awards::dxccStatus: value = 0 - worked 1" << endl;
if (worked <1)
{
worked = 1;
@@ -673,21 +642,21 @@ int Awards::dxccStatus(const int _ent, const int _logNumber)
}
}
}
- //qDebug() << "Awards::dxccStatus: return "<< QString::number(worked) << endl;
+ //qDebug() << "Awards::dxccStatus: return "<< QString::number(worked) << endl;
query.finish();
- //qDebug() << "Awards::dxccStatus: END: " << QString::number(worked) << endl;
+ //qDebug() << "Awards::dxccStatus: END: " << QString::number(worked) << endl;
return worked;
}
else
{ // The query fails...
- //qDebug() << "Awards::dxccStatus: return -1" << endl;
+ //qDebug() << "Awards::dxccStatus: return -1" << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return -1;
}
- //qDebug() << "Awards::dxccStatus: return 0" << endl;
- //return worked;
+ //qDebug() << "Awards::dxccStatus: return 0" << endl;
+ return worked;
}
@@ -697,12 +666,12 @@ QColor Awards::getQRZDXStatusColor(const QStringList &_qs)
//qs << Entity << spotBand << "-1" << QString::number(currentLog) ;
- //qDebug() << "Awards::getQRZDXStatusColor qs.length: " << QString::number(_qs.length()) << endl;
+ //qDebug() << "Awards::getQRZDXStatusColor qs.length: " << QString::number(_qs.length()) << endl;
//From Search QSO to QSL: q << _call << bandid << _mode << QString::number(currentLog);
- //qDebug() << "Awards::getQRZDXStatusColor: " << _qs.at(0) << "/" << _qs.at(1) << "/" << _qs.at(2) << _qs.at(3) << endl;
+ //qDebug() << "Awards::getQRZDXStatusColor: " << _qs.at(0) << "/" << _qs.at(1) << "/" << _qs.at(2) << _qs.at(3) << endl;
// Receives: QStringList _qs;
//_qs << Entity << BandID << ModeId << lognumber;
@@ -717,8 +686,8 @@ QColor Awards::getQRZDXStatusColor(const QStringList &_qs)
int status = getDXStatus(_qs);
- //qDebug() << "Awards::getQRZDXStatusColor: status: " << QString::number(status) << "/" << getDXStatusString(status) << endl;
- //qDebug() << "Awards::getQRZDXStatusColor: status: " << QString::number(status) << endl;
+ //qDebug() << "Awards::getQRZDXStatusColor: status: " << QString::number(status) << "/" << getDXStatusString(status) << endl;
+ //qDebug() << "Awards::getQRZDXStatusColor: status: " << QString::number(status) << endl;
switch (status) {
case 0:
@@ -763,7 +732,7 @@ QColor Awards::getQRZDXStatusColor(const QStringList &_qs)
case 13:
returnedColor = confirmedColor;
break;
- //break;
+ break;
default:
returnedColor = defaultColor;
break;
@@ -775,7 +744,7 @@ QColor Awards::getQRZDXStatusColor(const QStringList &_qs)
QString Awards::getDXStatusString (const int &_status)
{
- //qDebug() << "Awards::getDXStatusString: " << QString::number(_status) << endl;
+ //qDebug() << "Awards::getDXStatusString: " << QString::number(_status) << endl;
QString message = QString();
@@ -825,7 +794,7 @@ QString Awards::getDXStatusString (const int &_status)
case 13:
message = QObject::tr("Confirmed");
break;
- //break;
+ break;
default:
message = QObject::tr("Not identified");
break;
@@ -837,7 +806,7 @@ return message;
QString Awards::getDXCCStatusBand(const int _dxcc, const int _band, const int _logNumber)
{
// Returns -, W or C (Not worked, worked, Confirmed)
- //qDebug() << "Awards::getDXCCStatusBand: log received: " << QString::number(_logNumber) << endl;
+ //qDebug() << "Awards::getDXCCStatusBand: log received: " << QString::number(_logNumber) << endl;
QString stringQuery;
if (_logNumber<0)
{
@@ -897,7 +866,7 @@ QString Awards::checkIfValidIOTA(const QString &_tiota)
Returns a valid format IOTA if possible and "" in other cases.
************************************/
- //qDebug() << "Awards::checkIfValidIOTA: " << _tiota << endl;
+ //qDebug() << "Awards::checkIfValidIOTA: " << _tiota << endl;
//bool _valid = false;
QString _continent;
QString _number;
@@ -905,37 +874,16 @@ Returns a valid format IOTA if possible and "" in other cases.
if (_tiota.count("-") == 1)
{
QStringList _values = _tiota.split("-", QString::SkipEmptyParts);
- if (_values.size() != 2)
- {
- return "";
- }
-
- if (dataProxy->isValidContinentShortName(_values.at(0)))
- {
- _continent = _values.at(0);
- }
- else
- {
- return "";
- }
- if ((_values.at(1)).toInt() > 0)
- {
- _number = _values.at(1);
- }
- else
- {
- return "";
- }
-
-
+ _continent = _values.at(0);
+ _number = _values.at(1);
}
else
{
return "";
}
- //qDebug() << "Awards::checkIfValidIOTA (cont) " << _continent << endl;
- //qDebug() << "Awards::checkIfValidIOTA (numb): " << _number << endl;
+ //qDebug() << "Awards::checkIfValidIOTA (cont) " << _continent << endl;
+ //qDebug() << "Awards::checkIfValidIOTA (numb): " << _number << endl;
// Check if continent is valid
@@ -969,7 +917,7 @@ Returns a valid format IOTA if possible and "" in other cases.
{
return QString();
}
- //return QString();
+ return QString();
/*
QString stringQuery = QString("SELECT id FROM continent WHERE shortname ='%1'").arg(_continent);
@@ -1014,7 +962,7 @@ Returns a valid format IOTA if possible and "" in other cases.
void Awards::setColors (const QString &_newOne, const QString &_needed, const QString &_worked, const QString &_confirmed, const QString &_default)
//void Awards::setColors (const QString &_newOne, const QString &_needed, const QString &_worked, const QString &_confirmed, const QString &_default)
{
- //qDebug() << "Awards::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default << endl;
+ //qDebug() << "Awards::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default << endl;
defaultColor = QColor(_default.toUpper());
neededColor = QColor(_needed.toUpper());
@@ -1061,7 +1009,7 @@ void Awards::setColors (const QString &_newOne, const QString &_needed, const QS
}
else
{
- //qDebug() << "Awards::setColors: Worked NOT VALID" << endl;
+ //qDebug() << "Awards::setColors: Worked NOT VALID" << endl;
}
}
@@ -1078,17 +1026,17 @@ void Awards::recalculateAwards()
Should go in a transaction
*/
- //qDebug() << "Awards::recalculateAwards" << endl;
+ //qDebug() << "Awards::recalculateAwards" << endl;
dataProxy->updateAwardDXCC();
emit awardDXCCUpdated();
dataProxy->updateAwardWAZ();
- //qDebug() << "Awards::recalculateAwards - END" << endl;
+ //qDebug() << "Awards::recalculateAwards - END" << endl;
}
int Awards::getQSOsInLog(const int _logNumber)
{
- //qDebug() << "Awards::getQSOsInLog: " << QString::number(_logNumber) << endl;
+ //qDebug() << "Awards::getQSOsInLog: " << QString::number(_logNumber) << endl;
QSqlQuery query;
QString queryString;
int v;
@@ -1121,7 +1069,7 @@ int Awards::getQSOsInLog(const int _logNumber)
/*
void Awards::setAwards(const int _dxcc, const int _waz, const int _band, const int _mode, const int _workedOrConfirmed, const int _logNumber, const int _qsoId)
{
- //qDebug() << "Awards::setAwards: " << QString::number(_dxcc) << endl;
+ //qDebug() << "Awards::setAwards: " << QString::number(_dxcc) << endl;
//_workedOrConfirmed = -1 Remove this pair
//_workedOrConfirmed = 0 Set as Worked
@@ -1145,14 +1093,14 @@ void Awards::setAwards(const int _dxcc, const int _waz, const int _band, const i
void Awards::setAwards(const int _qsoId)
{
- //qDebug() << "Awards::setAwards: _qsoId: " << QString::number(_qsoId) << endl;
+ //qDebug() << "Awards::setAwards: _qsoId: " << QString::number(_qsoId) << endl;
dataProxy->setDXCCAwardStatus(_qsoId);
dataProxy->setWAZAwardStatus(_qsoId);
}
/*
int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, const bool _confirmed, const int _logNumber, const int _qsoId)
{
- //qDebug() << "Awards::setAwardDXCCst-0: " << QString::number(_dxcc) << "/" << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_logNumber) << "/" << QString::number(_qsoId) << endl;
+ //qDebug() << "Awards::setAwardDXCCst-0: " << QString::number(_dxcc) << "/" << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_logNumber) << "/" << QString::number(_qsoId) << endl;
int nameCol=-1;
QString _refid = QString();
@@ -1162,7 +1110,7 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
//TODO: Fix the way we check for data validity for this function
if (!( (_dxcc>=0) && (_band >=0) && (_mode>=0) && (_logNumber>=0) && (_qsoId >=0) ))
{
- //qDebug() << "Awards::setAwardDXCCst: Not valid data received!" << endl;
+ //qDebug() << "Awards::setAwardDXCCst: Not valid data received!" << endl;
return -1;
}
int _iconfirmed;
@@ -1176,7 +1124,7 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
_iconfirmed = 0;
}
- //qDebug() << "Awards::setAwardDXCCst: _qsoId: " << QString::number(_qsoId) << "/" << QString::number(_iconfirmed) << endl;
+ //qDebug() << "Awards::setAwardDXCCst: _qsoId: " << QString::number(_qsoId) << "/" << QString::number(_iconfirmed) << endl;
QString stringQuery = QString();
QSqlQuery query;
bool sqlOK = false;
@@ -1188,21 +1136,21 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
sqlOK = query.exec(stringQuery);
if (sqlOK)
{
- //qDebug() << "Awards::setAwardDXCCst-1:" << endl;
+ //qDebug() << "Awards::setAwardDXCCst-1:" << endl;
query.next();
QSqlRecord rec = query.record();
if (query.isValid())
{// We have some data, we need to UPDATE - We are only confirming!
- //qDebug() << "Awards::setAwardDXCCst: We have some data, we neer to update" << endl;
+ //qDebug() << "Awards::setAwardDXCCst: We have some data, we neer to update" << endl;
nameCol = rec.indexOf("id");
_refid = query.value(nameCol).toString();
stringQuery = QString("UPDATE awarddxcc SET confirmed='1', qsoid='%1' WHERE id='%2'").arg(_qsoId).arg(_refid);
- //qDebug() << "Awards::setAwardDXCCst: (UPDATE): " << stringQuery << endl;
+ //qDebug() << "Awards::setAwardDXCCst: (UPDATE): " << stringQuery << endl;
if (sqlOK)
{ // Set of data updated
- //qDebug() << "Awards::setAwardDXCCst: Data updated!" << endl;
+ //qDebug() << "Awards::setAwardDXCCst: Data updated!" << endl;
query.finish();
return 1;
}
@@ -1220,12 +1168,12 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
{ // We don't have this set, we need to INSERT
stringQuery = QString("INSERT INTO awarddxcc (dxcc, band, mode, confirmed, lognumber, qsoid) values('%1','%2','%3','%4','%5','%6')").arg(_dxcc).arg(_band).arg(_mode).arg(_iconfirmed).arg(_logNumber).arg(_qsoId);
sqlOK = query.exec(stringQuery);
- //qDebug() << "Awards::setAwardDXCCst: We don't have data... so we INSERT" << endl;
- //qDebug() << "Awards::setAwardDXCCst: (INSERT): " << stringQuery << endl;
+ //qDebug() << "Awards::setAwardDXCCst: We don't have data... so we INSERT" << endl;
+ //qDebug() << "Awards::setAwardDXCCst: (INSERT): " << stringQuery << endl;
if (sqlOK)
{ // Set of data included
query.finish();
- //qDebug() << "Awards::setAwardDXCCst: Data inserted!" << endl;
+ //qDebug() << "Awards::setAwardDXCCst: Data inserted!" << endl;
}
else
{ // Something failed. Trace it!
@@ -1257,7 +1205,7 @@ int Awards::setAwardDXCCst(const int _dxcc, const int _band, const int _mode, co
/*
int Awards::setAwardWAZst(const int _cqz, const int _band, const int _mode, const bool _confirmed, const int _logNumber, const int _qsoId)
{
- //qDebug() << "Awards::setAwardWAZst(CQZ/BAND/MODE/WORKED/log/qsoid): " << QString::number(_cqz) << "/" << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_logNumber) << "/" << QString::number(_qsoId) << endl;
+ //qDebug() << "Awards::setAwardWAZst(CQZ/BAND/MODE/WORKED/log/qsoid): " << QString::number(_cqz) << "/" << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_logNumber) << "/" << QString::number(_qsoId) << endl;
// _confirmed == false QSO is just worked
@@ -1268,7 +1216,7 @@ int Awards::setAwardWAZst(const int _cqz, const int _band, const int _mode, cons
//TODO: Fix the way we check for data validity for this function
if (!( (_cqz>=0) && (_band >=0) && (_mode>=0) && (_logNumber>=0) && (_qsoId >=0) ))
{
- //qDebug() << "Awards::setAwardWAZst: some data was NOK" << endl;
+ //qDebug() << "Awards::setAwardWAZst: some data was NOK" << endl;
return -1;
}
int _iconfirmed;
@@ -1295,26 +1243,26 @@ int Awards::setAwardWAZst(const int _cqz, const int _band, const int _mode, cons
if ((sqlOK) && (!_confirmed)) // First time a DXCC/Band/mode is worked
{
- //qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- 1" << endl;
+ //qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- 1" << endl;
query.finish();
return 1;
}
else if ((sqlOK) && (_confirmed)) // First time a CQZ/Band/Mode is confirmed
{
- //qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- 2" << endl;
+ //qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- 2" << endl;
query.finish();
return 2;
}
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- sqlOK ERROR: " << endl;
+ //qDebug() << "Awards::setAwardWAZst: _qsoId: " << QString::number(_qsoId) << "- sqlOK ERROR: " << endl;
//errorCode = query.lastError().number();
query.finish();
- //qDebug() << "Awards::setAwardWAZst: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "Awards::setAwardWAZst: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "Awards::setAwardWAZst: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "Awards::setAwardWAZst: LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "Awards::setAwardWAZst: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "Awards::setAwardWAZst: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "Awards::setAwardWAZst: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "Awards::setAwardWAZst: LastError-n: " << QString::number(query.lastError().number() ) << endl;
}
@@ -1326,7 +1274,7 @@ int Awards::setAwardWAZst(const int _cqz, const int _band, const int _mode, cons
/*
int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _dxcc, const int _newQSOid) // Changes the status of a DXCC from worked to confirmed
{
- //qDebug() << "Awards::setAwardDXCCConfirmed: " << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_dxcc)<< "/" << QString::number(_newQSOid)<< endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed: " << QString::number(_band) << "/" << QString::number(_mode) << "/" << QString::number(_dxcc)<< "/" << QString::number(_newQSOid)<< endl;
QString stringQuery;
@@ -1360,10 +1308,10 @@ int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _d
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
errorCode = query.lastError().number();
query.finish();
- //qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed-Update: LastError-n: " << QString::number(query.lastError().number() ) << endl;
return errorCode;
}
@@ -1371,14 +1319,14 @@ int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _d
else
{
// Not valid record
- //qDebug() << "Awards::setAwardDXCCConfirmed: Not valid record" << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed: Not valid record" << endl;
return -3;
}
}
else
{
// Not next record
- //qDebug() << "Awards::setAwardDXCCConfirmed: Not next record" << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed: Not next record" << endl;
return -2;
}
}
@@ -1387,10 +1335,10 @@ int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _d
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
errorCode = query.lastError().number();
query.finish();
- //qDebug() << "Awards::setAwardDXCCConfirmed: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "Awards::setAwardDXCCConfirmed: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "Awards::setAwardDXCCConfirmed: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "Awards::setAwardDXCCConfirmed: LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "Awards::setAwardDXCCConfirmed: LastError-n: " << QString::number(query.lastError().number() ) << endl;
return errorCode;
}
@@ -1401,7 +1349,7 @@ int Awards::setAwardDXCCConfirmed(const int _band, const int _mode, const int _d
int Awards::setDXCCToQSO(const int _dxcc, const int _qsoid) // Defines the DXCC in a QSO
{
- //qDebug() << "Awards::setDXCCToQSO: " << QString::number(_dxcc) << "/" << QString::number(_qsoid) << endl;
+ //qDebug() << "Awards::setDXCCToQSO: " << QString::number(_dxcc) << "/" << QString::number(_qsoid) << endl;
int errorCode = -1;
QString queryString = QString("UPDATE log SET dxcc='%1' WHERE id='%2'").arg(_dxcc).arg(_qsoid);
QSqlQuery query = QSqlQuery();
@@ -1414,20 +1362,20 @@ int Awards::setDXCCToQSO(const int _dxcc, const int _qsoid) // Defines the DXCC
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "Awards::setDXCCToQSO: DXCC Updated in Log but failed...." << endl;
+ //qDebug() << "Awards::setDXCCToQSO: DXCC Updated in Log but failed...." << endl;
errorCode = query.lastError().number();
query.finish();
- //qDebug() << "Awards::setDXCCToQSO: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "Awards::setDXCCToQSO: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "Awards::setDXCCToQSO: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "Awards::setDXCCToQSO: LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "Awards::setDXCCToQSO: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "Awards::setDXCCToQSO: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "Awards::setDXCCToQSO: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "Awards::setDXCCToQSO: LastError-n: " << QString::number(query.lastError().number() ) << endl;
return errorCode;
}
}
int Awards::setCQToQSO(const int _cqz, const int _qsoid) // Defines the CQ in a QSO
{
- //qDebug() << "Awards::setCQToQSO: " << QString::number(_cqz) << "/" << QString::number(_qsoid) << endl;
+ //qDebug() << "Awards::setCQToQSO: " << QString::number(_cqz) << "/" << QString::number(_qsoid) << endl;
int errorCode = -1;
QString queryString = QString("UPDATE log SET cqz='%1' WHERE id='%2'").arg(_cqz).arg(_qsoid);
QSqlQuery query = QSqlQuery();
@@ -1440,13 +1388,13 @@ int Awards::setCQToQSO(const int _cqz, const int _qsoid) // Defines the CQ in a
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "Awards::setCQToQSO: DXCC Updated in Log but failed...." << endl;
+ //qDebug() << "Awards::setCQToQSO: DXCC Updated in Log but failed...." << endl;
errorCode = query.lastError().number();
query.finish();
- //qDebug() << "Awards::setCQToQSO: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "Awards::setCQToQSO: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "Awards::setCQToQSO: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "Awards::setCQToQSO: LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "Awards::setCQToQSO: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "Awards::setCQToQSO: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "Awards::setCQToQSO: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "Awards::setCQToQSO: LastError-n: " << QString::number(query.lastError().number() ) << endl;
return errorCode;
}
}
@@ -1460,27 +1408,27 @@ bool Awards::getIsDXCCConfirmed(const int _dxcc, const int _logNumber)
int Awards::getDXMarathonQSO(const int _year, const int _logNumber)
{
- //qDebug() << "Awards::getDXMarathonQSO: " << QString::number(_year) << endl;
+ //qDebug() << "Awards::getDXMarathonQSO: " << QString::number(_year) << endl;
return dxMarathon->getDXMarathonQSO(_year, _logNumber);
}
int Awards::getDXMarathonDXCC(const int _year, const int _logNumber)
{
- //qDebug() << "Awards::getDXMarathonDXCC: " << QString::number(_year) << endl;
+ //qDebug() << "Awards::getDXMarathonDXCC: " << QString::number(_year) << endl;
return dxMarathon->getDXMarathonDXCC(_year, _logNumber);
}
int Awards::getDXMarathonCQ(const int _year, const int _logNumber)
{
- //qDebug() << "Awards::getDXMarathonCQ: " << QString::number(_year) << endl;
+ //qDebug() << "Awards::getDXMarathonCQ: " << QString::number(_year) << endl;
return dxMarathon->getDXMarathonCQ(_year, _logNumber);
}
int Awards::getDXMarathonScore(const int _year, const int _logNumber)
{
- //qDebug() << "Awards::getDXMarathonScore: " << QString::number(_year) << endl;
+ //qDebug() << "Awards::getDXMarathonScore: " << QString::number(_year) << endl;
return dxMarathon->getDXMarathonScore(_year, _logNumber);
@@ -1494,7 +1442,7 @@ bool Awards::isDXMarathonNeed(const int _dxcc, const int _cq, const int _year, c
int Awards::dxccStatusBand(const int _ent, const int _band, const int _logNumber) //-1 error / 0 Not worked / 1 worked / 2 confirmed
{
//-1 error / 0 Not worked / 1 worked / 2 confirmed
- //qDebug() << "Awards::dxccStatusBand: " << QString::number(_ent) << "/" << QString::number(_band) << endl;
+ //qDebug() << "Awards::dxccStatusBand: " << QString::number(_ent) << "/" << QString::number(_band) << endl;
QSqlQuery query = QSqlQuery();
QString queryString = QString();
@@ -1532,14 +1480,14 @@ int Awards::dxccStatusBand(const int _ent, const int _band, const int _logNumber
return -1;
}
- //qDebug() << "Awards::dxccStatusBand: return - 0.3" << endl;
+ //qDebug() << "Awards::dxccStatusBand: return - 0.3" << endl;
return status; // if arrives to here decision => not worked
}
int Awards::dxccStatusMode(const int _ent, const int _mode, const int _logNumber) //-1 error / 0 Not worked / 1 worked / 2 confirmed
{
//-1 error / 0 Not worked / 1 worked / 2 confirmed
- //qDebug() << "Awards::dxccStatusMode: " << QString::number(_ent) << "/" << QString::number(_mode) << endl;
+ //qDebug() << "Awards::dxccStatusMode: " << QString::number(_ent) << "/" << QString::number(_mode) << endl;
QSqlQuery query = QSqlQuery();
QString queryString = QString();
diff --git a/awards.h b/awards.h
index 8fe0360a..43d43a66 100644
--- a/awards.h
+++ b/awards.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/awardswidget.cpp b/awardswidget.cpp
index 4a7df146..ef5c4109 100644
--- a/awardswidget.cpp
+++ b/awardswidget.cpp
@@ -3,7 +3,7 @@
AwardsWidget::AwardsWidget(DataProxy_SQLite *dp, QWidget *parent) :
QWidget(parent)
{
- //qDebug() << "AwardsWidget::AwardsWidget" << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget" << endl;
manageDXMarathon = false;
logSeverity = 7; //7 Debug /0=emergency or no debug
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
@@ -38,7 +38,7 @@ AwardsWidget::AwardsWidget(DataProxy_SQLite *dp, QWidget *parent) :
clear();
createUI();
emit debugLog (Q_FUNC_INFO, "End", logSeverity);
- //qDebug() << "AwardsWidget::AwardsWidget - END" << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget - END" << endl;
}
AwardsWidget::~AwardsWidget()
@@ -49,7 +49,7 @@ AwardsWidget::~AwardsWidget()
void AwardsWidget::clear()
{
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
- //qDebug() << "AwardsWidget::clear" << endl;
+ //qDebug() << "AwardsWidget::clear" << endl;
/*
searchBoxLineEdit->clear();
searchResultsTreeWidget->clear();
@@ -58,14 +58,14 @@ void AwardsWidget::clear()
*/
emit debugLog (Q_FUNC_INFO, "End", logSeverity);
- //qDebug() << "AwardsWidget::clear-END" << endl;
+ //qDebug() << "AwardsWidget::clear-END" << endl;
}
void AwardsWidget::createUI()
{
//searchBoxClearButton->setToolTip(tr("Clear the searches."));
- //qDebug() << "AwardsWidget::createUI" << endl;
+ //qDebug() << "AwardsWidget::createUI" << endl;
emit debugLog (Q_FUNC_INFO, "Start", logSeverity);
recalculateAwardsButton = new QPushButton(tr("Recalculate"), this);
@@ -105,7 +105,7 @@ void AwardsWidget::createUI()
#ifdef Q_OS_WIN
- //qDebug() << "AwardsWidget::createUIDX - WINDOWS DETECTED!" << endl;
+ //qDebug() << "AwardsWidget::createUIDX - WINDOWS DETECTED!" << endl;
qsoNLabelN->setFrameShadow(QFrame::Raised);
qsoNLabelN->setFrameStyle(QFrame::StyledPanel);
@@ -136,7 +136,7 @@ void AwardsWidget::createUI()
#else
- //qDebug() << "AwardsWidget::createUIDX - NO WINDOWS DETECTED!" << endl;
+ //qDebug() << "AwardsWidget::createUIDX - NO WINDOWS DETECTED!" << endl;
//localLabelN->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
qsoNLabelN->setFrameStyle(QFrame::StyledPanel | QFrame::Raised);
@@ -154,12 +154,12 @@ void AwardsWidget::createUI()
#endif
- //qDebug() << "AwardsWidget::createUI-125" << endl;
+ //qDebug() << "AwardsWidget::createUI-125" << endl;
//reconfigureyearlyUI(manageyearly);
yearlyScoreLabelN->setText(tr("Score"));
yearlyLabelN->setText(tr("Annual"));
- //qDebug() << "AwardsWidget::createUI-135" << endl;
+ //qDebug() << "AwardsWidget::createUI-135" << endl;
QGridLayout *yearlyDLayout = new QGridLayout;
yearlyDLayout->addWidget(yearlyQSOsLabelN, 0, 0);
@@ -169,51 +169,51 @@ void AwardsWidget::createUI()
yearlyDLayout->addWidget(yearlyDXCCQLCDNumber, 1, 1);
yearlyDLayout->addWidget(yearlyCQQLCDNumber, 1, 2);
- //qDebug() << "AwardsWidget::createUI-145" << endl;
+ //qDebug() << "AwardsWidget::createUI-145" << endl;
QVBoxLayout *yearlyTLayout = new QVBoxLayout;
yearlyTLayout->addWidget(yearlyLabelN);
yearlyTLayout->addWidget(operatingYearsComboBox);
- //qDebug() << "AwardsWidget::createUI-150" << endl;
+ //qDebug() << "AwardsWidget::createUI-150" << endl;
QGridLayout *dxUpRightAwardsTabLayout = new QGridLayout;
- //qDebug() << "AwardsWidget::createUI-151" << endl;
+ //qDebug() << "AwardsWidget::createUI-151" << endl;
dxUpRightAwardsTabLayout->addWidget(awardLabelN, 0, 0);
- //qDebug() << "AwardsWidget::createUI-152" << endl;
+ //qDebug() << "AwardsWidget::createUI-152" << endl;
dxUpRightAwardsTabLayout->addWidget(workedLabelN, 0, 1);
- //qDebug() << "AwardsWidget::createUI-153" << endl;
+ //qDebug() << "AwardsWidget::createUI-153" << endl;
dxUpRightAwardsTabLayout->addWidget(confirmedLabelN, 0, 2);
- //qDebug() << "AwardsWidget::createUI-154" << endl;
+ //qDebug() << "AwardsWidget::createUI-154" << endl;
dxUpRightAwardsTabLayout->addWidget(dxccLabelN, 1, 0);
- //qDebug() << "AwardsWidget::createUI-155" << endl;
+ //qDebug() << "AwardsWidget::createUI-155" << endl;
dxUpRightAwardsTabLayout->addWidget(dxccWorkedQLCDNumber, 1, 1);
- //qDebug() << "AwardsWidget::createUI-156" << endl;
+ //qDebug() << "AwardsWidget::createUI-156" << endl;
dxUpRightAwardsTabLayout->addWidget(dxccConfirmedQLCDNumber, 1, 2);
- //qDebug() << "AwardsWidget::createUI-157" << endl;
+ //qDebug() << "AwardsWidget::createUI-157" << endl;
dxUpRightAwardsTabLayout->addWidget(wazLabelN, 2, 0);
- //qDebug() << "AwardsWidget::createUI-158" << endl;
+ //qDebug() << "AwardsWidget::createUI-158" << endl;
dxUpRightAwardsTabLayout->addWidget(wazWorkedQLCDNumber, 2, 1);
- //qDebug() << "AwardsWidget::createUI-159" << endl;
+ //qDebug() << "AwardsWidget::createUI-159" << endl;
dxUpRightAwardsTabLayout->addWidget(wazConfirmedQLCDNumber, 2, 2);
- //qDebug() << "AwardsWidget::createUI-160" << endl;
+ //qDebug() << "AwardsWidget::createUI-160" << endl;
//dxUpRightAwardsTabLayout->addWidget(localLabelN, 3, 0);
- //qDebug() << "AwardsWidget::createUI-161" << endl;
+ //qDebug() << "AwardsWidget::createUI-161" << endl;
//dxUpRightAwardsTabLayout->addWidget(localWorkedQLCDNumber, 3, 1);
- //qDebug() << "AwardsWidget::createUI-162" << endl;
+ //qDebug() << "AwardsWidget::createUI-162" << endl;
//dxUpRightAwardsTabLayout->addWidget(localConfirmedQLCDNumber, 3, 2);
- //qDebug() << "AwardsWidget::createUI-163" << endl;
+ //qDebug() << "AwardsWidget::createUI-163" << endl;
dxUpRightAwardsTabLayout->addWidget(qsoNLabelN, 4, 0);
- //qDebug() << "AwardsWidget::createUI-164" << endl;
+ //qDebug() << "AwardsWidget::createUI-164" << endl;
dxUpRightAwardsTabLayout->addWidget(qsoWorkedQLCDNumber, 4, 1);
- //qDebug() << "AwardsWidget::createUI-165" << endl;
+ //qDebug() << "AwardsWidget::createUI-165" << endl;
dxUpRightAwardsTabLayout->addWidget(qsoConfirmedQLCDNumber, 4, 2);
- //qDebug() << "AwardsWidget::createUI-166" << endl;
+ //qDebug() << "AwardsWidget::createUI-166" << endl;
dxUpRightAwardsTabLayout->addLayout(yearlyTLayout, 5, 0);
- //qDebug() << "AwardsWidget::createUI-167" << endl;
+ //qDebug() << "AwardsWidget::createUI-167" << endl;
dxUpRightAwardsTabLayout->addLayout(yearlyDLayout, 5, 1, 1, -1);
- //qDebug() << "AwardsWidget::createUI-168" << endl;
+ //qDebug() << "AwardsWidget::createUI-168" << endl;
dxUpRightAwardsTabLayout->addWidget(recalculateAwardsButton, 6, 1);
- //qDebug() << "AwardsWidget::createUI-200" << endl;
+ //qDebug() << "AwardsWidget::createUI-200" << endl;
setLayout(dxUpRightAwardsTabLayout);
//connect(dataProxy, SIGNAL(qsoFound(QStringList)), this, SLOT(slotQsoFound(QStringList)) );
@@ -225,7 +225,7 @@ void AwardsWidget::createUI()
connect(recalculateAwardsButton, SIGNAL(clicked()), this, SLOT(slotRecalculateAwardsButtonClicked() ) );
emit debugLog (Q_FUNC_INFO, "End", logSeverity);
- //qDebug() << "AwardsWidget::createUI-END" << endl;
+ //qDebug() << "AwardsWidget::createUI-END" << endl;
}
void AwardsWidget::setManageDXMarathon(const bool _dx)
@@ -239,7 +239,7 @@ void AwardsWidget::setManageDXMarathon(const bool _dx)
/*
void AwardsWidget::slotSearchClearButtonClicked()
{
- //qDebug() << "SearchWidget::slotSearchClearButtonClicked: " << endl;
+ //qDebug() << "SearchWidget::slotSearchClearButtonClicked: " << endl;
searchResultsTreeWidget->clear();
searchBoxLineEdit->clear();
searchSelectAllClicked = false;
@@ -259,10 +259,10 @@ void AwardsWidget::setToolTips()
qsoConfirmedQLCDNumber->setToolTip(tr("Number of confirmed QSOs."));
qsoWorkedQLCDNumber->setToolTip(tr("Number of worked QSOs."));
- yearlyQSOLCDNumber->setToolTip(tr("Number of QSOs worked in the selected year."));
- yearlyDXCCQLCDNumber->setToolTip(tr("Number of DXCCs worked in the selected year."));
- yearlyCQQLCDNumber->setToolTip(tr("Number of CQ Zones worked in the selected year."));
- yearlyScoreQLCDNumber->setToolTip(tr("Score for the DXMarathon in the selected year."));
+ yearlyQSOLCDNumber->setToolTip(tr("Number of QSOs worked on the selected year."));
+ yearlyDXCCQLCDNumber->setToolTip(tr("Number of DXCC worked on the selected year."));
+ yearlyCQQLCDNumber->setToolTip(tr("Number of CQ Zones worked on the selected year."));
+ yearlyScoreQLCDNumber->setToolTip(tr("Score for the DXMarathon on the selected year."));
operatingYearsComboBox->setToolTip(tr("Select the year you want to check."));
emit debugLog (Q_FUNC_INFO, "End", logSeverity);
@@ -287,7 +287,7 @@ void AwardsWidget::slotOperatingYearComboBoxChanged()
void AwardsWidget::showAwards()
{ // Updates and show all the award status tab.
- //qDebug() << "AwardsWidget::showAwards" << endl;
+ //qDebug() << "AwardsWidget::showAwards" << endl;
/*
WAZ
Local
@@ -336,26 +336,26 @@ void AwardsWidget::showAwards()
showDXMarathon(selectedYear);
emit debugLog(Q_FUNC_INFO, "END", logSeverity);
- //qDebug() << "AwardsWidget::showAwards - END" << endl;
+ //qDebug() << "AwardsWidget::showAwards - END" << endl;
}
void AwardsWidget::showDXMarathon(const int _year)
{
- //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: Year: " << QString::number(_year) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: Year: " << QString::number(_year) << endl;
emit debugLog(Q_FUNC_INFO, "Start", logSeverity);
int i = 0;
i = awards->getDXMarathonQSO(_year, currentLog);
- //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: QSO: " << QString::number(i) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: QSO: " << QString::number(i) << endl;
yearlyQSOLCDNumber->display(i);
i = awards->getDXMarathonDXCC(_year, currentLog);
- //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: DXCC: " << QString::number(i) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: DXCC: " << QString::number(i) << endl;
yearlyDXCCQLCDNumber->display(i);
i = awards->getDXMarathonCQ(_year, currentLog);
yearlyCQQLCDNumber->display(i);
- //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: CQ: " << QString::number(i) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: CQ: " << QString::number(i) << endl;
if (manageDXMarathon)
{
@@ -367,7 +367,7 @@ void AwardsWidget::showDXMarathon(const int _year)
}
yearlyScoreQLCDNumber->display(i);
emit debugLog(Q_FUNC_INFO, "End", logSeverity);
- //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: Score: " << QString::number(i) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget::showDXMarathon: Score: " << QString::number(i) << endl;
}
void AwardsWidget::reconfigureDXMarathonUI(const bool _dxM)
@@ -452,27 +452,27 @@ void AwardsWidget::fillOperatingYears()
if (dataProxy->getLastQSOid()<=1)
{
- //qDebug() << "AwardsWidget::AwardsWidget: 18.4" << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget: 18.4" << endl;
operatingYearsComboBox->addItem(QString::number(selectedYear));
}
else
{
- //qDebug() << "AwardsWidget::AwardsWidget: 18.5 - currentLog: " << QString::number(currentLog) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget: 18.5 - currentLog: " << QString::number(currentLog) << endl;
operatingYearsComboBox->addItems(dataProxy->getOperatingYears(currentLog));
- //qDebug() << "AwardsWidget::AwardsWidget: 18.5.1 - currentLog: " << QString::number(currentLog) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget: 18.5.1 - currentLog: " << QString::number(currentLog) << endl;
QStringList a;
a.clear();
a << dataProxy->getOperatingYears(currentLog);
- //qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.1 - currentLog: " << QString::number(currentLog) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.1 - currentLog: " << QString::number(currentLog) << endl;
if (!a.isEmpty())
{
- //qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.2 - currentLog: " << QString::number(currentLog) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.2 - currentLog: " << QString::number(currentLog) << endl;
operatingYearsComboBox->setCurrentIndex(operatingYearsComboBox->findText(a.last(), Qt::MatchCaseSensitive));
- //qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.3 - currentLog: " << QString::number(currentLog) << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget: 18.5.1.3 - currentLog: " << QString::number(currentLog) << endl;
}
- //qDebug() << "AwardsWidget::AwardsWidget: 18.5.2" << endl;
+ //qDebug() << "AwardsWidget::AwardsWidget: 18.5.2" << endl;
}
emit debugLog(Q_FUNC_INFO, "End", logSeverity);
}
diff --git a/awardswidget.h b/awardswidget.h
index 119e009a..5057ac5e 100644
--- a/awardswidget.h
+++ b/awardswidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
//
diff --git a/charts/barchartstats.cpp b/charts/barchartstats.cpp
index a2d31880..2a715f25 100644
--- a/charts/barchartstats.cpp
+++ b/charts/barchartstats.cpp
@@ -1,4 +1,4 @@
-#include "charts/barchartstats.h"
+#include "barchartstats.h"
/***************************************************************************
barchartstats.cpp - description
-------------------
@@ -21,7 +21,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
@@ -56,7 +56,7 @@ BarChartStats::~BarChartStats(){}
void BarChartStats::clear()
{
- //qDebug() << "BarChartStats::clear()" << endl;
+ //qDebug() << "BarChartStats::clear()" << endl;
//cleanLayout();
prepareChart(1);
}
@@ -113,7 +113,7 @@ void BarChartStats::prepareChart(const int _selection, const int _log)
case 4:
{
//cleanLayout();
- //qDebug() << "BarChartStats::prepareChart SelectedGrapth-4: per band " << endl;
+ //qDebug() << "BarChartStats::prepareChart SelectedGrapth-4: per band " << endl;
genchart = new StatsQSOsPerBandBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);
}
@@ -121,7 +121,7 @@ void BarChartStats::prepareChart(const int _selection, const int _log)
case 5:
{
//cleanLayout();
- //qDebug() << "BarChartStats::prepareChart SelectedGrapth-5: per modes " << endl;
+ //qDebug() << "BarChartStats::prepareChart SelectedGrapth-5: per modes " << endl;
genchart = new StatsQSOsPerModeBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);
@@ -130,14 +130,14 @@ void BarChartStats::prepareChart(const int _selection, const int _log)
case 6:
{
//cleanLayout();
- //qDebug() << "BarChartStats::prepareChart SelectedGrapth-6: per dxcc " << endl;
+ //qDebug() << "BarChartStats::prepareChart SelectedGrapth-6: per dxcc " << endl;
genchart = new StatsQSOsPerDXCCBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);
}
break;
case 7:
{ // How many QSO per Continent
- //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/Continent " << endl;
+ //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/Continent " << endl;
//cleanLayout();
genchart = new StatsQSOsPerContinentBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);
@@ -145,7 +145,7 @@ void BarChartStats::prepareChart(const int _selection, const int _log)
break;
case 8:
{
- //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour " << endl;
+ //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour " << endl;
//cleanLayout();
genchart = new StatsQSOsPerHourBarChartWidget(dataProxy, nullptr);
mLayout->addWidget(genchart);
diff --git a/charts/barchartstats.h b/charts/barchartstats.h
index 37c38e6b..cbc6ff30 100644
--- a/charts/barchartstats.h
+++ b/charts/barchartstats.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
#include
diff --git a/charts/statscqzperyearbarchartwidget.cpp b/charts/statscqzperyearbarchartwidget.cpp
index 60974ca5..c3bda19f 100644
--- a/charts/statscqzperyearbarchartwidget.cpp
+++ b/charts/statscqzperyearbarchartwidget.cpp
@@ -1,17 +1,15 @@
-#include "charts/statscqzperyearbarchartwidget.h"
+#include "statscqzperyearbarchartwidget.h"
StatsCQZPerYearBarChartWidget::StatsCQZPerYearBarChartWidget(){}
StatsCQZPerYearBarChartWidget::StatsCQZPerYearBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsCQZPerYearBarChartWidget::StatsCQZPerYearBarChartWidget" << endl;
+ //qDebug() << "StatsCQZPerYearBarChartWidget::StatsCQZPerYearBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
chartView = new QChartView(chart);
- //chart->setTheme(QChart::ChartThemeQt);
- //chart->setTheme(QChart::ChartThemeBlueCerulean);
createUI();
prepareChart();
@@ -32,9 +30,9 @@ void StatsCQZPerYearBarChartWidget::createUI()
void StatsCQZPerYearBarChartWidget::prepareChart()
{
- QString categoriesTitle;
- QString categoriesElem;
- QStringList categories;
+ QString x_axisTitle;
+ QString x_axisElem;
+ QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
@@ -42,51 +40,49 @@ void StatsCQZPerYearBarChartWidget::prepareChart()
int numberPerX = 0;
chart->removeAllSeries();
- categories.clear();
+ x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("CQ Zones per year"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
- QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
+ QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
- //qDebug() << "StatsCQZPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
- categories.append(dataProxy->getOperatingYears(-1));
- categoriesElem = tr("CQ zones");
- categoriesTitle = tr("CQ zones per year");
+ //qDebug() << "StatsCQZPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
+ x_axis.append(dataProxy->getOperatingYears(-1));
+ x_axisElem = tr("CQ zones");
+ x_axisTitle = tr("CQ zones per year");
aux.clear();
- for (int i = 0; i < categories.count();i++ )
+ for (int i = 0; i < x_axis.count();i++ )
{
- numberPerX = dataProxy->getCQzonYear((categories.at(i)).toInt(), -1);
- //numberPerX = dataProxy->getQSOonYear((categories.at(i)).toInt(), -1);
- //qDebug() << categories.at(i) + "-" + QString::number(numberPerX) << endl;
+ numberPerX = dataProxy->getCQzonYear((x_axis.at(i)).toInt(), -1);
+ //numberPerX = dataProxy->getQSOonYear((x_axis.at(i)).toInt(), -1);
+ //qDebug() << x_axis.at(i) + "-" + QString::number(numberPerX) << endl;
*set0 << numberPerX;
- //qDebug() << "StatsCQZPerYearBarChartWidget::prepareChart QSOs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
+ //qDebug() << "StatsCQZPerYearBarChartWidget::prepareChart QSOs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
- aux = tr("Reading data ...") + "\n" + tr("Years: %1/%2").arg(QString::number(i)).arg(QString::number(categories.count()));
+ aux = tr("Reading data ...") + "\n" + tr("Years: %1/%2").arg(QString::number(i)).arg(QString::number(x_axis.count()));
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
- i = categories.count();
+ i = x_axis.count();
}
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
- set0->setLabel(categoriesElem);
+ set0->setLabel(x_axisElem);
chart->addSeries(series);
- chart->setTitle(categoriesTitle);
+ chart->setTitle(x_axisTitle);
- axis->append(categories);
- //chart->createDefaultAxes();
- //series->attachAxis(axis);
- chart->addAxis(axis, Qt::AlignBottom);
- //chart->setAxisX(axis, series);
+ axis->append(x_axis);
+ chart->createDefaultAxes();
+ chart->setAxisX(axis, series);
}
diff --git a/charts/statscqzperyearbarchartwidget.h b/charts/statscqzperyearbarchartwidget.h
index 040bddbc..65e87f73 100644
--- a/charts/statscqzperyearbarchartwidget.h
+++ b/charts/statscqzperyearbarchartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statsentitiesperyearbarchartwidget.cpp b/charts/statsentitiesperyearbarchartwidget.cpp
index a71b3fd8..a0dd6dc9 100644
--- a/charts/statsentitiesperyearbarchartwidget.cpp
+++ b/charts/statsentitiesperyearbarchartwidget.cpp
@@ -1,11 +1,11 @@
-#include "charts/statsentitiesperyearbarchartwidget.h"
+#include "statsentitiesperyearbarchartwidget.h"
StatsEntitiesPerYearBarChartWidget::StatsEntitiesPerYearBarChartWidget(){}
StatsEntitiesPerYearBarChartWidget::StatsEntitiesPerYearBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsEntitiesPerYearBarChartWidget::StatsEntitiesPerYearBarChartWidget" << endl;
+ //qDebug() << "StatsEntitiesPerYearBarChartWidget::StatsEntitiesPerYearBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -30,60 +30,56 @@ void StatsEntitiesPerYearBarChartWidget::createUI()
void StatsEntitiesPerYearBarChartWidget::prepareChart()
{
- QString categoriesTitle;
- QString categoriesElem;
- QStringList categories;
+ QString x_axisTitle;
+ QString x_axisElem;
+ QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
- categoriesTitle = QString();
- categoriesElem = QString();
- categories.clear();
+ x_axisTitle = QString();
+ x_axisElem = QString();
+ x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("Chart title"));
//*set0->remove(0, set0->count()-1);
//qreal sum = 0;
- QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
+ QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
- //qDebug() << "StatsEntitiesPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
- //qDebug() << "BarChartStats::prepareChart: SelectedGrapth-2: DXCC " << endl;
- categories.append(dataProxy->getOperatingYears(-1));
- categoriesElem = tr("DXCC Entities");
- categoriesTitle = tr("DXCC Entities per year");
+ //qDebug() << "StatsEntitiesPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
+ //qDebug() << "BarChartStats::prepareChart: SelectedGrapth-2: DXCC " << endl;
+ x_axis.append(dataProxy->getOperatingYears(-1));
+ x_axisElem = tr("DXCC Entities");
+ x_axisTitle = tr("DXCC Entities per year");
aux.clear();
- for (int i = 0; i < categories.count();i++ )
+ for (int i = 0; i < x_axis.count();i++ )
{
- numberPerX = dataProxy->getDXCConYear((categories.at(i)).toInt(), -1);
+ numberPerX = dataProxy->getDXCConYear((x_axis.at(i)).toInt(), -1);
*set0 << numberPerX;
numberPerX = 0;
- aux = tr("Reading data ...") + "\n" + tr("Entities: ") + QString::number(i) + "/" + QString::number(categories.count());
+ aux = tr("Reading data ...") + "\n" + tr("Entities: ") + QString::number(i) + "/" + QString::number(x_axis.count());
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
- i = categories.count();
+ i = x_axis.count();
}
- //qDebug() << "BarChartStats::prepareChart DXCCs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
+ //qDebug() << "BarChartStats::prepareChart DXCCs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
}
series->append(set0);
- set0->setLabel(categoriesElem);
+ set0->setLabel(x_axisElem);
chart->addSeries(series);
- chart->setTitle(categoriesTitle);
-
- axis->append(categories);
- //chart->createDefaultAxes();
- //series->attachAxis(axis);
- chart->addAxis(axis, Qt::AlignBottom);
-
- // chart->setAxisX(axis, series);
+ chart->setTitle(x_axisTitle);
+ axis->append(x_axis);
+ chart->createDefaultAxes();
+ chart->setAxisX(axis, series);
}
diff --git a/charts/statsentitiesperyearbarchartwidget.h b/charts/statsentitiesperyearbarchartwidget.h
index 815737cd..ec056e5a 100644
--- a/charts/statsentitiesperyearbarchartwidget.h
+++ b/charts/statsentitiesperyearbarchartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statsgeneralchartwidget.cpp b/charts/statsgeneralchartwidget.cpp
index 56120cf9..558ab218 100644
--- a/charts/statsgeneralchartwidget.cpp
+++ b/charts/statsgeneralchartwidget.cpp
@@ -1,14 +1,14 @@
-#include "charts/statsgeneralchartwidget.h"
+#include "statsgeneralchartwidget.h"
StatsGeneralChartWidget::StatsGeneralChartWidget()
{
- //qDebug() << "StatsGeneralChartWidget::StatsGeneralChartWidget" << endl;
+ //qDebug() << "StatsGeneralChartWidget::StatsGeneralChartWidget" << endl;
}
StatsGeneralChartWidget::StatsGeneralChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsGeneralChartWidget::StatsGeneralChartWidget" << endl;
+ //qDebug() << "StatsGeneralChartWidget::StatsGeneralChartWidget" << endl;
}
diff --git a/charts/statsqsosperbandbarchartwidget.cpp b/charts/statsqsosperbandbarchartwidget.cpp
index 1ac26b9d..6a941ed9 100644
--- a/charts/statsqsosperbandbarchartwidget.cpp
+++ b/charts/statsqsosperbandbarchartwidget.cpp
@@ -1,11 +1,11 @@
-#include "charts/statsqsosperbandbarchartwidget.h"
+#include "statsqsosperbandbarchartwidget.h"
StatsQSOsPerBandBarChartWidget::StatsQSOsPerBandBarChartWidget(){}
StatsQSOsPerBandBarChartWidget::StatsQSOsPerBandBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsQSOsPerBandBarChartWidget::StatsQSOsPerBandBarChartWidget" << endl;
+ //qDebug() << "StatsQSOsPerBandBarChartWidget::StatsQSOsPerBandBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -30,62 +30,59 @@ void StatsQSOsPerBandBarChartWidget::createUI()
void StatsQSOsPerBandBarChartWidget::prepareChart()
{
- QString categoriesTitle;
- QString categoriesElem;
- QStringList categories;
+ QString x_axisTitle;
+ QString x_axisElem;
+ QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
- categoriesTitle = QString();
- categoriesElem = QString();
- categories.clear();
+ x_axisTitle = QString();
+ x_axisElem = QString();
+ x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per band"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
- QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
+ QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
- //qDebug() << "StatsQSOsPerBandBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
- categories.append(dataProxy->getBandsInLog(-1));
- categoriesElem = tr("Bands");
- categoriesTitle = tr("QSOs per band distribution");
+ //qDebug() << "StatsQSOsPerBandBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
+ x_axis.append(dataProxy->getBandsInLog(-1));
+ x_axisElem = tr("Bands");
+ x_axisTitle = tr("QSO per band distribution");
aux.clear();
- for (int i = 0; i < categories.count();i++ )
+ for (int i = 0; i < x_axis.count();i++ )
{
- numberPerX = dataProxy->getQSOsInBand((categories.at(i)), -1);
- //qDebug() << categories.at(i) + "-" + QString::number(numberPerX) << endl;
+ numberPerX = dataProxy->getQSOsInBand((x_axis.at(i)), -1);
+ //qDebug() << x_axis.at(i) + "-" + QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
- //qDebug() << "StatsQSOsPerBandBarChartWidget::prepareChart QSOs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
- aux = tr("Reading data ...") + "\n" + tr("Bands: ") + QString::number(i) + "/" + QString::number(categories.count());
- //aux = tr("Reading data ...") + "\n" + tr("Bands: %1/%2").arg(QString::number(i)).arg(QString::number(categories.count()));
+ //qDebug() << "StatsQSOsPerBandBarChartWidget::prepareChart QSOs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
+ aux = tr("Reading data ...") + "\n" + tr("Bands: ") + QString::number(i) + "/" + QString::number(x_axis.count());
+ //aux = tr("Reading data ...") + "\n" + tr("Bands: %1/%2").arg(QString::number(i)).arg(QString::number(x_axis.count()));
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
- i = categories.count();
+ i = x_axis.count();
}
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
- set0->setLabel(categoriesElem);
+ set0->setLabel(x_axisElem);
chart->addSeries(series);
- chart->setTitle(categoriesTitle);
+ chart->setTitle(x_axisTitle);
- axis->append(categories);
- //chart->createDefaultAxes();
- //series->attachAxis(axis);
- chart->addAxis(axis, Qt::AlignBottom);
-
- //chart->setAxisX(axis, series);
+ axis->append(x_axis);
+ chart->createDefaultAxes();
+ chart->setAxisX(axis, series);
}
diff --git a/charts/statsqsosperbandbarchartwidget.h b/charts/statsqsosperbandbarchartwidget.h
index 8bdef594..ef99003c 100644
--- a/charts/statsqsosperbandbarchartwidget.h
+++ b/charts/statsqsosperbandbarchartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statsqsospercontinentbarchartwidget.cpp b/charts/statsqsospercontinentbarchartwidget.cpp
old mode 100755
new mode 100644
index 735326e9..fbb1baf8
--- a/charts/statsqsospercontinentbarchartwidget.cpp
+++ b/charts/statsqsospercontinentbarchartwidget.cpp
@@ -1,11 +1,11 @@
-#include "charts/statsqsospercontinentbarchartwidget.h"
+#include "statsqsospercontinentbarchartwidget.h"
StatsQSOsPerContinentBarChartWidget::StatsQSOsPerContinentBarChartWidget(){}
StatsQSOsPerContinentBarChartWidget::StatsQSOsPerContinentBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsQSOsPerContinentBarChartWidget::StatsQSOsPerContinentBarChartWidget" << endl;
+ //qDebug() << "StatsQSOsPerContinentBarChartWidget::StatsQSOsPerContinentBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -30,25 +30,25 @@ void StatsQSOsPerContinentBarChartWidget::createUI()
void StatsQSOsPerContinentBarChartWidget::prepareChart()
{
- QString categoriesTitle;
- QString categoriesElem;
- QStringList categories;
+ QString x_axisTitle;
+ QString x_axisElem;
+ QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
- categoriesTitle = QString();
- categoriesElem = QString();
- categories.clear();
+ x_axisTitle = QString();
+ x_axisElem = QString();
+ x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per continent"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
- QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
+ QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
@@ -56,40 +56,37 @@ void StatsQSOsPerContinentBarChartWidget::prepareChart()
continents.clear();
continents << dataProxy->getContinentShortNames();
- categories.append(continents);
- categoriesElem = tr("Continents");
- categoriesTitle = tr("QSOs per continent");
+ x_axis.append(continents);
+ x_axisElem = tr("Continents");
+ x_axisTitle = tr("QSOs per continent");
aux.clear();
- for (int i = 0; i < categories.count(); i++ )
+ for (int i = 0; i < x_axis.count(); i++ )
{
- numberPerX = dataProxy->getQSOsWithContinent(categories.at(i), -1);
- //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << categories.at(i) << " - " << QString::number(numberPerX) << endl;
+ numberPerX = dataProxy->getQSOsWithContinent(x_axis.at(i), -1);
+ //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << x_axis.at(i) << " - " << QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
- aux = tr("Reading data ...") + "\n" + tr("Hours: ") + QString::number(i) + "/" + QString::number(categories.count());
+ aux = tr("Reading data ...") + "\n" + tr("Hours: ") + QString::number(i) + "/" + QString::number(x_axis.count());
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
- i = categories.count();
+ i = x_axis.count();
}
- //qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
+ //qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
- set0->setLabel(categoriesElem);
+ set0->setLabel(x_axisElem);
chart->addSeries(series);
- chart->setTitle(categoriesTitle);
+ chart->setTitle(x_axisTitle);
- axis->append(categories);
- //chart->createDefaultAxes();
- //series->attachAxis(axis);
- chart->addAxis(axis, Qt::AlignBottom);
-
- //chart->setAxisX(axis, series);
+ axis->append(x_axis);
+ chart->createDefaultAxes();
+ chart->setAxisX(axis, series);
}
diff --git a/charts/statsqsospercontinentbarchartwidget.h b/charts/statsqsospercontinentbarchartwidget.h
old mode 100755
new mode 100644
index a9601d65..541589dc
--- a/charts/statsqsospercontinentbarchartwidget.h
+++ b/charts/statsqsospercontinentbarchartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statsqsosperdxccbarchartwidget.cpp b/charts/statsqsosperdxccbarchartwidget.cpp
old mode 100755
new mode 100644
index df307eaa..fc84a3b1
--- a/charts/statsqsosperdxccbarchartwidget.cpp
+++ b/charts/statsqsosperdxccbarchartwidget.cpp
@@ -1,11 +1,11 @@
-#include "charts/statsqsosperdxccbarchartwidget.h"
+#include "statsqsosperdxccbarchartwidget.h"
StatsQSOsPerDXCCBarChartWidget::StatsQSOsPerDXCCBarChartWidget(){}
StatsQSOsPerDXCCBarChartWidget::StatsQSOsPerDXCCBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsQSOsPerDXCCBarChartWidget::StatsQSOsPerDXCCBarChartWidget" << endl;
+ //qDebug() << "StatsQSOsPerDXCCBarChartWidget::StatsQSOsPerDXCCBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -30,25 +30,25 @@ void StatsQSOsPerDXCCBarChartWidget::createUI()
void StatsQSOsPerDXCCBarChartWidget::prepareChart()
{
- QString categoriesTitle;
- QString categoriesElem;
- QStringList categories;
+ QString x_axisTitle;
+ QString x_axisElem;
+ QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
- categoriesTitle = QString();
- categoriesElem = QString();
- categories.clear();
+ x_axisTitle = QString();
+ x_axisElem = QString();
+ x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per DXCC"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
- QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
+ QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
aux = tr("Reading data...") ;
progress.setLabelText(aux);
@@ -58,7 +58,7 @@ void StatsQSOsPerDXCCBarChartWidget::prepareChart()
entities.clear();
entities << dataProxy->getEntitiesIds();
- //qDebug() << "StatsQSOsPerDXCCBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
+ //qDebug() << "StatsQSOsPerDXCCBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
QMap map; // key,value = number of QSO, dxcc
int qsos = -1;
@@ -70,11 +70,11 @@ void StatsQSOsPerDXCCBarChartWidget::prepareChart()
qsos = dataProxy->getQSOsWithDXCC((entities.at(i)).toInt(), -1);
if (qsos>0)
{
- //qDebug() << "Checking: " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << " - " << entities.at(i) << " - QSOs: " << QString::number(qsos) ;
+ //qDebug() << "Checking: " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << " - " << entities.at(i) << " - QSOs: " << QString::number(qsos) ;
if (map.size()<10)
{
- //qDebug() << "Inserting: " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << " - " << entities.at(i) << " - QSOs: " << QString::number(qsos) ;
+ //qDebug() << "Inserting: " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << " - " << entities.at(i) << " - QSOs: " << QString::number(qsos) ;
map.insert(qsos, (entities.at(i)).toInt());
}
else
@@ -84,8 +84,8 @@ void StatsQSOsPerDXCCBarChartWidget::prepareChart()
it.next();
if (it.key()< qsos)
{
- //qDebug() << "Removing: " << QString::number(it.key()) << " / " << QString::number(it.value()) << endl;
- //qDebug() << "Replacing by: " << entities.at(i) << " / " << QString::number(qsos) << " - " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << endl;
+ //qDebug() << "Removing: " << QString::number(it.key()) << " / " << QString::number(it.value()) << endl;
+ //qDebug() << "Replacing by: " << entities.at(i) << " / " << QString::number(qsos) << " - " << dataProxy->getEntityNameFromId((entities.at(i)).toInt()) << endl;
map.remove(it.key());
map.insert(qsos, (entities.at(i)).toInt());
it.toBack();
@@ -101,36 +101,33 @@ void StatsQSOsPerDXCCBarChartWidget::prepareChart()
{
i = entities.size();
}
- //qDebug() << "End of for iteration" << endl;
+ //qDebug() << "End of for iteration" << endl;
}
QMapIterator it(map);
while (it.hasNext()) {
it.next();
- categories.append(dataProxy->getEntityMainPrefix(it.value()));
+ x_axis.append(dataProxy->getEntityMainPrefix(it.value()));
numberPerX = it.key();
*set0 << numberPerX;
numberPerX = 0;
- //qDebug() << "End of while iteration" << endl;
+ //qDebug() << "End of while iteration" << endl;
}
- //qDebug() << "Out of while" << endl;
+ //qDebug() << "Out of while" << endl;
- categoriesElem = tr("DXCC");
- categoriesTitle = tr("Top ten DXCC per QSO");
+ x_axisElem = tr("DXCC");
+ x_axisTitle = tr("Top ten DXCC per QSO");
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
- set0->setLabel(categoriesElem);
+ set0->setLabel(x_axisElem);
chart->addSeries(series);
- chart->setTitle(categoriesTitle);
+ chart->setTitle(x_axisTitle);
- axis->append(categories);
- //chart->createDefaultAxes();
- //series->attachAxis(axis);
- chart->addAxis(axis, Qt::AlignBottom);
-
- //chart->setAxisX(axis, series);
+ axis->append(x_axis);
+ chart->createDefaultAxes();
+ chart->setAxisX(axis, series);
}
diff --git a/charts/statsqsosperdxccbarchartwidget.h b/charts/statsqsosperdxccbarchartwidget.h
old mode 100755
new mode 100644
index 097a3b96..da6a1e83
--- a/charts/statsqsosperdxccbarchartwidget.h
+++ b/charts/statsqsosperdxccbarchartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statsqsosperhourbarchartwidget.cpp b/charts/statsqsosperhourbarchartwidget.cpp
old mode 100755
new mode 100644
index c7c600b1..d71f6e78
--- a/charts/statsqsosperhourbarchartwidget.cpp
+++ b/charts/statsqsosperhourbarchartwidget.cpp
@@ -1,11 +1,11 @@
-#include "charts/statsqsosperhourbarchartwidget.h"
+#include "statsqsosperhourbarchartwidget.h"
StatsQSOsPerHourBarChartWidget::StatsQSOsPerHourBarChartWidget(){}
StatsQSOsPerHourBarChartWidget::StatsQSOsPerHourBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsQSOsPerHourBarChartWidget::StatsQSOsPerHourBarChartWidget" << endl;
+ //qDebug() << "StatsQSOsPerHourBarChartWidget::StatsQSOsPerHourBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -30,67 +30,63 @@ void StatsQSOsPerHourBarChartWidget::createUI()
void StatsQSOsPerHourBarChartWidget::prepareChart()
{
- QString categoriesTitle;
- QString categoriesElem;
- QStringList categories;
+ QString x_axisTitle;
+ QString x_axisElem;
+ QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
- categoriesTitle = QString();
- categoriesElem = QString();
- categories.clear();
+ x_axisTitle = QString();
+ x_axisElem = QString();
+ x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per hour"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
- QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
+ QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
QStringList hours;
hours.clear();
hours << "00" << "01" << "02" << "03" << "04" << "05" << "06" << "07" << "08" << "09" << "10" << "11"
<< "12" << "13" << "14" << "15" << "16" << "17" << "18" << "19" << "20" << "21" << "22" << "23";
- categories.append(hours);
- categoriesElem = tr("Hours");
- categoriesTitle = tr("QSOs at hour");
+ x_axis.append(hours);
+ x_axisElem = tr("Hours");
+ x_axisTitle = tr("QSOs at hour");
aux.clear();
- for (int i = 0; i < categories.count(); i++ )
+ for (int i = 0; i < x_axis.count(); i++ )
{
- numberPerX = dataProxy->getQSOsAtHour((categories.at(i)).toInt(), -1);
- //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << categories.at(i) << " - " << QString::number(numberPerX) << endl;
+ numberPerX = dataProxy->getQSOsAtHour((x_axis.at(i)).toInt(), -1);
+ //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << x_axis.at(i) << " - " << QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
- aux = tr("Reading data ...") + "\n" + tr("Hours: ") + QString::number(i) + "/" + QString::number(categories.count());
+ aux = tr("Reading data ...") + "\n" + tr("Hours: ") + QString::number(i) + "/" + QString::number(x_axis.count());
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
- i = categories.count();
+ i = x_axis.count();
}
- //qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
+ //qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
- set0->setLabel(categoriesElem);
+ set0->setLabel(x_axisElem);
chart->addSeries(series);
- chart->setTitle(categoriesTitle);
+ chart->setTitle(x_axisTitle);
- axis->append(categories);
- //chart->createDefaultAxes();
- //series->attachAxis(axis);
- chart->addAxis(axis, Qt::AlignBottom);
- //chart->setAxisX(axis, series);
+ axis->append(x_axis);
+ chart->createDefaultAxes();
+ chart->setAxisX(axis, series);
}
-
-
diff --git a/charts/statsqsosperhourbarchartwidget.h b/charts/statsqsosperhourbarchartwidget.h
old mode 100755
new mode 100644
index 18a1e4b5..2f9d231b
--- a/charts/statsqsosperhourbarchartwidget.h
+++ b/charts/statsqsosperhourbarchartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statsqsospermodebarchartwidget.cpp b/charts/statsqsospermodebarchartwidget.cpp
index 0dbc4ba3..631a2566 100644
--- a/charts/statsqsospermodebarchartwidget.cpp
+++ b/charts/statsqsospermodebarchartwidget.cpp
@@ -1,11 +1,11 @@
-#include "charts/statsqsospermodebarchartwidget.h"
+#include "statsqsospermodebarchartwidget.h"
StatsQSOsPerModeBarChartWidget::StatsQSOsPerModeBarChartWidget(){}
StatsQSOsPerModeBarChartWidget::StatsQSOsPerModeBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsQSOsPerModeBarChartWidget::StatsQSOsPerModeBarChartWidget" << endl;
+ //qDebug() << "StatsQSOsPerModeBarChartWidget::StatsQSOsPerModeBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -30,62 +30,59 @@ void StatsQSOsPerModeBarChartWidget::createUI()
void StatsQSOsPerModeBarChartWidget::prepareChart()
{
- QString categoriesTitle;
- QString categoriesElem;
- QStringList categories;
+ QString x_axisTitle;
+ QString x_axisElem;
+ QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
- categoriesTitle = QString();
- categoriesElem = QString();
- categories.clear();
+ x_axisTitle = QString();
+ x_axisElem = QString();
+ x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per mode"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
- QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
+ QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
- //qDebug() << "StatsQSOsPerModeBarChartWidget::prepareChart: SelectedGrapth-1: MODES " << endl;
- categories.append(dataProxy->getModesInLog(-1));
- categoriesElem = tr("Modes");
- categoriesTitle = tr("QSOs per mode distribution");
+ //qDebug() << "StatsQSOsPerModeBarChartWidget::prepareChart: SelectedGrapth-1: MODES " << endl;
+ x_axis.append(dataProxy->getModesInLog(-1));
+ x_axisElem = tr("Modes");
+ x_axisTitle = tr("QSO per mode distribution");
aux.clear();
- for (int i = 0; i < categories.count();i++ )
+ for (int i = 0; i < x_axis.count();i++ )
{
- numberPerX = dataProxy->getQSOsInMode((categories.at(i)), -1);
- //qDebug() << categories.at(i) + "-" + QString::number(numberPerX) << endl;
+ numberPerX = dataProxy->getQSOsInMode((x_axis.at(i)), -1);
+ //qDebug() << x_axis.at(i) + "-" + QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
- //qDebug() << "StatsQSOsPerModeBarChartWidget::prepareChart QSOs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
- aux = tr("Reading data ...") + "\n" + tr("Modes: ") + QString::number(i) + "/" + QString::number(categories.count());
- //aux = tr("Reading data ...") + "\n" + tr("Modes: %1/%2").arg(QString::number(i)).arg(QString::number(categories.count()));
+ //qDebug() << "StatsQSOsPerModeBarChartWidget::prepareChart QSOs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
+ aux = tr("Reading data ...") + "\n" + tr("Modes: ") + QString::number(i) + "/" + QString::number(x_axis.count());
+ //aux = tr("Reading data ...") + "\n" + tr("Modes: %1/%2").arg(QString::number(i)).arg(QString::number(x_axis.count()));
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
- i = categories.count();
+ i = x_axis.count();
}
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
- set0->setLabel(categoriesElem);
+ set0->setLabel(x_axisElem);
chart->addSeries(series);
- chart->setTitle(categoriesTitle);
+ chart->setTitle(x_axisTitle);
- axis->append(categories);
- //chart->createDefaultAxes();
- //series->attachAxis(axis);
- chart->addAxis(axis, Qt::AlignBottom);
-
- //chart->setAxisX(axis, series);
+ axis->append(x_axis);
+ chart->createDefaultAxes();
+ chart->setAxisX(axis, series);
}
diff --git a/charts/statsqsospermodebarchartwidget.h b/charts/statsqsospermodebarchartwidget.h
index 25c559da..c66e6f58 100644
--- a/charts/statsqsospermodebarchartwidget.h
+++ b/charts/statsqsospermodebarchartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statsqsospermonthbarchartwidget.cpp b/charts/statsqsospermonthbarchartwidget.cpp
old mode 100755
new mode 100644
index 8e80537f..c7a4bde0
--- a/charts/statsqsospermonthbarchartwidget.cpp
+++ b/charts/statsqsospermonthbarchartwidget.cpp
@@ -1,11 +1,11 @@
-#include "charts/statsqsospermonthbarchartwidget.h"
+#include "statsqsospermonthbarchartwidget.h"
StatsQSOsPerMonthBarChartWidget::StatsQSOsPerMonthBarChartWidget(){}
StatsQSOsPerMonthBarChartWidget::StatsQSOsPerMonthBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsQSOsPerMonthBarChartWidget::StatsQSOsPerMonthBarChartWidget" << endl;
+ //qDebug() << "StatsQSOsPerMonthBarChartWidget::StatsQSOsPerMonthBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -30,66 +30,63 @@ void StatsQSOsPerMonthBarChartWidget::createUI()
void StatsQSOsPerMonthBarChartWidget::prepareChart()
{
- QString categoriesTitle;
- QString categoriesElem;
- QStringList categories;
+ QString x_axisTitle;
+ QString x_axisElem;
+ QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
- categoriesTitle = QString();
- categoriesElem = QString();
- categories.clear();
+ x_axisTitle = QString();
+ x_axisElem = QString();
+ x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("QSOs per month"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
- QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
+ QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
QStringList months;
months.clear();
months << tr("Jan") << tr("Feb") << tr("Mar") << tr("Apr") << tr("May") << tr("Jun")
<< tr("Jul") << tr("Aug") << tr("Sep") << tr("Oct") << tr("Nov") << tr("Dec");
- categories.append(months);
- categoriesElem = tr("Months");
- categoriesTitle = tr("QSOs at Month");
+ x_axis.append(months);
+ x_axisElem = tr("Months");
+ x_axisTitle = tr("QSOs at Month");
aux.clear();
- for (int i = 0; i < categories.count(); i++ )
+ for (int i = 0; i < x_axis.count(); i++ )
{
numberPerX = dataProxy->getQSOsOnMonth(i+1, -1);
- //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << categories.at(i) << " - " << QString::number(numberPerX) << endl;
+ //qDebug() << "BarChartStats::prepareChart SelectedGrapth-7: QSO/hour: " << x_axis.at(i) << " - " << QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
- aux = tr("Reading data ...") + "\n" + tr("Months: ") + QString::number(i) + "/" + QString::number(categories.count());
+ aux = tr("Reading data ...") + "\n" + tr("Months: ") + QString::number(i) + "/" + QString::number(x_axis.count());
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
- i = categories.count();
+ i = x_axis.count();
}
- //qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
+ //qDebug() << "BarChartStats::prepareChart CQz: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
- set0->setLabel(categoriesElem);
+ set0->setLabel(x_axisElem);
chart->addSeries(series);
- chart->setTitle(categoriesTitle);
+ chart->setTitle(x_axisTitle);
- axis->append(categories);
- //chart->createDefaultAxes();
- //series->attachAxis(axis);
- chart->addAxis(axis, Qt::AlignBottom);
-
- //chart->setAxisX(axis, series);
+ axis->append(x_axis);
+ chart->createDefaultAxes();
+ chart->setAxisX(axis, series);
}
diff --git a/charts/statsqsospermonthbarchartwidget.h b/charts/statsqsospermonthbarchartwidget.h
old mode 100755
new mode 100644
index 3c7e3c48..32a5614e
--- a/charts/statsqsospermonthbarchartwidget.h
+++ b/charts/statsqsospermonthbarchartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statsqsosperyearbarchartwidget.cpp b/charts/statsqsosperyearbarchartwidget.cpp
index 56583958..d6239803 100644
--- a/charts/statsqsosperyearbarchartwidget.cpp
+++ b/charts/statsqsosperyearbarchartwidget.cpp
@@ -1,11 +1,11 @@
-#include "charts/statsqsosperyearbarchartwidget.h"
+#include "statsqsosperyearbarchartwidget.h"
StatsQSOsPerYearBarChartWidget::StatsQSOsPerYearBarChartWidget(){}
StatsQSOsPerYearBarChartWidget::StatsQSOsPerYearBarChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsQSOsPerYearBarChartWidget::StatsQSOsPerYearBarChartWidget" << endl;
+ //qDebug() << "StatsQSOsPerYearBarChartWidget::StatsQSOsPerYearBarChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -30,61 +30,59 @@ void StatsQSOsPerYearBarChartWidget::createUI()
void StatsQSOsPerYearBarChartWidget::prepareChart()
{
- QString categoriesTitle;
- QString categoriesElem;
- QStringList categories;
+ QString x_axisTitle;
+ QString x_axisElem;
+ QStringList x_axis;
QBarSeries *series = new QBarSeries();
QBarCategoryAxis *axis = new QBarCategoryAxis();
QString aux;
int numberPerX = 0;
chart->removeAllSeries();
- categoriesTitle = QString();
- categoriesElem = QString();
- categories.clear();
+ x_axisTitle = QString();
+ x_axisElem = QString();
+ x_axis.clear();
axis->clear();
series->clear();
QBarSet *set0 = new QBarSet(tr("Chart title"));
//*set0->remove(0, set0->count()-1);
qreal sum = 0;
- QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, categories.count(), this);
+ QProgressDialog progress(tr("Reading data ... "), tr("Abort reading"), 0, x_axis.count(), this);
progress.setWindowModality(Qt::WindowModal);
- //qDebug() << "StatsQSOsPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
- categories.append(dataProxy->getOperatingYears(-1));
- categoriesElem = tr("QSOs");
- categoriesTitle = tr("QSOs per year");
+ //qDebug() << "StatsQSOsPerYearBarChartWidget::prepareChart: SelectedGrapth-1: YEARS " << endl;
+ x_axis.append(dataProxy->getOperatingYears(-1));
+ x_axisElem = tr("QSOs");
+ x_axisTitle = tr("QSOs per year");
aux.clear();
- for (int i = 0; i < categories.count();i++ )
+ for (int i = 0; i < x_axis.count();i++ )
{
- numberPerX = dataProxy->getQSOonYear((categories.at(i)).toInt(), -1);
- //qDebug() << categories.at(i) + "-" + QString::number(numberPerX) << endl;
+ numberPerX = dataProxy->getQSOonYear((x_axis.at(i)).toInt(), -1);
+ //qDebug() << x_axis.at(i) + "-" + QString::number(numberPerX) << endl;
*set0 << numberPerX;
numberPerX = 0;
- //qDebug() << "StatsQSOsPerYearBarChartWidget::prepareChart QSOs: " << QString::number((categories.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
+ //qDebug() << "StatsQSOsPerYearBarChartWidget::prepareChart QSOs: " << QString::number((x_axis.at(i)).toInt()) << "/" << QString::number(numberPerX) << endl;
- aux = tr("Reading data ...") + "\n" + tr("QSO: %1/%2").arg(QString::number(i)).arg(QString::number(categories.count()));
+ aux = tr("Reading data ...") + "\n" + tr("QSO: %1/%2").arg(QString::number(i)).arg(QString::number(x_axis.count()));
progress.setLabelText(aux);
progress.setValue(i);
if ( progress.wasCanceled() )
{
- i = categories.count();
+ i = x_axis.count();
}
}
sum = set0->sum();
set0->setLabel(QString::number(sum));
series->append(set0);
- set0->setLabel(categoriesElem);
+ set0->setLabel(x_axisElem);
chart->addSeries(series);
- chart->setTitle(categoriesTitle);
+ chart->setTitle(x_axisTitle);
- axis->append(categories);
- //chart->createDefaultAxes();
- //series->attachAxis(axis);
- chart->addAxis(axis, Qt::AlignBottom);
- //chart->setAxisX(axis, series);
+ axis->append(x_axis);
+ chart->createDefaultAxes();
+ chart->setAxisX(axis, series);
}
diff --git a/charts/statsqsosperyearbarchartwidget.h b/charts/statsqsosperyearbarchartwidget.h
index e0c19401..dd59856c 100644
--- a/charts/statsqsosperyearbarchartwidget.h
+++ b/charts/statsqsosperyearbarchartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statssentconfirmedpiechartwidget.cpp b/charts/statssentconfirmedpiechartwidget.cpp
old mode 100755
new mode 100644
index 5b513f58..235bc0e4
--- a/charts/statssentconfirmedpiechartwidget.cpp
+++ b/charts/statssentconfirmedpiechartwidget.cpp
@@ -1,10 +1,10 @@
-#include "charts/statssentconfirmedpiechartwidget.h"
+#include "statssentconfirmedpiechartwidget.h"
StatsSentConfirmedPieChartWidget::StatsSentConfirmedPieChartWidget(){}
StatsSentConfirmedPieChartWidget::StatsSentConfirmedPieChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsSentConfirmedPieChartWidget::StatsSentConfirmedPieChartWidget" << endl;
+ //qDebug() << "StatsSentConfirmedPieChartWidget::StatsSentConfirmedPieChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -32,9 +32,9 @@ void StatsSentConfirmedPieChartWidget::prepareChart()
//PieSlice append(string label, real value)
int sent = dataProxy->getHowManyQSLSentInLog(-1);
int confirmed = dataProxy->getHowManyConfirmedQSLInLog(-1);
-
- //qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
-
+ //qDebug() << "QSOs: " << QString::number(qsos) << endl;
+ //qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
+ //qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
series->append(tr("Sent - %1").arg(sent), sent);
series->append(tr("Confirmed - %2").arg(confirmed), confirmed);
diff --git a/charts/statssentconfirmedpiechartwidget.h b/charts/statssentconfirmedpiechartwidget.h
old mode 100755
new mode 100644
index 97f88b96..b50804d8
--- a/charts/statssentconfirmedpiechartwidget.h
+++ b/charts/statssentconfirmedpiechartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
@@ -40,7 +40,7 @@ class StatsSentConfirmedPieChartWidget : public StatsGeneralChartWidget
{
Q_OBJECT
public:
- StatsSentConfirmedPieChartWidget(DataProxy_SQLite *dp, QWidget *parent = nullptr);
+ StatsSentConfirmedPieChartWidget(DataProxy_SQLite *dp, QWidget *parent = 0);
StatsSentConfirmedPieChartWidget();
void prepareChart();
diff --git a/charts/statsworkedconfirmedpiechartwidget.cpp b/charts/statsworkedconfirmedpiechartwidget.cpp
old mode 100755
new mode 100644
index 5e6c0940..c784eca1
--- a/charts/statsworkedconfirmedpiechartwidget.cpp
+++ b/charts/statsworkedconfirmedpiechartwidget.cpp
@@ -1,10 +1,10 @@
-#include "charts/statsworkedconfirmedpiechartwidget.h"
+#include "statsworkedconfirmedpiechartwidget.h"
StatsWorkedConfirmedPieChartWidget::StatsWorkedConfirmedPieChartWidget(){}
StatsWorkedConfirmedPieChartWidget::StatsWorkedConfirmedPieChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsWorkedConfirmedPieChartWidget::StatsWorkedConfirmedPieChartWidget" << endl;
+ //qDebug() << "StatsWorkedConfirmedPieChartWidget::StatsWorkedConfirmedPieChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -32,9 +32,9 @@ void StatsWorkedConfirmedPieChartWidget::prepareChart()
//PieSlice append(string label, real value)
int qsos = dataProxy->getHowManyQSOInLog(-1);
int confirmed = dataProxy->getHowManyConfirmedQSLInLog(-1);
- //qDebug() << "QSOs: " << QString::number(qsos) << endl;
- //qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
- //qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
+ //qDebug() << "QSOs: " << QString::number(qsos) << endl;
+ //qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
+ //qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
series->append(tr("Worked, not confirmed - %1").arg(qsos-confirmed), qsos - confirmed);
series->append(tr("Confirmed - %2").arg(confirmed), confirmed);
diff --git a/charts/statsworkedconfirmedpiechartwidget.h b/charts/statsworkedconfirmedpiechartwidget.h
old mode 100755
new mode 100644
index a0bef98c..5b72dfd7
--- a/charts/statsworkedconfirmedpiechartwidget.h
+++ b/charts/statsworkedconfirmedpiechartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/charts/statsworkedsentpiechartwidget.cpp b/charts/statsworkedsentpiechartwidget.cpp
old mode 100755
new mode 100644
index 4023882d..3dc15bbe
--- a/charts/statsworkedsentpiechartwidget.cpp
+++ b/charts/statsworkedsentpiechartwidget.cpp
@@ -1,10 +1,10 @@
-#include "charts/statsworkedsentpiechartwidget.h"
+#include "statsworkedsentpiechartwidget.h"
StatsWorkedSentPieChartWidget::StatsWorkedSentPieChartWidget(){}
StatsWorkedSentPieChartWidget::StatsWorkedSentPieChartWidget(DataProxy_SQLite *dp, QWidget *parent)
{
- //qDebug() << "StatsWorkedSentPieChartWidget::StatsWorkedSentPieChartWidget" << endl;
+ //qDebug() << "StatsWorkedSentPieChartWidget::StatsWorkedSentPieChartWidget" << endl;
dataProxy = dp;
chart = new QChart();
@@ -32,9 +32,9 @@ void StatsWorkedSentPieChartWidget::prepareChart()
//PieSlice append(string label, real value)
int qsos = dataProxy->getHowManyQSOInLog(-1);
int confirmed = dataProxy->getHowManyQSLSentInLog(-1);
- //qDebug() << "QSOs: " << QString::number(qsos) << endl;
- //qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
- //qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
+ //qDebug() << "QSOs: " << QString::number(qsos) << endl;
+ //qDebug() << "Confirmed: " << QString::number(confirmed) << endl;
+ //qDebug() << "Worked: " << QString::number(qsos - confirmed) << endl;
series->append(tr("Worked - %1").arg(qsos), qsos);
series->append(tr("Sent - %2").arg(confirmed), confirmed);
diff --git a/charts/statsworkedsentpiechartwidget.h b/charts/statsworkedsentpiechartwidget.h
old mode 100755
new mode 100644
index d043823a..aebcde38
--- a/charts/statsworkedsentpiechartwidget.h
+++ b/charts/statsworkedsentpiechartwidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
diff --git a/database.cpp b/database.cpp
index c6394f67..ee4636b1 100644
--- a/database.cpp
+++ b/database.cpp
@@ -20,7 +20,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
@@ -29,29 +29,28 @@
DataBase::DataBase(const QString &_parentClass, const QString &_DBName)
{
- //qDebug() << "DataBase::DataBase: PLAIN: " << _parentClass << " / Name = " << _DBName << endl;
+ //qDebug() << "DataBase::DataBase: PLAIN: " << _parentClass << " / Name = " << _DBName << endl;
constrid = 1;
util = new Utilities();
softVersion = util->getVersion();
dbName = _DBName;
- //qDebug() << "DataBase::DataBase1: dbName: " << dbName << endl;
+ //qDebug() << "DataBase::DataBase1: dbName: " << dbName << endl;
//db = QSqlDatabase::database();
dbVersion = DBVersionf;
createConnection(QString(Q_FUNC_INFO)+"1");
- //qDebug() << "DataBase::DataBase: PLAIN - connection Name: " << dbConnectionName << endl;
- //qDebug() << "DataBase::DataBase: PLAIN - DB Name: " << db.databaseName() << endl;
+ //qDebug() << "DataBase::DataBase: PLAIN - connection Name: " << dbConnectionName << endl;
+ //qDebug() << "DataBase::DataBase: PLAIN - DB Name: " << db.databaseName() << endl;
insertPreparedQueries.clear();
insertQueryFields.clear();
- //qDebug() << "DataBase::DataBase: PLAIN: - END" << endl;
+ //qDebug() << "DataBase::DataBase: PLAIN: - END" << endl;
}
-DataBase::DataBase(const QString &_parentClass, const QString &_softVersion, const QString &_DBName)
-{
- //qDebug() << "DataBase::DataBase2: " << _parentClass << "/" << _softVersion << " / Name = " << _DBName << endl;
+DataBase::DataBase(const QString &_parentClass, const QString &_softVersion, const QString &_DBName){
+ //qDebug() << "DataBase::DataBase2: " << _parentClass << "/" << _softVersion << " / Name = " << _DBName << endl;
//TODO: Sometimes the DB is created without the proper calling (without passing softVersion)
constrid = 2;
dbVersion = DBVersionf;
@@ -64,26 +63,21 @@ DataBase::DataBase(const QString &_parentClass, const QString &_softVersion, con
//dbName = util->getKLogDBFile();
dbName = _DBName;
- //qDebug() << "DataBase::DataBase2: dbName: " << dbName << endl;
+ //qDebug() << "DataBase::DataBase2: dbName: " << dbName << endl;
//dbDir = dbName;
- //qDebug() << "DataBase::DataBase: DB(string): " << dbName << endl;
+ //qDebug() << "DataBase::DataBase: DB(string): " << dbName << endl;
//db = QSqlDatabase::database();
-
-
- //db = QSqlDatabase::removeDatabase("QSQLITE");
if (util->getVersionDouble()>0)
{
-
createConnection(QString(Q_FUNC_INFO)+"2");
-
}
- //qDebug() << "DataBase::DataBase: - connection Name: " << dbConnectionName << endl;
- //qDebug() << "DataBase::DataBase: - DB Name: " << db.databaseName() << endl;
+ //qDebug() << "DataBase::DataBase: - connection Name: " << dbConnectionName << endl;
+ //qDebug() << "DataBase::DataBase: - DB Name: " << db.databaseName() << endl;
insertPreparedQueries.clear();
insertQueryFields.clear();
- //qDebug() << "DataBase::DataBase2: END" << endl;
+ //qDebug() << "DataBase::DataBase2: END" << endl;
}
@@ -120,7 +114,7 @@ bool DataBase::queryPrepare()
bool DataBase::queryExec()
{
- //qDebug() << "DataBase::queryExec " << endl;
+ //qDebug() << "DataBase::queryExec " << endl;
bool sqlOK;
//insertQueryFields.clear();
//insertPreparedQueries.clear();
@@ -138,11 +132,11 @@ bool DataBase::queryExec()
{
queryErrorManagement("DataBase::queryExec", preparedQuery.lastError().databaseText(), preparedQuery.lastError().number(), preparedQuery.lastQuery());
//emit queryError(Q_FUNC_INFO, preparedQuery.lastError().databaseText(), preparedQuery.lastError().number(), preparedQuery.lastQuery());
- //qDebug() << "DataBase::queryExec - FAILED execution: " << preparedQuery.lastQuery() << endl;
+ //qDebug() << "DataBase::queryExec - FAILED execution: " << preparedQuery.lastQuery() << endl;
}
else
{
- //qDebug() << "DataBase::queryExec - executed: " << preparedQuery.lastQuery() << endl;
+ //qDebug() << "DataBase::queryExec - executed: " << preparedQuery.lastQuery() << endl;
}
return sqlOK;
}
@@ -152,7 +146,7 @@ bool DataBase::queryExec()
DataBase::~DataBase()
{
- //qDebug() << "DataBase::~DataBase" << endl;
+ //qDebug() << "DataBase::~DataBase" << endl;
}
QString DataBase::getSoftVersion()
@@ -232,7 +226,7 @@ QString DataBase::getDBName()
QStringList DataBase::getColumnNamesFromTable(const QString &_tableName)
{
- //qDebug() << "DataBase::getColumnNamesFromTable: " << _tableName << endl;
+ //qDebug() << "DataBase::getColumnNamesFromTable: " << _tableName << endl;
QSqlQuery query;
QString queryString = QString("PRAGMA table_info('%1')").arg(_tableName);
@@ -243,7 +237,7 @@ QStringList DataBase::getColumnNamesFromTable(const QString &_tableName)
QString aux;
if (sqlOK)
{
- //qDebug() << "DataBase::getColumnNamesFromTable: OK" << endl;
+ //qDebug() << "DataBase::getColumnNamesFromTable: OK" << endl;
while(query.next())
{
if (query.isValid())
@@ -252,7 +246,7 @@ QStringList DataBase::getColumnNamesFromTable(const QString &_tableName)
if (( aux.toUpper() != "ID" ) && (aux.length()>0))
{
list << aux;
- //qDebug() << "DataBase::getColumnNamesFromTable: " << (query.value(1)).toString() << endl;
+ //qDebug() << "DataBase::getColumnNamesFromTable: " << (query.value(1)).toString() << endl;
}
}
}
@@ -263,14 +257,14 @@ QStringList DataBase::getColumnNamesFromTable(const QString &_tableName)
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
}
query.finish();
- //qDebug() << "DataBase::getColumnNamesFromTable: " << QString::number(list.size()) << endl;
+ //qDebug() << "DataBase::getColumnNamesFromTable: " << QString::number(list.size()) << endl;
return list;
}
void DataBase::compress()
{
- //qDebug() << "DataBase::compress " << endl;
+ //qDebug() << "DataBase::compress " << endl;
//QSqlDatabase db = QSqlDatabase::database();
if (!db.open()) {
@@ -286,74 +280,67 @@ void DataBase::compress()
bool DataBase::reConnect(const QString &_DBName)
{
- //qDebug() << "DataBase::reConnect:" << endl;
+ //qDebug() << "DataBase::reConnect:" << endl;
db.close();
dbName = _DBName;
- //qDebug() << "DataBase::reConnect: DB closed" << endl;
+ //qDebug() << "DataBase::reConnect: DB closed" << endl;
//dbName = util->getKLogDBFile();
- //qDebug() << "DataBase::reConnect: DB: " << dbDir << endl;
+ //qDebug() << "DataBase::reConnect: DB: " << dbDir << endl;
return createConnection(Q_FUNC_INFO);
- //qDebug() << "DataBase::reConnect: END" << endl;
+ //qDebug() << "DataBase::reConnect: END" << endl;
}
bool DataBase::createConnection(const QString &function, bool newDB)
{
- //qDebug() << "DataBase::createConnection: " << function << "-" << QString::number(dbVersion) << "/" << softVersion << endl;
+ //qDebug() << "DataBase::createConnection: " << function << "-" << QString::number(dbVersion) << "/" << softVersion << endl;
QString stringQuery;
QSqlQuery query;
if (!db.isOpen())
{
- //qDebug() << "DataBase::createConnection: DB NOT Opened" << endl;
+ //qDebug() << "DataBase::createConnection: DB NOT Opened" << endl;
//db = QSqlDatabase::database();
if (db.isValid())
{
- //qDebug() << "DataBase::createConnection: DB is Valid" << endl;
+ //qDebug() << "DataBase::createConnection: DB is Valid" << endl;
}
else
{
- //qDebug() << "DataBase::createConnection: DB is not valid, let's call addDataBase" << endl;
+ //qDebug() << "DataBase::createConnection: DB is not valid, let's call addDataBase" << endl;
if (db.isOpen())
{
- //qDebug() << "DataBase::createConnection: DB is already open" << endl;
+ //qDebug() << "DataBase::createConnection: DB is already open" << endl;
}
else
{
- //qDebug() << "DataBase::createConnection: DB is NOT open, let's open: connection name" << db.connectionName()<< endl;
- QSqlDatabase::removeDatabase("qt_sql_default_connection");
+ //qDebug() << "DataBase::createConnection: DB is NOT open, let's open" << endl;
db = QSqlDatabase::addDatabase("QSQLITE");
-
- //if (QSqlDatabase::contains("myConnection"))
- //{
- // db = QSqlDatabase::addDatabase("QSQLITE", "myConnection");
- //}
-
}
- //qDebug() << "DataBase::createConnection: Now we call setDatabaseName" << endl;
+ //qDebug() << "DataBase::createConnection: Now we call setDatabaseName" << endl;
db.setDatabaseName(dbName);
- //qDebug() << "DataBase::createConnection: end of not valid" << endl;
+ //qDebug() << "DataBase::createConnection: end of not valid" << endl;
}
- //qDebug() << "DataBase::createConnection: end of valid check, let's try if it is open" << endl;
+ //qDebug() << "DataBase::createConnection: end of valid check, let's try if it is open" << endl;
if (!db.open())
{
- //qDebug() << "DataBase::createConnection:Not open " << endl;
+ //qDebug() << "DataBase::createConnection:Not open " << endl;
QMessageBox::warning(nullptr, QObject::tr("Database Error"), db.lastError().text());
- //qDebug() << "DataBase::createConnection: DB creation ERROR" << endl;
+ //qDebug() << "DataBase::createConnection: DB creation ERROR" << endl;
return false;
}
else
{
- //qDebug() << "DataBase::createConnection: created and opened after the creation" << endl;
+ //qDebug() << "DataBase::createConnection: created and opened after the creation" << endl;
if (isTheDBCreated())
{
- //qDebug() << "DataBase::createConnection: DB Exists" << endl;
+ //qDebug() << "DataBase::createConnection: DB Exists" << endl;
}
else
{
- //qDebug() << "DataBase::createConnection: DB does not exist" << endl;
+ //qDebug() << "DataBase::createConnection: DB does not exist" << endl;
createDataBase();
stringQuery ="PRAGMA main.page_size = 4096;";
@@ -381,29 +368,29 @@ bool DataBase::createConnection(const QString &function, bool newDB)
}
else
{
- //qDebug() << "DataBase::createConnection: No Error, DB is open" << endl;
+ //qDebug() << "DataBase::createConnection: No Error, DB is open" << endl;
}
- //qDebug() << "DataBase::createConnection: Going to run - createBandModeMaps " << endl;
+ //qDebug() << "DataBase::createConnection: Going to run - createBandModeMaps " << endl;
if (createBandModeMaps())
{
- //qDebug() << "DataBase::createConnection: createBandModeMaps true" << endl;
+ //qDebug() << "DataBase::createConnection: createBandModeMaps true" << endl;
}
else
{
- //qDebug() << "DataBase::createConnection: createBandModeMaps false SSSSSSSSSSSSSSSTOOOOOOOOOOOOOOOOOOOOOPPPPPPPPPPPPPPPPPPPP" << endl;
+ //qDebug() << "DataBase::createConnection: createBandModeMaps false SSSSSSSSSSSSSSSTOOOOOOOOOOOOOOOOOOOOOPPPPPPPPPPPPPPPPPPPP" << endl;
}
//created = true;
- //qDebug() << "DataBase::createConnection -------------------------------------------- END" << endl;
+ //qDebug() << "DataBase::createConnection -------------------------------------------- END" << endl;
return unMarkAllQSO();
}
bool DataBase::isTheDBCreated()
{
- //qDebug() << "DataBase::isTheDBCreated: Called from: " << QString::number(constrid) << endl;
+ //qDebug() << "DataBase::isTheDBCreated: Called from: " << QString::number(constrid) << endl;
QSqlQuery query;
int _num = 0;
@@ -414,24 +401,24 @@ bool DataBase::isTheDBCreated()
if (sqlOK)
{
- //qDebug() << "DataBase::isTheDBCreated - SQL OK" << endl;
+ //qDebug() << "DataBase::isTheDBCreated - SQL OK" << endl;
query.next();
if (query.isValid())
{
- //qDebug() << "DataBase::isTheDBCreated - valid" << endl;
+ //qDebug() << "DataBase::isTheDBCreated - valid" << endl;
_num = (query.value(0)).toInt();
if (_num > 0)
{
- //qDebug() << "DataBase::isTheDBCreated - DB Exists" << endl;
- //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------- END TRUE" << endl;
+ //qDebug() << "DataBase::isTheDBCreated - DB Exists" << endl;
+ //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------- END TRUE" << endl;
query.finish();
return true;
}
else
{
- //qDebug() << "DataBase::isTheDBCreated - DB does not Exist" << endl;
- //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------- END FALSE-1" << endl;
+ //qDebug() << "DataBase::isTheDBCreated - DB does not Exist" << endl;
+ //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------- END FALSE-1" << endl;
query.finish();
return false;
}
@@ -439,32 +426,32 @@ bool DataBase::isTheDBCreated()
else
{
- //qDebug() << "DataBase::isTheDBCreated - not valid" << endl;
- //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------- END FALSE-2" << endl;
+ //qDebug() << "DataBase::isTheDBCreated - not valid" << endl;
+ //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------- END FALSE-2" << endl;
query.finish();
return false;
}
}
else
{ //ERROR in Query execution
- //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------ ERROR IN QUERY EXECUTION" << endl;
+ //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------ ERROR IN QUERY EXECUTION" << endl;
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return false;
}
//query.finish();
- //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------- END FALSE-X" << endl;
+ //qDebug() << "DataBase::isTheDBCreated: ------------------------------------------------- END FALSE-X" << endl;
//return false;
}
bool DataBase::recreateTableLog()
{
- //qDebug() << "DataBase::recreateTableLog" << endl;
+ //qDebug() << "DataBase::recreateTableLog" << endl;
if (!createTableLog(false)) // Create modetemp
{
- //qDebug() << "DataBase::recreateTableLog: CreateTableLog returned false" << endl;
+ //qDebug() << "DataBase::recreateTableLog: CreateTableLog returned false" << endl;
return false;
}
@@ -494,21 +481,21 @@ bool DataBase::recreateTableLog()
}
else
{
- //qDebug() << "recreateTableLog ERROR - logTemp not renamed" << endl;
+ //qDebug() << "recreateTableLog ERROR - logTemp not renamed" << endl;
return false;
}
}
else
{
- //qDebug() << "recreateTableLog ERROR - log table not dropped" << endl;
+ //qDebug() << "recreateTableLog ERROR - log table not dropped" << endl;
}
}
else
{
- //qDebug() << "recreateTableLog ERROR - Data not moved" << endl;
+ //qDebug() << "recreateTableLog ERROR - Data not moved" << endl;
return false;
}
- //qDebug() << "recreateTableLog END" << endl;
+ //qDebug() << "recreateTableLog END" << endl;
return true;
}
@@ -522,12 +509,12 @@ bool DataBase::createTableLog(bool temp)
if (temp)
{
stringQuery = "CREATE TABLE log" ;
- //qDebug() << "DataBase::createTableLog: log" << endl;
+ //qDebug() << "DataBase::createTableLog: log" << endl;
}
else
{
stringQuery = "CREATE TABLE logtemp" ;
- //qDebug() << "DataBase::createTableLog: logtemp" << endl;
+ //qDebug() << "DataBase::createTableLog: logtemp" << endl;
}
stringQuery = stringQuery + QString(" (id INTEGER PRIMARY KEY AUTOINCREMENT, "
@@ -694,7 +681,7 @@ bool DataBase::createTableLog(bool temp)
"FOREIGN KEY (dxcc) REFERENCES entity, "
"FOREIGN KEY (bandid) REFERENCES band)");
- //qDebug() << "DataBase::createTableLog: " << stringQuery << endl;
+ //qDebug() << "DataBase::createTableLog: " << stringQuery << endl;
if (execQuery(Q_FUNC_INFO, stringQuery))
{
@@ -723,11 +710,11 @@ bool DataBase::createTableLog(bool temp)
bool DataBase::createDataBase()
{
- //qDebug() << "DataBase::createDataBase ------------------------------------- START" << QString::number(constrid) << endl;
+ //qDebug() << "DataBase::createDataBase ------------------------------------- START" << QString::number(constrid) << endl;
//bool qres;
//http://www.sqlite.org/
//http://www.sqlite.org/datatype3.html
- //qDebug() << "DataBase::createData" << endl;
+ //qDebug() << "DataBase::createData" << endl;
//int softDB = dbVersion;
//QString softV = _softVersion;
//QString dateString;
@@ -898,7 +885,7 @@ bool DataBase::createDataBase()
execQuery(Q_FUNC_INFO, "INSERT INTO qso_complete_enumeration (shortname, name) VALUES ('NIL', 'Not heard')");
execQuery(Q_FUNC_INFO, "INSERT INTO qso_complete_enumeration (shortname, name) VALUES ('?', 'Uncertain')");
- //qDebug() << "DataBase::createDataBase ------------------------------------- END" << endl;
+ //qDebug() << "DataBase::createDataBase ------------------------------------- END" << endl;
return true;
}
@@ -976,7 +963,7 @@ bool DataBase::createTableAwardWAZ()
int DataBase::getBandIdFromName(const QString &b)
{
- //qDebug() << "DataBase::getBandIdFromName: " << b << endl;
+ //qDebug() << "DataBase::getBandIdFromName: " << b << endl;
QSqlQuery query;
if (isValidBand(b))
{
@@ -989,7 +976,7 @@ int DataBase::getBandIdFromName(const QString &b)
query.next();
if ( query.isValid() )
{
- //qDebug() << "DataBase::getBandIdFromName: OK" << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataBase::getBandIdFromName: OK" << QString::number((query.value(0)).toInt()) << endl;
int v = (query.value(0)).toInt();
query.finish();
return v;
@@ -997,7 +984,7 @@ int DataBase::getBandIdFromName(const QString &b)
}
else
{
- //qDebug() << "DataBase::getBandIdFromName: NOK 1" << endl;
+ //qDebug() << "DataBase::getBandIdFromName: NOK 1" << endl;
query.finish();
return -1;
}
@@ -1008,11 +995,11 @@ int DataBase::getBandIdFromName(const QString &b)
query.finish();
return -2;
}
- //qDebug() << "DataBase::getBandIdFromName: NOK 3" << endl;
+ //qDebug() << "DataBase::getBandIdFromName: NOK 3" << endl;
}
else
{
- //qDebug() << "DataBase::getBandIdFromName: BAND NOT VALID: " << b << endl;
+ //qDebug() << "DataBase::getBandIdFromName: BAND NOT VALID: " << b << endl;
}
query.finish();
return -3;
@@ -1020,12 +1007,12 @@ int DataBase::getBandIdFromName(const QString &b)
int DataBase::getModeIdFromName(const QString &b)
{
- //qDebug() << "DataBase::getModeIdFromName: " << b << endl;
+ //qDebug() << "DataBase::getModeIdFromName: " << b << endl;
QSqlQuery query;
if (isValidMode(b, false))
{
QString queryString = QString("SELECT id FROM mode WHERE name='%1'").arg(b);
- //qDebug() << "DataBase::getModeIdFromName: queryString: " << queryString << endl;
+ //qDebug() << "DataBase::getModeIdFromName: queryString: " << queryString << endl;
bool sqlOK = query.exec(queryString);
if (sqlOK)
@@ -1033,13 +1020,13 @@ int DataBase::getModeIdFromName(const QString &b)
query.next();
if ( query.isValid() )
{
- //qDebug() << "DataBase::getModeIdFromName: OK" << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataBase::getModeIdFromName: OK" << QString::number((query.value(0)).toInt()) << endl;
return (query.value(0)).toInt();
}
else
{
- //qDebug() << "DataBase::getModeIdFromName: NOK 1" << endl;
+ //qDebug() << "DataBase::getModeIdFromName: NOK 1" << endl;
query.finish();
return -1;
}
@@ -1052,7 +1039,7 @@ int DataBase::getModeIdFromName(const QString &b)
}
- //qDebug() << "DataBase::getModeIdFromName: NOK 3" << endl;
+ //qDebug() << "DataBase::getModeIdFromName: NOK 3" << endl;
query.finish();
return -1;
}
@@ -1060,7 +1047,7 @@ int DataBase::getModeIdFromName(const QString &b)
int DataBase::getModeIdFromSubMode(const QString &b)
{
- //qDebug() << "DataBase::getModeIdFromSubMode: " << b << endl;
+ //qDebug() << "DataBase::getModeIdFromSubMode: " << b << endl;
QSqlQuery query;
QString queryString = QString("SELECT id FROM mode WHERE submode='%1'").arg(b);
/*
@@ -1081,33 +1068,33 @@ int DataBase::getModeIdFromSubMode(const QString &b)
query.next();
if (query.isValid())
{
- //qDebug() << "DataBase::getModeIdFromName: OK - Mode: " << b << " - " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataBase::getModeIdFromName: OK - Mode: " << b << " - " << (query.value(0)).toString() << endl;
return (query.value(0)).toInt();
}
else
{
- //qDebug() << "DataBase::getModeIdFromName: NOK 1" << "-------- END"<< endl;
+ //qDebug() << "DataBase::getModeIdFromName: NOK 1" << "-------- END"<< endl;
query.finish();
return -1;
}
}
else
{
- //qDebug() << "DataBase::getModeIdFromName: NOK 2" << "-------- END"<< endl;
+ //qDebug() << "DataBase::getModeIdFromName: NOK 2" << "-------- END"<< endl;
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return -1;
}
- //qDebug() << "DataBase::getModeIdFromName: NOK 3" << "-------- END"<< endl;
+ //qDebug() << "DataBase::getModeIdFromName: NOK 3" << "-------- END"<< endl;
//query.finish();
//return -1;
}
QString DataBase::getBandNameFromNumber(const int _n)
{
- //qDebug() << "DataBase::getBandNameFromNumber: " << QString::number(_n) << endl;
+ //qDebug() << "DataBase::getBandNameFromNumber: " << QString::number(_n) << endl;
QSqlQuery query;
QString queryString = QString("SELECT name FROM band WHERE id='%1'").arg(_n);
@@ -1120,19 +1107,19 @@ QString DataBase::getBandNameFromNumber(const int _n)
{
if ( isValidBand((query.value(0)).toString()) )
{
- //qDebug() << "DataBase::getBandNameFromNumber: " << (query.value(0)).toString() << "-------- END" << endl;
+ //qDebug() << "DataBase::getBandNameFromNumber: " << (query.value(0)).toString() << "-------- END" << endl;
return (query.value(0)).toString();
}
else
{
- //qDebug() << "DataBase::getBandNameFromNumber: " << "-------- END-1" << endl;
+ //qDebug() << "DataBase::getBandNameFromNumber: " << "-------- END-1" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataBase::getBandNameFromNumber: " << "-------- END-2" << endl;
+ //qDebug() << "DataBase::getBandNameFromNumber: " << "-------- END-2" << endl;
query.finish();
return QString();
}
@@ -1151,7 +1138,7 @@ QString DataBase::getBandNameFromNumber(const int _n)
QString DataBase::getModeNameFromNumber(const int _n, bool _tmp)
{
//TODO May fail to identify the sumbode(mode/modetemp... (Review STEP-2 o 3)
- //qDebug() << "DataBase::getModeNameFromNumber: " << QString::number(_n) << endl;
+ //qDebug() << "DataBase::getModeNameFromNumber: " << QString::number(_n) << endl;
QSqlQuery query;
QString queryString;
if (_tmp)
@@ -1172,30 +1159,30 @@ QString DataBase::getModeNameFromNumber(const int _n, bool _tmp)
query.finish();
}
query.next();
- //qDebug() << "DataBase::getModeNameFromNumber: " << QString::number(_n) <<" - " << isValidMode((query.value(0)).toString(), _tmp) << endl;
+ //qDebug() << "DataBase::getModeNameFromNumber: " << QString::number(_n) <<" - " << isValidMode((query.value(0)).toString(), _tmp) << endl;
if ( query.isValid() )
{
- //qDebug() << "DataBase::getModeNameFromNumber: ------ END-1" << endl;
+ //qDebug() << "DataBase::getModeNameFromNumber: ------ END-1" << endl;
return (query.value(0)).toString();
/* In a version when I change the mode table to include submode, this comparison may need to be checked in both versions
* at once, failing the query as old version was not having the column submode
*
if ( isValidMode((query.value(0)).toString(), _tmp))
{
- //qDebug() << "DataBase::getModeNameFromNumber - Found: " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataBase::getModeNameFromNumber - Found: " << (query.value(0)).toString() << endl;
return (query.value(0)).toString();
}
else
{
- //qDebug() << "DataBase::getModeNameFromNumber - Not Valid Mode: " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataBase::getModeNameFromNumber - Not Valid Mode: " << (query.value(0)).toString() << endl;
return QString();
}
*/
}
else
{
- //qDebug() << "DataBase::getModeNameFromNumber - Not Valid record" << endl;
- //qDebug() << "DataBase::getModeNameFromNumber: ------ END-2" << endl;
+ //qDebug() << "DataBase::getModeNameFromNumber - Not Valid record" << endl;
+ //qDebug() << "DataBase::getModeNameFromNumber: ------ END-2" << endl;
query.finish();
return QString();
}
@@ -1203,7 +1190,7 @@ QString DataBase::getModeNameFromNumber(const int _n, bool _tmp)
QString DataBase::getSubModeNameFromNumber(const int _n, bool _tmp)
{
- //qDebug() << "DataBase::getSubModeNameFromNumber: " << QString::number(_n) << endl;
+ //qDebug() << "DataBase::getSubModeNameFromNumber: " << QString::number(_n) << endl;
QSqlQuery query;
QString queryString;
if (_tmp)
@@ -1218,7 +1205,7 @@ QString DataBase::getSubModeNameFromNumber(const int _n, bool _tmp)
bool sqlOk = query.exec(queryString);
- //qDebug() << "DataBase::getSubModeNameFromNumber - query: " << query.lastQuery() << endl;
+ //qDebug() << "DataBase::getSubModeNameFromNumber - query: " << query.lastQuery() << endl;
if (sqlOk)
{
@@ -1228,19 +1215,19 @@ QString DataBase::getSubModeNameFromNumber(const int _n, bool _tmp)
{
if ( isValidMode((query.value(0)).toString(), _tmp) )
{
- //qDebug() << "DataBase::getSubModeNameFromNumber: RETURN: " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataBase::getSubModeNameFromNumber: RETURN: " << (query.value(0)).toString() << endl;
return (query.value(0)).toString();
}
else
{
- //qDebug() << "DataBase::getSubModeNameFromNumber: NO valid mode - END" << endl;
+ //qDebug() << "DataBase::getSubModeNameFromNumber: NO valid mode - END" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataBase::getSubModeNameFromNumber: query not valid - END" << endl;
+ //qDebug() << "DataBase::getSubModeNameFromNumber: query not valid - END" << endl;
query.finish();
return QString();
}
@@ -1248,7 +1235,7 @@ QString DataBase::getSubModeNameFromNumber(const int _n, bool _tmp)
}
else
{
- //qDebug() << "DataBase::getSubModeNameFromNumber: query not next - END" << endl;
+ //qDebug() << "DataBase::getSubModeNameFromNumber: query not next - END" << endl;
query.finish();
return QString();
}
@@ -1258,18 +1245,18 @@ QString DataBase::getSubModeNameFromNumber(const int _n, bool _tmp)
else
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::getSubModeNameFromNumber: SQL FALSE - END" << endl;
+ //qDebug() << "DataBase::getSubModeNameFromNumber: SQL FALSE - END" << endl;
query.finish();
return QString();
}
- //qDebug() << "DataBase::getSubModeNameFromNumber: - END-X" << endl;
+ //qDebug() << "DataBase::getSubModeNameFromNumber: - END-X" << endl;
//query.finish();
//return QString();
}
bool DataBase::isValidBand (const QString &b)
{
- //qDebug() << "DataBase::isValidBand: " << b << endl;
+ //qDebug() << "DataBase::isValidBand: " << b << endl;
if (b.length()<1)
{
return false;
@@ -1302,11 +1289,11 @@ bool DataBase::isValidBand (const QString &b)
bool DataBase::isValidMode (const QString &b, const bool _tmp)
{
- //qDebug() << "DataBase::isValidMode: " << b << endl;
+ //qDebug() << "DataBase::isValidMode: " << b << endl;
QString stringQuery;
if (b.length()<2)
{
- //qDebug() << "DataBase::isValidMode: (length<2) FALSE" << endl;
+ //qDebug() << "DataBase::isValidMode: (length<2) FALSE" << endl;
return false;
}
@@ -1334,20 +1321,20 @@ bool DataBase::isValidMode (const QString &b, const bool _tmp)
bool DataBase::isValidBandNumber (const int b)
{
- //qDebug() << "DataBase::isValidBandNumber: " << QString::number(b)<< endl;
+ //qDebug() << "DataBase::isValidBandNumber: " << QString::number(b)<< endl;
return isValidBand(getBandNameFromNumber(b));
}
bool DataBase::isValidModeNumber (const int b)
{
- //qDebug() << "DataBase::isValidModeNumber: " << QString::number(b)<< endl;
+ //qDebug() << "DataBase::isValidModeNumber: " << QString::number(b)<< endl;
return isValidMode(getModeNameFromNumber(b, false), false);
}
int DataBase::getBandIdFromFreq(const QString &fr)
{
- //qDebug() << "DataBase::getBandIdFromFreq: " << fr << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: " << fr << endl;
//Freq should be in MHz
QString queryString = QString("SELECT id FROM band WHERE lower <= '%1' and upper >= '%2'").arg(fr).arg(fr);
@@ -1355,37 +1342,37 @@ int DataBase::getBandIdFromFreq(const QString &fr)
bool sqlOK = query.exec(queryString);
- //qDebug() << "DataBase::getBandIdFromFreq: Query: " << query.lastQuery() << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: Query: " << query.lastQuery() << endl;
if (sqlOK)
{
- //qDebug() << "DataBase::getBandIdFromFreq: Query OK" << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: Query OK" << endl;
query.next();
if (query.isValid())
{
- //qDebug() << "DataBase::getBandIdFromFreq: Query OK - END" << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: Query OK - END" << endl;
return (query.value(0)).toInt();
}
else
{
- //qDebug() << "DataBase::getBandIdFromFreq: Valid NOK - END" << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: Valid NOK - END" << endl;
query.finish();
return -1;
}
}
else
{
- //qDebug() << "DataBase::getBandIdFromFreq: Query NOK" << endl;
- //qDebug() << "DataBase::getBandIdFromFreq: Query NOK: " << query.lastError().text() << endl;
- //qDebug() << "DataBase::getBandIdFromFreq: Query NOK: " << query.lastError().nativeErrorCode() << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: Query NOK" << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: Query NOK: " << query.lastError().text() << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: Query NOK: " << query.lastError().nativeErrorCode() << endl;
if (query.lastError().isValid())
{
- //qDebug() << "DataBase::getBandIdFromFreq: Query NOK - Error VALID" << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: Query NOK - Error VALID" << endl;
}
else
{
- //qDebug() << "DataBase::getBandIdFromFreq: Query NOK - Error NOT-VALID" << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: Query NOK - Error NOT-VALID" << endl;
}
@@ -1394,7 +1381,7 @@ int DataBase::getBandIdFromFreq(const QString &fr)
query.finish();
return -2;
}
- //qDebug() << "DataBase::getBandIdFromFreq: END-X" << endl;
+ //qDebug() << "DataBase::getBandIdFromFreq: END-X" << endl;
//query.finish();
//return -3;
}
@@ -1402,28 +1389,28 @@ int DataBase::getBandIdFromFreq(const QString &fr)
bool DataBase::isThisFreqInBand(const QString &b, const QString &fr)
{//Freq should be in MHz
- //qDebug() << "DataBase::isThisFreqInBand: " << b << "/" << fr << endl;
+ //qDebug() << "DataBase::isThisFreqInBand: " << b << "/" << fr << endl;
int bandNf = getBandIdFromFreq(fr);
int bandN = getBandIDFromName2(b);
- //qDebug() << "DataBase::isThisFreqInBand: (b/f)" << QString::number(bandN) << "/" << QString::number(bandNf) << endl;
+ //qDebug() << "DataBase::isThisFreqInBand: (b/f)" << QString::number(bandN) << "/" << QString::number(bandNf) << endl;
if (bandNf == bandN)
{
- //qDebug() << "DataBase::isThisFreqInBand: OK " << b << "/" << fr << endl;
+ //qDebug() << "DataBase::isThisFreqInBand: OK " << b << "/" << fr << endl;
return true;
}
else
{
- //qDebug() << "DataBase::isThisFreqInBand: NOK " << b << "/" << fr << endl;
+ //qDebug() << "DataBase::isThisFreqInBand: NOK " << b << "/" << fr << endl;
return false;
}
- //qDebug() << "DataBase::isThisFreqInBand: END" << endl;
+ //qDebug() << "DataBase::isThisFreqInBand: END" << endl;
//return false;
}
bool DataBase::unMarkAllQSO()
{
- //qDebug() << "DataBase::unMarkAllQSO" << endl;
+ //qDebug() << "DataBase::unMarkAllQSO" << endl;
QString stringQuery = QString("UPDATE log SET marked = 'N' WHERE 1");
return execQuery(Q_FUNC_INFO, stringQuery);
}
@@ -1432,7 +1419,7 @@ bool DataBase::unMarkAllQSO()
bool DataBase::updateIfNeeded()
{
- //qDebug() << "DataBase::updateIfNeeded - Version: " << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateIfNeeded - Version: " << QString::number(dbVersion) << endl;
/**************************************************************************************
@@ -1469,7 +1456,7 @@ bool DataBase::updateIfNeeded()
//latestReaded = (query.value(0)).toFloat();
query.finish();
- //qDebug() << "DataBase::updateIfNeeded - LatestReaded: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateIfNeeded - LatestReaded: " << QString::number(latestReaded) << endl;
@@ -1477,16 +1464,16 @@ bool DataBase::updateIfNeeded()
if (latestReaded >= dbVersion)
{ // DB is updated, no update is needed
- //qDebug() << "DataBase::updateIfNeeded - DB updated (no need to update anything!) " << endl;
+ //qDebug() << "DataBase::updateIfNeeded - DB updated (no need to update anything!) " << endl;
//toBeUpdated = false;
- //qDebug() << "DataBase::updateIfNeeded - TRUE - END " << endl;
+ //qDebug() << "DataBase::updateIfNeeded - TRUE - END " << endl;
return true;
}
else
{ // DB is outdated. We need to update!!
- //qDebug() << "DataBase::updateIfNeeded - DB outdated... upgrade starts now! " << endl;
+ //qDebug() << "DataBase::updateIfNeeded - DB outdated... upgrade starts now! " << endl;
QMessageBox msgBox;
msgBox.setWindowTitle("KLog");
@@ -1512,7 +1499,7 @@ bool DataBase::updateIfNeeded()
break;
default:
// should never be reached
- //qDebug() << "DataBase::updateIfNeeded - FALSE - CHECK IF SEEN, shoud not be here! - END " << endl;
+ //qDebug() << "DataBase::updateIfNeeded - FALSE - CHECK IF SEEN, shoud not be here! - END " << endl;
return false;
//break;
}
@@ -1520,7 +1507,7 @@ bool DataBase::updateIfNeeded()
// If the DB needs to be updated... we update it! :-)
- //qDebug() << "DataBase::updateIfNeeded - END!" << endl;
+ //qDebug() << "DataBase::updateIfNeeded - END!" << endl;
return true;
}
@@ -1536,7 +1523,7 @@ bool DataBase::createTheBandQuickReference()
*/
- //qDebug() << "DataBase::createTheBandQuickReference: " << endl;
+ //qDebug() << "DataBase::createTheBandQuickReference: " << endl;
QString st = "NULL";
int in = 0;
@@ -1567,11 +1554,11 @@ bool DataBase::createTheBandQuickReference()
IDBandHash.insert(in, st);
freqBandIdHash.insert(in, fr);
- //qDebug() << "DataBase::createTheBandQuickReference: " << st <<"/" << QString::number(in)<< endl;
+ //qDebug() << "DataBase::createTheBandQuickReference: " << st <<"/" << QString::number(in)<< endl;
}
else
{
- //qDebug() << "DataBase::createTheBandQuickReference: Query not valid -'RETURN FALSE - END" << endl;
+ //qDebug() << "DataBase::createTheBandQuickReference: Query not valid -'RETURN FALSE - END" << endl;
// QMessageBox::warning(0, QObject::tr("Database Error (DataBase::createTheBandQuickReference)"),
// query.lastError().text());
@@ -1580,10 +1567,10 @@ bool DataBase::createTheBandQuickReference()
//TODO: Manage this error, in case the query is NOK.
}
- //qDebug() << "DataBase::createTheBandQuickReference: Go for the next one!" << endl;
+ //qDebug() << "DataBase::createTheBandQuickReference: Go for the next one!" << endl;
}
query.finish();
- //qDebug() << "DataBase::createTheBandQuickReference: END" << endl;
+ //qDebug() << "DataBase::createTheBandQuickReference: END" << endl;
return true;
}
@@ -1597,7 +1584,7 @@ bool DataBase::createTheModeQuickReference()
QHash IDModeHash
*/
- //qDebug() << "DataBase::createTheModeQuickReference: " << endl;
+ //qDebug() << "DataBase::createTheModeQuickReference: " << endl;
if (getDBVersion().toFloat()<0.010)
{
@@ -1636,11 +1623,11 @@ bool DataBase::createTheModeQuickReference()
IDModeHash.insert(in, st);
subModeIDHash.insert(sm, in );
IDSubModeHash.insert(in, sm);
- //qDebug() << "DataBase::createTheModeQuickReference: " << st <<"/" << QString::number(in)<< endl;
+ //qDebug() << "DataBase::createTheModeQuickReference: " << st <<"/" << QString::number(in)<< endl;
}
else
{
- //qDebug() << "DataBase::createTheModeQuickReference: Query not valid - END" << endl;
+ //qDebug() << "DataBase::createTheModeQuickReference: Query not valid - END" << endl;
//QMessageBox::warning(0, QObject::tr("Database Error (DataBase::createTheModeQuickReference)"),
// query.lastError().text());
@@ -1651,7 +1638,7 @@ bool DataBase::createTheModeQuickReference()
}
}
query.finish();
- //qDebug() << "DataBase::createTheModeQuickReference: END" << endl;
+ //qDebug() << "DataBase::createTheModeQuickReference: END" << endl;
return true;
}
@@ -1667,10 +1654,10 @@ int DataBase::getBandIDFromName2(const QString &b)
QHash IDModeHash
*/
- //qDebug() << "DataBase::getBandIDFromName2: " << b << endl;
- //qDebug() << "DataBase::getBandIDFromName2: This line should be the last one... " << endl;
+ //qDebug() << "DataBase::getBandIDFromName2: " << b << endl;
+ //qDebug() << "DataBase::getBandIDFromName2: This line should be the last one... " << endl;
return getBandIdFromName(b);
- //qDebug() << "DataBase::getBandIDFromName2: CHECK IF THIS LINE IS SEEN" << endl;
+ //qDebug() << "DataBase::getBandIDFromName2: CHECK IF THIS LINE IS SEEN" << endl;
/*
if (b.length()<1)
@@ -1680,48 +1667,48 @@ int DataBase::getBandIDFromName2(const QString &b)
if (bandIDHash.contains(b))
{
- //qDebug() << "DataBase::getBandIDFromName2: " << b << ":" << bandIDHash.value(b) << endl;
+ //qDebug() << "DataBase::getBandIDFromName2: " << b << ":" << bandIDHash.value(b) << endl;
return bandIDHash.value(b);
}
else
{
- //qDebug() << "DataBase::getBandIDFromName2: Contains - False" << endl;
+ //qDebug() << "DataBase::getBandIDFromName2: Contains - False" << endl;
return -1;
}
- //qDebug() << "DataBase::getBandIDFromName2: Safety exit" << endl;
+ //qDebug() << "DataBase::getBandIDFromName2: Safety exit" << endl;
*/
}
int DataBase::getModeIDFromName2(const QString &b)
{
- //qDebug() << "DataBase::getModeIDFromName2: " << b << endl;
+ //qDebug() << "DataBase::getModeIDFromName2: " << b << endl;
return getModeIdFromSubMode(b);
/*
if (b.length()<2)
{
- //qDebug() << "DataBase::getModeIDFromName2: END -3" << endl;
+ //qDebug() << "DataBase::getModeIDFromName2: END -3" << endl;
return -3;
}
if (modeIDHash.contains(b))
{
- //qDebug() << "DataBase::getModeIDFromName2: END - " << b << ":" << modeIDHash.value(b) << endl;
+ //qDebug() << "DataBase::getModeIDFromName2: END - " << b << ":" << modeIDHash.value(b) << endl;
return modeIDHash.value(b);
}
else
{
- //qDebug() << "DataBase::getModeIDFromName2: Contains - False - END" << endl;
+ //qDebug() << "DataBase::getModeIDFromName2: Contains - False - END" << endl;
return -1;
}
- //qDebug() << "DataBase::getModeIDFromName2: Safety exit - END" << endl;
+ //qDebug() << "DataBase::getModeIDFromName2: Safety exit - END" << endl;
*/
}
int DataBase::getSubModeIDFromName2(const QString &b)
{
- //qDebug() << "DataBase::getSubModeIDFromName2: " << b << endl;
+ //qDebug() << "DataBase::getSubModeIDFromName2: " << b << endl;
return getModeIdFromSubMode(b);
@@ -1730,21 +1717,21 @@ int DataBase::getSubModeIDFromName2(const QString &b)
if (b.length()<2)
{
- //qDebug() << "DataBase::getSubModeIDFromName2: END -3" << endl;
+ //qDebug() << "DataBase::getSubModeIDFromName2: END -3" << endl;
return -3;
}
if (subModeIDHash.contains(b))
{
- //qDebug() << "DataBase::getSubModeIDFromName2: END - " << b << ":" << modeIDHash.value(b) << endl;
+ //qDebug() << "DataBase::getSubModeIDFromName2: END - " << b << ":" << modeIDHash.value(b) << endl;
return subModeIDHash.value(b);
}
else
{
- //qDebug() << "DataBase::getSubModeIDFromName2: Contains - False - END" << endl;
+ //qDebug() << "DataBase::getSubModeIDFromName2: Contains - False - END" << endl;
return -1;
}
- //qDebug() << "DataBase::getSubModeIDFromName2: Safety exit - END" << endl;
+ //qDebug() << "DataBase::getSubModeIDFromName2: Safety exit - END" << endl;
return -2;
*/
@@ -1752,66 +1739,66 @@ int DataBase::getSubModeIDFromName2(const QString &b)
QString DataBase::getBandNameFromID2(const int _i)
{
- //qDebug() << "DataBase::getBandNameFromid2: " << QString::number(_i) << endl;
+ //qDebug() << "DataBase::getBandNameFromid2: " << QString::number(_i) << endl;
return getBandNameFromNumber(_i);
/*
if (IDBandHash.contains(_i))
{
- //qDebug() << "DataBase::getBandNameFromid2: END OK" << endl;
+ //qDebug() << "DataBase::getBandNameFromid2: END OK" << endl;
return IDBandHash.value(_i);
}
else
{
- //qDebug() << "DataBase::getBandNameFromid2: END-1" << endl;
+ //qDebug() << "DataBase::getBandNameFromid2: END-1" << endl;
return "-1";
}
*/
- //qDebug() << "DataBase::getBandNameFromid2: END-2" << endl;
+ //qDebug() << "DataBase::getBandNameFromid2: END-2" << endl;
//return "-2";
}
QString DataBase::getModeNameFromID2(const int _i)
{
- //qDebug() << "DataBase::getModeNameFromId2: " << QString::number(_i) << endl;
+ //qDebug() << "DataBase::getModeNameFromId2: " << QString::number(_i) << endl;
return getSubModeNameFromNumber(_i);
/*
if (IDModeHash.contains(_i))
{
- //qDebug() << "DataBase::getModeNameFromId2: END OK - " << IDModeHash.value(_i) << endl;
+ //qDebug() << "DataBase::getModeNameFromId2: END OK - " << IDModeHash.value(_i) << endl;
return IDModeHash.value(_i);
}
else
{
- //qDebug() << "DataBase::getModeNameFromId2: END-1" << endl;
+ //qDebug() << "DataBase::getModeNameFromId2: END-1" << endl;
return "-1";
}
*/
- //qDebug() << "DataBase::getModeNameFromId2: END-2" << endl;
+ //qDebug() << "DataBase::getModeNameFromId2: END-2" << endl;
//return "-2";
}
QString DataBase::getSubModeNameFromID2(const int _i)
{
- //qDebug() << "DataBase::getSubModeNameFromId2: " << QString::number(_i) << endl;
+ //qDebug() << "DataBase::getSubModeNameFromId2: " << QString::number(_i) << endl;
return getSubModeNameFromNumber(_i);
/*
if (IDSubModeHash.contains(_i))
{
- //qDebug() << "DataBase::getSubModeNameFromId2: END OK - " << IDModeHash.value(_i) << endl;
+ //qDebug() << "DataBase::getSubModeNameFromId2: END OK - " << IDModeHash.value(_i) << endl;
return IDSubModeHash.value(_i);
}
else
{
- //qDebug() << "DataBase::getSubModeNameFromId2: END-1" << endl;
+ //qDebug() << "DataBase::getSubModeNameFromId2: END-1" << endl;
return "-1";
}
- //qDebug() << "DataBase::getSubModeNameFromId2: END-2" << endl;
+ //qDebug() << "DataBase::getSubModeNameFromId2: END-2" << endl;
*/
}
bool DataBase::createBandModeMaps()
{
- //qDebug() << "DataBase::createBandModeMaps" << endl;
+ //qDebug() << "DataBase::createBandModeMaps" << endl;
bool b = false;
bool m = false;
@@ -1822,40 +1809,39 @@ bool DataBase::createBandModeMaps()
b = createTheBandQuickReference();
m = createTheModeQuickReference();
- //qDebug() << "DataBase::createBandModeMaps - isTheDbCreated TRUE" << endl;
+ //qDebug() << "DataBase::createBandModeMaps - isTheDbCreated TRUE" << endl;
return (b && m);
}
else
{
- //qDebug() << "DataBase::createBandModeMaps - isTheDbCreated FALSE" << endl;
+ //qDebug() << "DataBase::createBandModeMaps - isTheDbCreated FALSE" << endl;
return false;
}
//return false;
- //qDebug() << "DataBase::createBandModeMaps END" << endl;
+ //qDebug() << "DataBase::createBandModeMaps END" << endl;
}
QString DataBase::getFreqFromBandId(const int _i)
{
- //qDebug() << "DataBase::getFreqFromBandId" << endl;
+ //qDebug() << "DataBase::getFreqFromBandId" << endl;
if (freqBandIdHash.contains(_i))
{
- //qDebug() << "DataBase::getFreqFromBandId OK END" << endl;
+ //qDebug() << "DataBase::getFreqFromBandId OK END" << endl;
return freqBandIdHash.value(_i);
}
else
{
- //qDebug() << "DataBase::getFreqFromBandId END-1" << endl;
+ //qDebug() << "DataBase::getFreqFromBandId END-1" << endl;
return "-1.0";
}
- //qDebug() << "DataBase::getFreqFromBandId END-2" << endl;
+ //qDebug() << "DataBase::getFreqFromBandId END-2" << endl;
//return "-2.0";
}
-/*
int DataBase::getLogTypeNumber(const QString &_logType)
{
- //qDebug() << "DataBase::getLogTypeNumber: " << _logType << endl;
+ //qDebug() << "DataBase::getLogTypeNumber: " << _logType << endl;
QSqlQuery query;
QString queryString = QString("SELECT id FROM supportedcontests WHERE name='%1'").arg(_logType);
@@ -1883,7 +1869,7 @@ int DataBase::getLogTypeNumber(const QString &_logType)
QString DataBase::getLogTypeName(const int _logType)
{
- //qDebug() << "DataBase::getLogTypeName: " << QString::number(_logType) << endl;
+ //qDebug() << "DataBase::getLogTypeName: " << QString::number(_logType) << endl;
QSqlQuery query;
QString queryString = QString("SELECT name FROM supportedcontests WHERE id='%1'").arg(_logType);
bool sqlOK = query.exec(queryString);
@@ -1906,7 +1892,7 @@ QString DataBase::getLogTypeName(const int _logType)
//query.finish();
//return QString();
}
-*/
+
bool DataBase::updateToLatest()
{
/*
@@ -1915,7 +1901,7 @@ bool DataBase::updateToLatest()
*
*/
- //qDebug() << "DataBase::updateToLatest " << endl;
+ //qDebug() << "DataBase::updateToLatest " << endl;
return updateTo016();
@@ -1933,7 +1919,7 @@ bool DataBase::updateTo003()
* QString stringQuery = QString ("ALTER TABLE award_enumeration ADD COLUMN dxcc INTEGER;");
*
*/
- //qDebug() << "DataBase::updateTo003: latestRead: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo003: latestRead: " << QString::number(latestReaded) << endl;
bool IAmIn003 = false;
bool IAmIn002 = false;
bool ErrorUpdating = false;
@@ -1970,8 +1956,8 @@ bool DataBase::updateTo003()
bool DataBase::updateTo004()
{// Updates the DB to 0.0.4
- //qDebug() << "DataBase::updateTo004: latestRead: " << getDBVersion() << endl;
- //qDebug() << "DataBase::updateTo004: latestRead: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo004: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo004: latestRead: " << QString::number(latestReaded) << endl;
bool IAmIn004 = false;
bool IAmIn003 = false;
bool ErrorUpdating = false;
@@ -1982,21 +1968,21 @@ bool DataBase::updateTo004()
latestReaded = getDBVersion().toFloat();
if (latestReaded >= float(0.004))
{
- //qDebug() << "DataBase::updateTo004: - I am in 004" << endl;
+ //qDebug() << "DataBase::updateTo004: - I am in 004" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateTo004: - I am not in 004" << endl;
+ //qDebug() << "DataBase::updateTo004: - I am not in 004" << endl;
IAmIn004 = false;
}
while (!IAmIn004 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo004: - And I am not in 004 nor ErrorUpdating" << endl;
+ //qDebug() << "DataBase::updateTo004: - And I am not in 004 nor ErrorUpdating" << endl;
while (!IAmIn003 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo004: - And I am not in 003" << endl;
+ //qDebug() << "DataBase::updateTo004: - And I am not in 003" << endl;
//IAmIn002 = updateTo002();
IAmIn003 = true;
}
@@ -2004,32 +1990,32 @@ bool DataBase::updateTo004()
{
return false;
}
- //qDebug() << "DataBase::updateTo004: - And I am in 003" << endl;
+ //qDebug() << "DataBase::updateTo004: - And I am in 003" << endl;
sqlOk = updateDBVersion(softVersion, "0.004");
- //qDebug() << "DataBase::updateTo004: - Update Version" << endl;
+ //qDebug() << "DataBase::updateTo004: - Update Version" << endl;
if (sqlOk)
{ // Version updated
- //qDebug() << "DataBase::updateTo004: - Update OK" << endl;
+ //qDebug() << "DataBase::updateTo004: - Update OK" << endl;
sqlOk = execQuery(Q_FUNC_INFO, "DROP TABLE award_enumeration");
}
else
{ // Version not updated
- //qDebug() << "DataBase::updateTo004: - Update NOK" << endl;
+ //qDebug() << "DataBase::updateTo004: - Update NOK" << endl;
}
//DO ALL THE TASKS TO BE IN 0.004 from 0.003 HERE and set ErrorUpdating if it is not possible.
- //qDebug() << "DataBase::updateTo004: - IAmIn004 = true" << endl;
+ //qDebug() << "DataBase::updateTo004: - IAmIn004 = true" << endl;
IAmIn004 = true;
}
if (IAmIn004)
{
- //qDebug() << "DataBase::updateTo004: - Return... TRUE" << endl;
+ //qDebug() << "DataBase::updateTo004: - Return... TRUE" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo004: - Return... FALSE" << endl;
+ //qDebug() << "DataBase::updateTo004: - Return... FALSE" << endl;
}
- //qDebug() << "DataBase::updateTo004: UPDATED OK!" << endl;
+ //qDebug() << "DataBase::updateTo004: UPDATED OK!" << endl;
return IAmIn004;
}
@@ -2037,7 +2023,7 @@ bool DataBase::updateTo004()
bool DataBase::updateTo005()
{// Updates the DB to 0.0.5
- //qDebug() << "DataBase::updateTo005: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo005: latestRead: " << getDBVersion() << endl;
bool IAmIn005 = false;
bool IAmIn004 = false;
bool ErrorUpdating = false;
@@ -2045,7 +2031,6 @@ bool DataBase::updateTo005()
//QString dateString = (date.currentDateTime()).toString("yyyyMMdd");
QSqlQuery query;
QMessageBox msgBox;
- msgBox.setWindowTitle(QObject::tr("KLog - DB update"));
msgBox.setIcon(QMessageBox::Information);
//int errorCode;
@@ -2054,28 +2039,28 @@ bool DataBase::updateTo005()
if (latestReaded >= float(0.005))
{
- //qDebug() << "DataBase::updateTo005 - Already in 005" << endl;
+ //qDebug() << "DataBase::updateTo005 - Already in 005" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateTo005 - 005 update false" << endl;
+ //qDebug() << "DataBase::updateTo005 - 005 update false" << endl;
IAmIn005 = false;
}
while (!IAmIn005 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo005 - I am not in 005" << endl;
+ //qDebug() << "DataBase::updateTo005 - I am not in 005" << endl;
while (!IAmIn004 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo005 - I am not in 004" << endl;
+ //qDebug() << "DataBase::updateTo005 - I am not in 004" << endl;
IAmIn004 = updateTo004();
}
- //qDebug() << "DataBase::updateTo005 - I am in 004" << endl;
+ //qDebug() << "DataBase::updateTo005 - I am in 004" << endl;
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo005 - 005 update false2" << endl;
+ //qDebug() << "DataBase::updateTo005 - 005 update false2" << endl;
return false;
}
sqlOk = updateDBVersion(softVersion, "0.005");
@@ -2084,7 +2069,7 @@ bool DataBase::updateTo005()
{ // Version updated
if (recreateContestData())
{
- //qDebug() << "DataBase::updateTo005 - recreateContestData OK" << endl;
+ //qDebug() << "DataBase::updateTo005 - recreateContestData OK" << endl;
sqlOk = execQuery(Q_FUNC_INFO, "DROP table logs");
@@ -2092,7 +2077,7 @@ bool DataBase::updateTo005()
if (!sqlOk)
{
//queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::updateTo005 - logs table do not created" << endl;
+ //qDebug() << "DataBase::updateTo005 - logs table do not created" << endl;
}
@@ -2111,7 +2096,7 @@ bool DataBase::updateTo005()
{
//queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
//showError(QObject::tr("QSOs not updated to main log"));
- //qDebug() << "DataBase::updateTo005 - QSOs not updated to main log" << endl;
+ //qDebug() << "DataBase::updateTo005 - QSOs not updated to main log" << endl;
}
QString dateString = (QDate::currentDate()).toString("yyyy/MM/dd");
@@ -2145,8 +2130,8 @@ bool DataBase::updateTo005()
{
//queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
//showError(QObject::tr("New Log not created"));
- //qDebug() << "DataBase::updateTo005 - New Log not created" << endl;
- //qDebug() << "DataBase::clearLog: Log deleted FAILED" << endl;
+ //qDebug() << "DataBase::updateTo005 - New Log not created" << endl;
+ //qDebug() << "DataBase::clearLog: Log deleted FAILED" << endl;
}
}
else
@@ -2158,32 +2143,32 @@ bool DataBase::updateTo005()
}
else
{
- //qDebug() << "DataBase::updateTo005 - recreateContestData FAILED" << endl;
+ //qDebug() << "DataBase::updateTo005 - recreateContestData FAILED" << endl;
ErrorUpdating = true;
}
}
else
{ // Version not updated
- //qDebug() << "DataBase::updateTo005 - 005 update false6" << endl;
+ //qDebug() << "DataBase::updateTo005 - 005 update false6" << endl;
ErrorUpdating = true;
}
}
- //qDebug() << "DataBase::updateTo005 - 005 updated 3" << endl;
+ //qDebug() << "DataBase::updateTo005 - 005 updated 3" << endl;
//TODO: Delete the table and recreate it
if (IAmIn005)
{
- msgBox.setText(QObject::tr("All the data was migrated correctly. You should now go to Setup->Preferences->Logs to check that everything is okay."));
+ msgBox.setText(QObject::tr("All the data was migrated correctly. You should now go to Setup->Preferences->Logs to check that everything is OK."));
msgBox.exec();
}
- //qDebug() << "DataBase::updateTo005 - I am in 005 already!! " << endl;
- //qDebug() << "DataBase::updateTo005: UPDATED OK!" << endl;
+ //qDebug() << "DataBase::updateTo005 - I am in 005 already!! " << endl;
+ //qDebug() << "DataBase::updateTo005: UPDATED OK!" << endl;
return IAmIn005;
}
bool DataBase::recreateSatelliteData()
{
- //qDebug() << "DataBase::recreateSatelliteData" << endl;
+ //qDebug() << "DataBase::recreateSatelliteData" << endl;
QSqlQuery query;
if (isTheTableExisting("satellites"))
@@ -2192,17 +2177,17 @@ bool DataBase::recreateSatelliteData()
{
if (createTableSatellites(true))
{
- //qDebug() << "DataBase::recreateSatelliteData SAT table created" << endl;
+ //qDebug() << "DataBase::recreateSatelliteData SAT table created" << endl;
return populateTableSatellites(true);
}
else
{
- //qDebug() << "DataBase::recreateSatelliteData SAT table NOT created" << endl;
+ //qDebug() << "DataBase::recreateSatelliteData SAT table NOT created" << endl;
}
}
else
{
- //qDebug() << "DataBase::recreateSatelliteData execQuery FAILED" << endl;
+ //qDebug() << "DataBase::recreateSatelliteData execQuery FAILED" << endl;
}
}
@@ -2210,23 +2195,23 @@ bool DataBase::recreateSatelliteData()
{
if (createTableSatellites(true))
{
- //qDebug() << "DataBase::recreateSatelliteData SAT table created" << endl;
+ //qDebug() << "DataBase::recreateSatelliteData SAT table created" << endl;
return populateTableSatellites(true);
}
else
{
- //qDebug() << "DataBase::recreateSatelliteData SAT table NOT created" << endl;
+ //qDebug() << "DataBase::recreateSatelliteData SAT table NOT created" << endl;
}
}
- //qDebug() << "DataBase::recreateSatelliteData END FALSE" << endl;
+ //qDebug() << "DataBase::recreateSatelliteData END FALSE" << endl;
return false;
}
bool DataBase::recreateContestData()
{
- //qDebug() << "DataBase::recreateContestData" << endl;
+ //qDebug() << "DataBase::recreateContestData" << endl;
if (isTheTableExisting("contest"))
{
QSqlQuery query;
@@ -2252,7 +2237,7 @@ bool DataBase::recreateContestData()
bool DataBase::recreateSupportedContest()
{
- //qDebug() << "DataBase::recreateSupportedContest" << endl;
+ //qDebug() << "DataBase::recreateSupportedContest" << endl;
execQuery(Q_FUNC_INFO, "DROP TABLE IF exists supportedcontests");
if (isTheTableExisting("supportedcontests"))
@@ -2262,15 +2247,15 @@ bool DataBase::recreateSupportedContest()
sqlOk = execQuery(Q_FUNC_INFO, "DROP TABLE supportedcontests");
if (sqlOk)
{
- //qDebug() << "DataBase::recreateSupportedContest SQLOK" << endl;
+ //qDebug() << "DataBase::recreateSupportedContest SQLOK" << endl;
if (createTableSupportedContest())
{
- //qDebug() << "DataBase::recreateSupportedContest - createTable OK" << endl;
+ //qDebug() << "DataBase::recreateSupportedContest - createTable OK" << endl;
return populateTableSupportedContest();
}
else
{
- //qDebug() << "DataBase::recreateSupportedContest createTableSupportContest FALSE" << endl;
+ //qDebug() << "DataBase::recreateSupportedContest createTableSupportContest FALSE" << endl;
return false;
}
}
@@ -2283,84 +2268,84 @@ bool DataBase::recreateSupportedContest()
{
if (createTableSupportedContest())
{
- //qDebug() << "DataBase::recreateSupportedContest - createTable OK" << endl;
+ //qDebug() << "DataBase::recreateSupportedContest - createTable OK" << endl;
return populateTableSupportedContest();
}
else
{
- //qDebug() << "DataBase::recreateSupportedContest createTableSupportContest FALSE" << endl;
+ //qDebug() << "DataBase::recreateSupportedContest createTableSupportContest FALSE" << endl;
return false;
}
}
- //qDebug() << "DataBase::recreateSupportedContest - FALSE end" << endl;
+ //qDebug() << "DataBase::recreateSupportedContest - FALSE end" << endl;
return false;
}
bool DataBase::recreatePropModes()
{
- //qDebug() << "DataBase::recreatePropModes" << endl;
+ //qDebug() << "DataBase::recreatePropModes" << endl;
if (isTheTableExisting("prop_mode_enumeration"))
{
- //qDebug() << "DataBase::recreatePropModes: Table Exist" << endl;
+ //qDebug() << "DataBase::recreatePropModes: Table Exist" << endl;
bool sqlOk = false;
sqlOk = execQuery(Q_FUNC_INFO, "DROP TABLE prop_mode_enumeration");
if (sqlOk)
{
- //qDebug() << "DataBase::recreatePropModes SQLOK" << endl;
+ //qDebug() << "DataBase::recreatePropModes SQLOK" << endl;
if (createTablePropModes())
{
- //qDebug() << "DataBase::recreatePropModes - createTable OK" << endl;
+ //qDebug() << "DataBase::recreatePropModes - createTable OK" << endl;
if (populatePropagationModes())
{
- //qDebug() << "DataBase::recreatePropModes - populatePropModes OK" << endl;
+ //qDebug() << "DataBase::recreatePropModes - populatePropModes OK" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::recreatePropModes - populatePropModes NOK" << endl;
+ //qDebug() << "DataBase::recreatePropModes - populatePropModes NOK" << endl;
return false;
}
}
else
{
- //qDebug() << "DataBase::recreatePropModes createTableSupportContest FALSE-1" << endl;
+ //qDebug() << "DataBase::recreatePropModes createTableSupportContest FALSE-1" << endl;
return false;
}
}
else
{
//queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::recreatePropModes - prop_mode_enumeration table has not been dropped" << endl;
- //qDebug() << "DataBase::recreatePropModes : Table creation FAILED" << endl;
+ //qDebug() << "DataBase::recreatePropModes - prop_mode_enumeration table has not been dropped" << endl;
+ //qDebug() << "DataBase::recreatePropModes : Table creation FAILED" << endl;
}
}
else
{
- //qDebug() << "DataBase::recreatePropModes: Table does NOT Exist" << endl;
+ //qDebug() << "DataBase::recreatePropModes: Table does NOT Exist" << endl;
if (createTablePropModes())
{
- //qDebug() << "DataBase::recreatePropModes - createTable OK" << endl;
+ //qDebug() << "DataBase::recreatePropModes - createTable OK" << endl;
if (populatePropagationModes())
{
- //qDebug() << "DataBase::recreatePropModes - populatePropModes OK" << endl;
+ //qDebug() << "DataBase::recreatePropModes - populatePropModes OK" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::recreatePropModes - populatePropModes NOK" << endl;
+ //qDebug() << "DataBase::recreatePropModes - populatePropModes NOK" << endl;
return false;
}
}
else
{
- //qDebug() << "DataBase::recreatePropModes createTableSupportContest FALSE-2" << endl;
+ //qDebug() << "DataBase::recreatePropModes createTableSupportContest FALSE-2" << endl;
}
}
- //qDebug() << "DataBase::recreatePropModes - FALSE end" << endl;
+ //qDebug() << "DataBase::recreatePropModes - FALSE end" << endl;
return false;
}
@@ -2369,18 +2354,18 @@ bool DataBase::createTableLogs(const bool real)
{ // NoTmp = false => TMP data table to operate and be deleted afterwards
//Creating the Sats DB to be able to include satellites to the LOTW
- //qDebug() << "DataBase::createTableLogs" << endl;
+ //qDebug() << "DataBase::createTableLogs" << endl;
QString stringQuery = QString();
//QSqlQuery query;
if (real)
{
- //qDebug() << "DataBase::createTableLogs - logs" << endl;
+ //qDebug() << "DataBase::createTableLogs - logs" << endl;
stringQuery = "CREATE TABLE logs" ;
}
else
{
- //qDebug() << "DataBase::createTableLogs - logstemp" << endl;
+ //qDebug() << "DataBase::createTableLogs - logstemp" << endl;
stringQuery = "CREATE TABLE logstemp" ;
}
@@ -2396,7 +2381,7 @@ bool DataBase::createTableLogs(const bool real)
- //qDebug() << "DataBase::createTableLogs - END" << endl;
+ //qDebug() << "DataBase::createTableLogs - END" << endl;
return execQuery(Q_FUNC_INFO, stringQuery);
@@ -2406,7 +2391,7 @@ bool DataBase::createTableLogs(const bool real)
bool DataBase::createTablePropModes()
{
- //qDebug() << "DataBase::createTablePropModes" << endl;
+ //qDebug() << "DataBase::createTablePropModes" << endl;
execQuery(Q_FUNC_INFO, "DROP TABLE IF exists prop_mode_enumeration");
return execQuery(Q_FUNC_INFO, "CREATE TABLE prop_mode_enumeration (id INTEGER PRIMARY KEY AUTOINCREMENT, shortname VARCHAR(8), name VARCHAR(55) )");
@@ -2415,7 +2400,7 @@ bool DataBase::createTablePropModes()
bool DataBase::createTableSupportedContest()
{
- //qDebug() << "DataBase::createTableSupportedContest" << endl;
+ //qDebug() << "DataBase::createTableSupportedContest" << endl;
execQuery(Q_FUNC_INFO, "DROP TABLE IF exists supportedcontests");
@@ -2428,7 +2413,7 @@ bool DataBase::createTableSupportedContest()
bool DataBase::createTableContest()
{
- //qDebug() << "DataBase::createTableContest" << endl;
+ //qDebug() << "DataBase::createTableContest" << endl;
//QSqlQuery query;
createTableSupportedContest();
@@ -2509,14 +2494,14 @@ bool DataBase::createTableContest()
execQuery(Q_FUNC_INFO, "INSERT INTO contestcatmode (id, name) VALUES ('2', 'CW')");
execQuery(Q_FUNC_INFO, "INSERT INTO contestcatmode (id, name) VALUES ('3', 'MIXED')");
- //qDebug() << "DataBase::createTableContest END" << endl;
+ //qDebug() << "DataBase::createTableContest END" << endl;
return true;
}
bool DataBase::populateTableSupportedContest()
{
- //qDebug() << "DataBase::populateTableSupportedContest" << endl;
+ //qDebug() << "DataBase::populateTableSupportedContest" << endl;
// ADDING ALL THE CATEGORIES OPTIONS
return execQuery(Q_FUNC_INFO, "INSERT INTO supportedcontests (id, longname, name) VALUES ('0', 'Normal log', 'DX')");
@@ -2545,7 +2530,7 @@ bool DataBase::populateTableQSL_Via_enumeration()
bool DataBase::createTableMode(const bool NoTmp)
{ // NoTmp = false => TMP data table to operate and be deleted afterwards
- //qDebug() << "DataBase::createTableMode" << endl;
+ //qDebug() << "DataBase::createTableMode" << endl;
QString stringQuery = QString();
QSqlQuery query;
if (NoTmp)
@@ -2563,7 +2548,7 @@ bool DataBase::createTableMode(const bool NoTmp)
"submode VARCHAR(40) NOT NULL, "
"deprecated VARCHAR(1) NOT NULL)");
- //qDebug() << "DataBase::createTableMode END" << endl;
+ //qDebug() << "DataBase::createTableMode END" << endl;
return execQuery(Q_FUNC_INFO, stringQuery);
@@ -2571,7 +2556,7 @@ bool DataBase::createTableMode(const bool NoTmp)
bool DataBase::populateTableMode(const bool NoTmp)
{
- //qDebug() << "DataBase::populateTableMode" << endl;
+ //qDebug() << "DataBase::populateTableMode" << endl;
//QSqlQuery query;
QString tableName = QString();
QString squery = QString();
@@ -2591,13 +2576,13 @@ bool DataBase::populateTableMode(const bool NoTmp)
if (!sqlOK)
{
//queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::populateTableMode: Mode table population FAILED" << endl;
+ //qDebug() << "DataBase::populateTableMode: Mode table population FAILED" << endl;
//errorCode = query.lastError().number();
}
else
{
- //qDebug() << "DataBase::populateTableMode: Mode table population OK" << endl;
+ //qDebug() << "DataBase::populateTableMode: Mode table population OK" << endl;
}
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (submode, name, cabrillo, deprecated) VALUES ('ARDOP', 'ARDOP', 'NO', '0')").arg(tableName));
@@ -2748,7 +2733,7 @@ bool DataBase::populateTableMode(const bool NoTmp)
createTheModeQuickReference();
- //qDebug() << "DataBase::populateTableMode END" << endl;
+ //qDebug() << "DataBase::populateTableMode END" << endl;
return true;
}
@@ -2757,7 +2742,7 @@ bool DataBase::createTableSatellites(const bool NoTmp)
{ // NoTmp = false => TMP data table to operate and be deleted afterwards
//Creating the Sats DB to be able to include satellites to the LOTW
- //qDebug() << "DataBase::createTableSatellites" << endl;
+ //qDebug() << "DataBase::createTableSatellites" << endl;
// The satmode column has the following format: {Up/down-mode;Up/down-mode}
// this way we can implement several freqs/modes per sat
@@ -2814,7 +2799,7 @@ bool DataBase::createTableSatellites(const bool NoTmp)
}
*/
- //qDebug() << "DataBase::createTableSatellites END" << endl;
+ //qDebug() << "DataBase::createTableSatellites END" << endl;
//return sqlOK;
}
@@ -2823,7 +2808,7 @@ bool DataBase::populateTableSatellites(const bool NoTmp)
{
// Data must come from:
// https://lotw.arrl.org/lotw-help/frequently-asked-questions/#sats
- //qDebug() << "DataBase::populateTableSatellites" << endl;
+ //qDebug() << "DataBase::populateTableSatellites" << endl;
//QSqlQuery query;
QString tableName = QString();
@@ -2877,10 +2862,10 @@ bool DataBase::populateTableSatellites(const bool NoTmp)
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('IO-86', 'Indonesia OSCAR 86 (LAPAN-ORARI)', '435.880', '145.880', 'FM')").arg(tableName));
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('LO-19', 'Lusat-OSCAR 19', '145.840-145.900', '437.125-437.150', 'CW')").arg(tableName));
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('LO-78', 'LituanicaSAT-1', '145.95,145.85', '435.1755,437.543', 'FM,PKT')").arg(tableName));
- execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('LO-87', 'LUSEX-OSCAR 87', '435.935-435.965', '145.935-145.965', 'LSB/USB')").arg(tableName));
+ execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('LO-87', 'LUSEX-OSCAR 87', '435.935-435.965', '145.935-145.965' 'LSB/USB')").arg(tableName));
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('MIREX', 'Mir packet digipeater', '145.985', '145.985', 'PKT')").arg(tableName));
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('NO-44', 'Navy-OSCAR 44', '145.827', '145.827', 'PKT')").arg(tableName));
- execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('NO-83', 'BRICsat','145.825,28.120', '145.825,435.975', 'PKT,PSK31')").arg(tableName));
+ execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('NO-83', 'BRICsat','145.825,28.120', '145.825,435.975' 'PKT,PSK31')").arg(tableName));
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('NO-84', 'PSAT', '145.825,28.120', '435.350', 'PKT,PSK31')").arg(tableName));
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('RS-1', 'Radio Sputnik 1', '145', '29', '')").arg(tableName));
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('RS-10', 'Radio Sputnik 10', '','29.357,29.403', '')").arg(tableName));
@@ -2914,13 +2899,13 @@ bool DataBase::populateTableSatellites(const bool NoTmp)
execQuery(Q_FUNC_INFO, QString("INSERT INTO %1 (satarrlid, satname, uplink, downlink, satmode) VALUES ('QO-100', 'Es''hail-2', '2400.050-2409.500', '10489.550-10499.000', 'SSB,CW')").arg(tableName));
- //qDebug() << "DataBase::populateTableSatellites - END" << endl;
+ //qDebug() << "DataBase::populateTableSatellites - END" << endl;
return true;
}
bool DataBase::createTableEntity(const bool NoTmp)
{ // NoTmp = false => TMP data table to operate and be deleted afterwards
- //qDebug() << "DataBase::createTableEntity" << endl;
+ //qDebug() << "DataBase::createTableEntity" << endl;
QString stringQuery = QString();
//QSqlQuery query;
@@ -2950,7 +2935,7 @@ bool DataBase::createTableEntity(const bool NoTmp)
"UNIQUE (dxcc, mainprefix), "
"FOREIGN KEY (continent) REFERENCES continent(shortname) )");
- //qDebug() << "DataBase::createTableEntity END" << endl;
+ //qDebug() << "DataBase::createTableEntity END" << endl;
return execQuery(Q_FUNC_INFO, stringQuery);
@@ -2962,7 +2947,7 @@ bool DataBase::createTableEntity(const bool NoTmp)
bool DataBase::createTableBand(const bool NoTmp)
{ // NoTmp = false => TMP data table to operate and be deleted afterwards
- //qDebug() << "DataBase::createTableBand" << endl;
+ //qDebug() << "DataBase::createTableBand" << endl;
QString stringQuery = QString();
//QSqlQuery query;
if (NoTmp)
@@ -2981,7 +2966,7 @@ bool DataBase::createTableBand(const bool NoTmp)
"name VARCHAR(40) NOT NULL, "
"UNIQUE (lower, upper, cabrillo, name) )");
- //qDebug() << "DataBase::createTableBand END" << endl;
+ //qDebug() << "DataBase::createTableBand END" << endl;
return execQuery(Q_FUNC_INFO, stringQuery);
}
@@ -2992,7 +2977,7 @@ bool DataBase::populateTableBand(const bool NoTmp)
{
// Cabrillo definition: http://wwrof.org/cabrillo/cabrillo-specification-v3/
- //qDebug() << "DataBase::populateTableBand" << endl;
+ //qDebug() << "DataBase::populateTableBand" << endl;
QString tableName = QString();
@@ -3042,7 +3027,7 @@ bool DataBase::populateTableBand(const bool NoTmp)
createTheBandQuickReference();
- //qDebug() << "DataBase::populateTableBand END" << endl;
+ //qDebug() << "DataBase::populateTableBand END" << endl;
return true;
}
@@ -3050,7 +3035,7 @@ bool DataBase::populateTableBand(const bool NoTmp)
bool DataBase::populatePropagationModes()
{
- //qDebug() << "DataBase::populatePropagationModes" << endl;
+ //qDebug() << "DataBase::populatePropagationModes" << endl;
//QSqlQuery query;
execQuery(Q_FUNC_INFO, QString("INSERT INTO prop_mode_enumeration (shortname, name) VALUES ('AS', 'Aircraft Scatter')"));
@@ -3072,14 +3057,14 @@ bool DataBase::populatePropagationModes()
execQuery(Q_FUNC_INFO, QString("INSERT INTO prop_mode_enumeration (shortname, name) VALUES ('TEP', 'Trans-equatorial')"));
execQuery(Q_FUNC_INFO, QString("INSERT INTO prop_mode_enumeration (shortname, name) VALUES ('TR', 'Tropospheric ducting')"));
- //qDebug() << "DataBase::populatePropagationModes END" << endl;
+ //qDebug() << "DataBase::populatePropagationModes END" << endl;
return true;
}
bool DataBase::populateContestData()
{
- //qDebug() << "DataBase::populateContestData" << endl;
+ //qDebug() << "DataBase::populateContestData" << endl;
@@ -3140,13 +3125,13 @@ bool DataBase::populateContestData()
// CQ WW DX SSB END
*/
- //qDebug() << "DataBase::populateContestData END" << endl;
+ //qDebug() << "DataBase::populateContestData END" << endl;
return true;
}
bool DataBase::howManyQSOsInLog(const int i)
{
- //qDebug() << "DataBase::howManyQSOsInLog" << endl;
+ //qDebug() << "DataBase::howManyQSOsInLog" << endl;
QSqlQuery query;
QString sqlQueryString = QString("SELECT COUNT(id) from log WHERE lognumber='%1'").arg(i);
@@ -3157,12 +3142,12 @@ bool DataBase::howManyQSOsInLog(const int i)
query.next();
if (query.isValid())
{
- //qDebug() << "DataBase::howManyQSOsInLog OK END" << endl;
+ //qDebug() << "DataBase::howManyQSOsInLog OK END" << endl;
return (query.value(0)).toInt();
}
else
{
- //qDebug() << "DataBase::howManyQSOsInLog END-1" << endl;
+ //qDebug() << "DataBase::howManyQSOsInLog END-1" << endl;
query.finish();
return false;
}
@@ -3171,7 +3156,7 @@ bool DataBase::howManyQSOsInLog(const int i)
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "DataBase::howManyQSOsInLog END-2" << endl;
+ //qDebug() << "DataBase::howManyQSOsInLog END-2" << endl;
return false;
}
//query.finish();
@@ -3181,7 +3166,7 @@ bool DataBase::howManyQSOsInLog(const int i)
bool DataBase::updateTo006()
{// Updates the DB to 0.0.6
- //qDebug() << "DataBase::updateTo006: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo006: latestRead: " << getDBVersion() << endl;
bool IAmIn006 = false;
bool IAmIn005 = false;
bool ErrorUpdating = false;
@@ -3201,16 +3186,16 @@ bool DataBase::updateTo006()
while (!IAmIn006 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo006: - Still not in 006" << endl;
+ //qDebug() << "DataBase::updateTo006: - Still not in 006" << endl;
while (!IAmIn005 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo006: - And still not in 005" << endl;
+ //qDebug() << "DataBase::updateTo006: - And still not in 005" << endl;
IAmIn005 = updateTo005();
}
- //qDebug() << "DataBase::updateTo006: - Already in 005" << endl;
+ //qDebug() << "DataBase::updateTo006: - Already in 005" << endl;
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(0)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(0)" << endl;
return false;
}
@@ -3218,31 +3203,31 @@ bool DataBase::updateTo006()
if(sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - DB Updated" << endl;
+ //qDebug() << "DataBase::updateTo006: - DB Updated" << endl;
sqlOk = recreatePropModes();
if(sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - recreatePropModes OK" << endl;
+ //qDebug() << "DataBase::updateTo006: - recreatePropModes OK" << endl;
sqlOk = updateTableLog(6); // We copy the log into logtemp
}
else
{
- //qDebug() << "DataBase::updateTo006: - recreatePropModes NOK" << endl;
+ //qDebug() << "DataBase::updateTo006: - recreatePropModes NOK" << endl;
ErrorUpdating = true;
IAmIn006 = false;
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(1)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(1)" << endl;
return false;
}
sqlOk = createTableBand(false); // We create the bandTemp
if (sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - createTableBand OK" << endl;
+ //qDebug() << "DataBase::updateTo006: - createTableBand OK" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(2)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(2)" << endl;
ErrorUpdating = true;
//return false;
}
@@ -3250,44 +3235,44 @@ bool DataBase::updateTo006()
sqlOk = populateTableBand(false); // Populate the bandTemp
if (sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - populateTableBand OK" << endl;
+ //qDebug() << "DataBase::updateTo006: - populateTableBand OK" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(3)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(3)" << endl;
ErrorUpdating = true;
}
sqlOk = updateBandIdTableLogToNewOnes();
if (sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - updateBandIdTableLogToNewOnes OK" << endl;
+ //qDebug() << "DataBase::updateTo006: - updateBandIdTableLogToNewOnes OK" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(4)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(4)" << endl;
ErrorUpdating = true;
}
sqlOk = updateBandIdTableAward(1); // DXCC
if (sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - updateBandIdTableAward 1 OK" << endl;
+ //qDebug() << "DataBase::updateTo006: - updateBandIdTableAward 1 OK" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(5)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(5)" << endl;
ErrorUpdating = true;
}
sqlOk = updateBandIdTableAward(2); // WAZ
if (sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - updateBandIdTableAward 2 OK" << endl;
+ //qDebug() << "DataBase::updateTo006: - updateBandIdTableAward 2 OK" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(6)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(6)" << endl;
ErrorUpdating = true;
}
@@ -3296,79 +3281,79 @@ bool DataBase::updateTo006()
{
if (execQuery(Q_FUNC_INFO, "ALTER TABLE bandtemp RENAME TO band"))
{
- //qDebug() << "DataBase::updateTo006 - bandtemp renamed" << endl;
+ //qDebug() << "DataBase::updateTo006 - bandtemp renamed" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo006 - ERROR - bandtemp not renamed" << endl;
+ //qDebug() << "DataBase::updateTo006 - ERROR - bandtemp not renamed" << endl;
ErrorUpdating = true;
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(7)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(7)" << endl;
}
}
else
{
- //qDebug() << "DataBase::updateTo006 - ERROR - bandtemp not dropped" << endl;
+ //qDebug() << "DataBase::updateTo006 - ERROR - bandtemp not dropped" << endl;
ErrorUpdating = true;
IAmIn006 = false;
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(8)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(8)" << endl;
ErrorUpdating = true;
}
sqlOk = updateTheModeTableAndSyncLog();
if (sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - updateTheModeTableAndSyncLog OK" << endl;
+ //qDebug() << "DataBase::updateTo006: - updateTheModeTableAndSyncLog OK" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(9)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(9)" << endl;
ErrorUpdating = true;
}
sqlOk = createTableClubLogStatus();
if (sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - createTableClubLogStatus OK" << endl;
+ //qDebug() << "DataBase::updateTo006: - createTableClubLogStatus OK" << endl;
sqlOk = populateTableClubLogStatus();
if (sqlOk)
{
- //qDebug() << "DataBase::updateTo006: - populateTableClubLogStatus OK" << endl;
+ //qDebug() << "DataBase::updateTo006: - populateTableClubLogStatus OK" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(10)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(10)" << endl;
ErrorUpdating = true;
}
}
else
{
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(11)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(11)" << endl;
ErrorUpdating = true;
}
}
else
{// Version not updated
- //qDebug() << "DataBase::updateTo006: - DB NOT Updated" << endl;
+ //qDebug() << "DataBase::updateTo006: - DB NOT Updated" << endl;
ErrorUpdating = true;
IAmIn006 = false;
- //qDebug() << "DataBase::updateTo006: UPDATED NOK!(12)" << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED NOK!(12)" << endl;
ErrorUpdating = true;
}
- //qDebug() << "DataBase::updateTo006: - IAmIn006 = TRUE" << endl;
+ //qDebug() << "DataBase::updateTo006: - IAmIn006 = TRUE" << endl;
IAmIn006 = true;
}
//DO ALL THE TASKS TO BE IN 0.006 from 0.005 HERE and set ErrorUpdating if it is not possible.
- //qDebug() << "DataBase::updateTo006 - I am in 006 " << endl;
- //qDebug() << "DataBase::updateTo006 - END " << endl;
- //qDebug() << "DataBase::updateTo006: UPDATED OK!" << endl;
+ //qDebug() << "DataBase::updateTo006 - I am in 006 " << endl;
+ //qDebug() << "DataBase::updateTo006 - END " << endl;
+ //qDebug() << "DataBase::updateTo006: UPDATED OK!" << endl;
return IAmIn006;
}
bool DataBase::updateTableLog(const int _v)
{
- //qDebug() << "DataBase::updateTableLog " << endl;
+ //qDebug() << "DataBase::updateTableLog " << endl;
createTableLog(false);
QString queryString;
switch (_v)
@@ -3378,47 +3363,47 @@ bool DataBase::updateTableLog(const int _v)
queryString = QString ("INSERT INTO logtemp (qso_date, time_on, call, rst_sent, rst_rcvd, bandid, modeid, srx, stx, points, multiplier, cqz, ituz, dxcc, address, age, cnty, comment, a_index, ant_az, ant_el, ant_path, arrl_sect, band_rx, checkcontest, class, contacted_op, contest_id, country, credit_submitted, credit_granted, distance, email, eq_call, eqsl_qslrdate, eqsl_qslsdate, eqsl_qsl_rcvd, eqsl_qsl_sent, force_init, freq, freq_rx, gridsquare, iota, iota_island_id, k_index, lat, lon, lotw_qslrdate, lotw_qslsdate, lotw_qsl_rcvd, lotw_qsl_sent, max_bursts, ms_shower, my_city, my_cnty, my_country, my_cq_zone, my_gridsquare, my_iota, my_iota_island_id, my_lat, my_lon, my_name, my_rig, my_sig, my_sig_info, my_state, my_street, name, notes, nr_bursts, nr_pings, operator, owner_callsign, pfx, precedence, prop_mode, public_key, qslmsg, qslrdate, qslsdate, qsl_rcvd, qsl_sent, qsl_rcvd_via, qsl_sent_via, qsl_via, qso_complete, qso_random, qth, rx_pwr, sat_mode, sat_name, sfi, sig, sig_info, srx_string, stx_string, state, station_callsign, swl, ten_ten, tx_pwr, web, qso_date_off, time_off, transmiterid, marked, lognumber) SELECT qso_date, time_on, call, rst_sent, rst_rcvd, bandid, modeid, srx, stx, points, multiplier, cqz, ituz, dxcc, address, age, cnty, comment, a_index, ant_az, ant_el, ant_path, arrl_sect, band_rx, checkcontest, class, contacted_op, contest_id, country, credit_submitted, credit_granted, distance, email, eq_call, eqsl_qslrdate, eqsl_qslsdate, eqsl_qsl_rcvd, eqsl_qsl_sent, force_init, freq, freq_rx, gridsquare, iota, iota_island_id, k_index, lat, lon, lotw_qslrdate, lotw_qslsdate, lotw_qsl_rcvd, lotw_qsl_sent, max_bursts, ms_shower, my_city, my_cnty, my_country, my_cq_zone, my_gridsquare, my_iota, my_iota_island_id, my_lat, my_lon, my_name, my_rig, my_sig, my_sig_info, my_state, my_street, name, notes, nr_bursts, nr_pings, operator, owner_callsign, pfx, precedence, prop_mode, public_key, qslmsg, qslrdate, qslsdate, qsl_rcvd, qsl_sent, qsl_rcvd_via, qsl_sent_via, qsl_via, qso_complete, qso_random, qth, rx_pwr, sat_mode, sat_name, sfi, sig, sig_info, srx_string, stx_string, state, station_callsign, swl, ten_ten, tx_pwr, web, qso_date_off, time_off, transmiterid, marked, lognumber FROM log");
break;
default:
- //qDebug() << "DataBase::updateTableLog FALSE END" << endl;
+ //qDebug() << "DataBase::updateTableLog FALSE END" << endl;
return false;
//break;
}
if (execQuery(Q_FUNC_INFO, queryString))
{
- //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - Query executed" << endl;
+ //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - Query executed" << endl;
queryString = "DROP TABLE log";
if (execQuery(Q_FUNC_INFO, queryString))
{
- //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - Table log dropped" << endl;
+ //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - Table log dropped" << endl;
queryString = "ALTER TABLE logtemp RENAME TO log" ;
if (execQuery(Q_FUNC_INFO, queryString))
{
- //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - tmp renamed - END" << endl;
+ //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - tmp renamed - END" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - Renaming failed" << endl;
+ //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - Renaming failed" << endl;
}
}
else
{
- //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - Table log Not dropped" << endl;
+ //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - Table log Not dropped" << endl;
}
}
else
{
- //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - query failed" << endl;
+ //qDebug() << "DataBase::updateTableLog: " << QString::number(_v) << " - query failed" << endl;
}
- //qDebug() << "DataBase::updateTableLog END" << endl;
+ //qDebug() << "DataBase::updateTableLog END" << endl;
return false;
}
bool DataBase::createTableClubLogStatus()
{
- //qDebug() << "createTableClubLogStatus" << endl;
+ //qDebug() << "createTableClubLogStatus" << endl;
execQuery(Q_FUNC_INFO, "DROP TABLE IF exists clublog_status");
QString queryString = QString("CREATE TABLE clublog_status ("
@@ -3432,7 +3417,7 @@ bool DataBase::createTableClubLogStatus()
bool DataBase::populateTableClubLogStatus()
{
- //qDebug() << "populateTableClubLogStatus" << endl;
+ //qDebug() << "populateTableClubLogStatus" << endl;
QString queryString = "INSERT INTO clublog_status (shortname, name) VALUES ('Y', 'Uploaded')";
@@ -3443,12 +3428,12 @@ bool DataBase::populateTableClubLogStatus()
if (execQuery(Q_FUNC_INFO, queryString))
{
queryString = "INSERT INTO clublog_status (shortname, name) VALUES ('M', 'Modified')";
- //qDebug() << "populateTableClubLogStatus END" << endl;
+ //qDebug() << "populateTableClubLogStatus END" << endl;
return execQuery(Q_FUNC_INFO, queryString);
}
}
- //qDebug() << "populateTableClubLogStatus FALSE END" << endl;
+ //qDebug() << "populateTableClubLogStatus FALSE END" << endl;
return false;
}
/*
@@ -3460,7 +3445,7 @@ bool DataBase::moveFromModeIdToSubmodeId()
bool DataBase::updateTableEntity()
{
- //qDebug() << "DataBase::updateTableEntity" << endl;
+ //qDebug() << "DataBase::updateTableEntity" << endl;
bool result = false;
QString stringQuery;
bool sqlOk;
@@ -3468,7 +3453,7 @@ bool DataBase::updateTableEntity()
result = createTableEntity(false); // Now we have a temp entity table with the correct format
if (result)
{
- //qDebug() << "DataBase::updateTableEntity: Table entitytemp created!" << endl;
+ //qDebug() << "DataBase::updateTableEntity: Table entitytemp created!" << endl;
// Now we need to move all the data from the old to the temp entity table.
stringQuery = QString("INSERT INTO entitytemp (name, cqz, ituz, continent, latitude, longitude, utc, dxcc, mainprefix, deleted, sincedate, todate) SELECT name, cqz, ituz, continent, latitude, longitude, utc, dxcc, mainprefix, deleted, sincedate, todate FROM entity");
@@ -3477,11 +3462,11 @@ bool DataBase::updateTableEntity()
if (sqlOk)
{
- //qDebug() << "DataBase::updateTableEntity: Data copied from entity to entitytemp!" << endl;
+ //qDebug() << "DataBase::updateTableEntity: Data copied from entity to entitytemp!" << endl;
stringQuery = "DROP TABLE entity";
if (execQuery(Q_FUNC_INFO, stringQuery))
{
- //qDebug() << "DataBase::updateTableEntity: Table entity DELETED" << endl;
+ //qDebug() << "DataBase::updateTableEntity: Table entity DELETED" << endl;
stringQuery = "ALTER TABLE entitytemp RENAME TO entity";
return execQuery(Q_FUNC_INFO, stringQuery);
@@ -3494,7 +3479,7 @@ bool DataBase::updateTableEntity()
}
else
{
- //qDebug() << "DataBase::updateTableEntity: Data NOT copied from entity to entitytemp!" << endl;
+ //qDebug() << "DataBase::updateTableEntity: Data NOT copied from entity to entitytemp!" << endl;
//TODO: If it fails, we should manage errors...
return false;
}
@@ -3502,7 +3487,7 @@ bool DataBase::updateTableEntity()
}
else
{
- //qDebug() << "DataBase::updateTableEntity: Table entitytemp NOT created!" << endl;
+ //qDebug() << "DataBase::updateTableEntity: Table entitytemp NOT created!" << endl;
return false;
}
@@ -3511,7 +3496,7 @@ bool DataBase::updateTableEntity()
bool DataBase::updateTableLogs()
{
- //qDebug() << "DataBase::updateTableLogs" << endl;
+ //qDebug() << "DataBase::updateTableLogs" << endl;
bool result = false;
QString stringQuery;
bool sqlOk;
@@ -3520,7 +3505,7 @@ bool DataBase::updateTableLogs()
if (result)
{
- //qDebug() << "DataBase::updateTableLogs: Table logstemp created!" << endl;
+ //qDebug() << "DataBase::updateTableLogs: Table logstemp created!" << endl;
// Now we need to move all the data from the old to the temp logs table.
stringQuery = QString("INSERT INTO logstemp (logdate, stationcall, comment, logtype, logtypen) SELECT logdate, stationcall, comment, logtype, logtypen FROM logs");
@@ -3529,18 +3514,18 @@ bool DataBase::updateTableLogs()
if (sqlOk)
{
- //qDebug() << "DataBase::updateTableLogs: data copied" << endl;
+ //qDebug() << "DataBase::updateTableLogs: data copied" << endl;
stringQuery = "DROP TABLE logs";
if (execQuery(Q_FUNC_INFO, stringQuery))
{
- //qDebug() << "DataBase::updateTableLogs: Table logs DELETED" << endl;
+ //qDebug() << "DataBase::updateTableLogs: Table logs DELETED" << endl;
stringQuery = "ALTER TABLE logstemp RENAME TO logs";
return execQuery(Q_FUNC_INFO, stringQuery);
}
else
{
- //qDebug() << "DataBase::updateTableLogs: Table logs NOT DELETED" << endl;
+ //qDebug() << "DataBase::updateTableLogs: Table logs NOT DELETED" << endl;
return false;
}
@@ -3548,7 +3533,7 @@ bool DataBase::updateTableLogs()
else
{
//queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::updateTableLogs: data NOT copied" << endl;
+ //qDebug() << "DataBase::updateTableLogs: data NOT copied" << endl;
//TODO: If it fails, we should manage errors...
return false;
}
@@ -3556,11 +3541,11 @@ bool DataBase::updateTableLogs()
}
else
{
- //qDebug() << "DataBase::updateTableLogs: Table logstemp NOT created!" << endl;
+ //qDebug() << "DataBase::updateTableLogs: Table logstemp NOT created!" << endl;
return false;
}
- //qDebug() << "DataBase::updateTableLogs: END" << endl;
+ //qDebug() << "DataBase::updateTableLogs: END" << endl;
//return false;
}
@@ -3572,7 +3557,7 @@ bool DataBase::updateModeIdFromSubModeId()
// STEP-4: Updates the new ID in the QSO in the log
- //qDebug() << "DataBase::updateModeIdFromSubModeId: " << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: " << endl;
bool cancel = false;
bool alreadyCancelled = false;
QString modetxt = QString();
@@ -3599,7 +3584,7 @@ bool DataBase::updateModeIdFromSubModeId()
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "DataBase::updateModeIdFromSubModeId: FALSE END" << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: FALSE END" << endl;
return false;
}
@@ -3633,11 +3618,11 @@ bool DataBase::updateModeIdFromSubModeId()
modeFound = (query.value(0)).toInt();
id = (query.value(1)).toInt();
- //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-1) modeFound (numb): " << QString::number(modeFound) << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-1) modeFound (numb): " << QString::number(modeFound) << endl;
modetxt = getModeNameFromNumber(modeFound, false); //STEP-2
- //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-2) mode found (txt): " << modetxt << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-2) mode found (txt): " << modetxt << endl;
//TODO The following query can be executed in: getModeIdFromSubMode()
@@ -3647,7 +3632,7 @@ bool DataBase::updateModeIdFromSubModeId()
if (sqlOk2)
{
- //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-3) sqlOK2 TRUE" << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-3) sqlOK2 TRUE" << endl;
if (query2.next())
{
if (query2.isValid())
@@ -3660,24 +3645,24 @@ bool DataBase::updateModeIdFromSubModeId()
if (sqlOk3)
{
- //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-4) ID: " << QString::number(id) << " updated to: " << QString::number(modeFound) <<"/"<< modetxt << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-4) ID: " << QString::number(id) << " updated to: " << QString::number(modeFound) <<"/"<< modetxt << endl;
}
else
{
//queryErrorManagement(Q_FUNC_INFO, query3.lastError().databaseText(), query3.lastError().number(), query3.lastQuery());
- //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-4) ID: " << QString::number(id) << " NOT updated-2" << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-4) ID: " << QString::number(id) << " NOT updated-2" << endl;
}
}
else
{
query2.finish();
- //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-3) query2 not valid " << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-3) query2 not valid " << endl;
}
}
else
{
- //qDebug() << "DataBase::updateModeIdFromSubModeId: query2 not next " << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: query2 not next " << endl;
}
}
@@ -3685,7 +3670,7 @@ bool DataBase::updateModeIdFromSubModeId()
{
queryErrorManagement(Q_FUNC_INFO, query2.lastError().databaseText(), query2.lastError().number(), query2.lastQuery());
query2.finish();
- //qDebug() << "DataBase::updateModeIdFromSubModeId: ID: " << QString::number(id) << " NOT updated-1" << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: ID: " << QString::number(id) << " NOT updated-1" << endl;
}
}
@@ -3701,7 +3686,6 @@ bool DataBase::updateModeIdFromSubModeId()
alreadyCancelled = true;
QMessageBox msgBox;
- msgBox.setWindowTitle(QObject::tr("KLog - DB update"));
aux = QObject::tr("Canceling this update will cause data inconsistencies and possibly data loss. Do you still want to cancel?");
msgBox.setText(aux);
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
@@ -3731,12 +3715,12 @@ bool DataBase::updateModeIdFromSubModeId()
query.finish();
if (cancel && (!alreadyCancelled))
{
- //qDebug() << "DataBase::updateModeIdFromSubModeId: FALSE END 2" << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: FALSE END 2" << endl;
query.finish();
return false;
}
- //qDebug() << "DataBase::updateModeIdFromSubModeId: END" << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: END" << endl;
query.finish();
return true;
@@ -3744,11 +3728,11 @@ bool DataBase::updateModeIdFromSubModeId()
else
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::updateModeIdFromSubModeId: FALSE END 3" << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: FALSE END 3" << endl;
query.finish();
return false;
}
- //qDebug() << "DataBase::updateModeIdFromSubModeId: CHECK IF this is seen - END" << endl;
+ //qDebug() << "DataBase::updateModeIdFromSubModeId: CHECK IF this is seen - END" << endl;
//query.finish();
//return false;
}
@@ -3756,7 +3740,7 @@ bool DataBase::updateModeIdFromSubModeId()
bool DataBase::updateBandIdTableLogToNewOnes()
{
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: " << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: " << endl;
QString bandtxt = QString();
@@ -3784,7 +3768,7 @@ bool DataBase::updateBandIdTableLogToNewOnes()
else
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: FALSE END" << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: FALSE END" << endl;
query.finish();
return false;
}
@@ -3820,7 +3804,7 @@ bool DataBase::updateBandIdTableLogToNewOnes()
id = (query.value(1)).toInt();
bandtxt = getBandNameFromNumber(bandFound);
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: band found: " << bandtxt << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: band found: " << bandtxt << endl;
sq = QString("SELECT id FROM bandtemp WHERE name='%1'").arg(bandtxt);
sqlOk2 = query2.exec(sq);
@@ -3838,23 +3822,23 @@ bool DataBase::updateBandIdTableLogToNewOnes()
sqlOk3 = execQuery(Q_FUNC_INFO, sq);
if (sqlOk3)
{
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: ID: " << QString::number(id) << " updated to: " << QString::number(bandFound) <<"/"<< bandtxt << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: ID: " << QString::number(id) << " updated to: " << QString::number(bandFound) <<"/"<< bandtxt << endl;
}
else
{
//queryErrorManagement(Q_FUNC_INFO, query3.lastError().databaseText(), query3.lastError().number(), query3.lastQuery());
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: ID: " << QString::number(id) << " NOT updated-2" << endl;
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes - QSOs not updated to main log" << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: ID: " << QString::number(id) << " NOT updated-2" << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes - QSOs not updated to main log" << endl;
}
}
else
{
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: query2 not valid " << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: query2 not valid " << endl;
}
}
else
{
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: query2 not next " << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: query2 not next " << endl;
}
query2.finish();
@@ -3863,7 +3847,7 @@ bool DataBase::updateBandIdTableLogToNewOnes()
{
queryErrorManagement(Q_FUNC_INFO, query2.lastError().databaseText(), query2.lastError().number(), query2.lastQuery());
query2.finish();
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: ID: " << QString::number(id) << " NOT updated-1" << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: ID: " << QString::number(id) << " NOT updated-1" << endl;
}
}
@@ -3879,7 +3863,6 @@ bool DataBase::updateBandIdTableLogToNewOnes()
alreadyCancelled = true;
QMessageBox msgBox;
- msgBox.setWindowTitle(QObject::tr("KLog - DB update"));
aux = QObject::tr("Canceling this update will cause data inconsistencies and possibly data loss. Do you still want to cancel?");
msgBox.setText(aux);
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
@@ -3908,17 +3891,17 @@ bool DataBase::updateBandIdTableLogToNewOnes()
query.finish();
if (cancel && (!alreadyCancelled))
{
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: FALSE END 2" << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: FALSE END 2" << endl;
return false;
}
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: END OK" << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: END OK" << endl;
return true;
}
else
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: FALSE END 3" << endl;
+ //qDebug() << "DataBase::updateBandIdTableLogToNewOnes: FALSE END 3" << endl;
return false;
}
@@ -3926,7 +3909,7 @@ bool DataBase::updateBandIdTableLogToNewOnes()
bool DataBase::updateBandIdTableAward(const int _db)
{
- //qDebug() << "DataBase::updateBandIdTableAward: " << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: " << endl;
QString table = QString();
QString field = QString();
@@ -3945,7 +3928,7 @@ bool DataBase::updateBandIdTableAward(const int _db)
awardSelected = "WAZ";
break;
default:
- //qDebug() << "DataBase::updateBandIdTableAward: FALSE END" << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: FALSE END" << endl;
return false;
//break;
}
@@ -3982,7 +3965,7 @@ bool DataBase::updateBandIdTableAward(const int _db)
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "DataBase::updateBandIdTableAward: FALSE END-2" << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: FALSE END-2" << endl;
return false;
}
@@ -4021,7 +4004,7 @@ bool DataBase::updateBandIdTableAward(const int _db)
id = (query.value(1)).toInt();
bandtxt = getBandNameFromNumber(bandFound);
- //qDebug() << "DataBase::updateBandIdTableAward: band found: " << bandtxt << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: band found: " << bandtxt << endl;
sq = QString("SELECT id FROM bandtemp WHERE name='%1'").arg(bandtxt);
sqlOk2 = query2.exec(sq);
@@ -4039,24 +4022,24 @@ bool DataBase::updateBandIdTableAward(const int _db)
sqlOk3 = execQuery(Q_FUNC_INFO, sq);
if (sqlOk3)
{
- //qDebug() << "DataBase::updateBandIdTableAward: ID: " << QString::number(id) << " updated to: " << QString::number(bandFound) <<"/"<< bandtxt << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: ID: " << QString::number(id) << " updated to: " << QString::number(bandFound) <<"/"<< bandtxt << endl;
}
else
{
//queryErrorManagement(Q_FUNC_INFO, query3.lastError().databaseText(), query3.lastError().number(), query3.lastQuery());
- //qDebug() << "DataBase::updateBandIdTableAward: ID: " << QString::number(id) << " NOT updated-2" << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: ID: " << QString::number(id) << " NOT updated-2" << endl;
- //qDebug() << "DataBase::updateBandIdTableAward - QSOs not updated to main log" << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward - QSOs not updated to main log" << endl;
}
}
else
{
- //qDebug() << "DataBase::updateBandIdTableAward: query2 not valid " << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: query2 not valid " << endl;
}
}
else
{
- //qDebug() << "DataBase::updateBandIdTableAward: query2 not next " << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: query2 not next " << endl;
}
query2.finish();
@@ -4065,7 +4048,7 @@ bool DataBase::updateBandIdTableAward(const int _db)
{
queryErrorManagement(Q_FUNC_INFO, query2.lastError().databaseText(), query2.lastError().number(), query2.lastQuery());
query2.finish();
- //qDebug() << "DataBase::updateBandIdTableAward: ID: " << QString::number(id) << " NOT updated-1" << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: ID: " << QString::number(id) << " NOT updated-1" << endl;
}
}
@@ -4081,7 +4064,6 @@ bool DataBase::updateBandIdTableAward(const int _db)
alreadyCancelled = true;
QMessageBox msgBox;
- msgBox.setWindowTitle(QObject::tr("KLog - DB update"));
aux = QObject::tr("Canceling this update will cause data inconsistencies and possibly data loss. Do you still want to cancel?");
msgBox.setText(aux);
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
@@ -4108,29 +4090,29 @@ bool DataBase::updateBandIdTableAward(const int _db)
}
if (cancel && (!alreadyCancelled))
{
- //qDebug() << "DataBase::updateBandIdTableAward: FALSE END-3" << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: FALSE END-3" << endl;
query.finish();
return false;
}
- //qDebug() << "DataBase::updateBandIdTableAward: END OK" << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: END OK" << endl;
query.finish();
return true;
}
else
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::updateBandIdTableAward: FALSE END-4" << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: FALSE END-4" << endl;
query.finish();
return false;
}
- //qDebug() << "DataBase::updateBandIdTableAward: CHECK IF SEEN END" << endl;
+ //qDebug() << "DataBase::updateBandIdTableAward: CHECK IF SEEN END" << endl;
//query.finish();
//return false;
}
bool DataBase::updateModeIdTableAward(const int _db)
{
- //qDebug() << "DataBase::updateModeIdTableAward: " << QString::number(_db) << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: " << QString::number(_db) << endl;
QString table = QString();
QString field = "mode";
@@ -4147,7 +4129,7 @@ bool DataBase::updateModeIdTableAward(const int _db)
awardSelected = "WAZ";
break;
default:
- //qDebug() << "DataBase::updateModeIdTableAward: FALSE END" << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: FALSE END" << endl;
return false;
//break;
}
@@ -4183,7 +4165,7 @@ bool DataBase::updateModeIdTableAward(const int _db)
else
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::updateModeIdTableAward: FALSE END-2" << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: FALSE END-2" << endl;
query.finish();
return false;
}
@@ -4200,7 +4182,7 @@ bool DataBase::updateModeIdTableAward(const int _db)
sqlOk = query.exec(sq);
- //qDebug() << "DataBase::updateModeIdTableAward (query): " << query.lastQuery() << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward (query): " << query.lastQuery() << endl;
if (sqlOk)
{
while (query.next() && (!cancel) )
@@ -4222,18 +4204,18 @@ bool DataBase::updateModeIdTableAward(const int _db)
bandFound = (query.value(0)).toInt();
id = (query.value(1)).toInt();
- //qDebug() << "DataBase::updateModeIdTableAward: bandfound: " << QString::number(bandFound) << endl;
- //qDebug() << "DataBase::updateModeIdTableAward: id: " << QString::number(id) << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: bandfound: " << QString::number(bandFound) << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: id: " << QString::number(id) << endl;
bandtxt = getSubModeNameFromNumber(bandFound, true);
- //qDebug() << "DataBase::updateModeIdTableAward: mode found: " << bandtxt << "/" << QString::number(bandFound) << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: mode found: " << bandtxt << "/" << QString::number(bandFound) << endl;
sq = QString("SELECT id FROM modetemp WHERE submode='%1'").arg(bandtxt);
sqlOk2 = query2.exec(sq);
- //qDebug() << "DataBase::updateModeIdTableAward (query2): " << query2.lastQuery() << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward (query2): " << query2.lastQuery() << endl;
if (sqlOk2)
{
if (query2.next())
@@ -4248,25 +4230,25 @@ bool DataBase::updateModeIdTableAward(const int _db)
if (sqlOk3)
{
- //qDebug() << "DataBase::updateModeIdTableAward: ID: " << QString::number(id) << " updated to: " << QString::number(bandFound) <<"/"<< bandtxt << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: ID: " << QString::number(id) << " updated to: " << QString::number(bandFound) <<"/"<< bandtxt << endl;
}
else
{
//queryErrorManagement(Q_FUNC_INFO, query3.lastError().databaseText(), query3.lastError().number(), query3.lastQuery());
- //qDebug() << "DataBase::updateModeIdTableAward: ID: " << QString::number(id) << " NOT updated-2" << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: ID: " << QString::number(id) << " NOT updated-2" << endl;
- //qDebug() << "DataBase::updateModeIdTableAward - QSOs not updated to main log" << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward - QSOs not updated to main log" << endl;
}
}
else
{
- //qDebug() << "DataBase::updateModeIdTableAward: query2 not valid " << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: query2 not valid " << endl;
}
}
else
{
- //qDebug() << "DataBase::updateModeIdTableAward: query2 not next " << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: query2 not next " << endl;
}
}
@@ -4274,7 +4256,7 @@ bool DataBase::updateModeIdTableAward(const int _db)
{
queryErrorManagement(Q_FUNC_INFO, query2.lastError().databaseText(), query2.lastError().number(), query2.lastQuery());
query2.finish();
- //qDebug() << "DataBase::updateModeIdTableAward: ID: " << QString::number(id) << " NOT updated-1" << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: ID: " << QString::number(id) << " NOT updated-1" << endl;
}
}
@@ -4290,7 +4272,6 @@ bool DataBase::updateModeIdTableAward(const int _db)
alreadyCancelled = true;
QMessageBox msgBox;
- msgBox.setWindowTitle(QObject::tr("KLog - DB update"));
aux = QObject::tr("Canceling this update will cause data inconsistencies and possibly data loss. Do you still want to cancel?");
msgBox.setText(aux);
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
@@ -4317,22 +4298,22 @@ bool DataBase::updateModeIdTableAward(const int _db)
}
if (cancel && (!alreadyCancelled))
{
- //qDebug() << "DataBase::updateModeIdTableAward: FALSE END-3" << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: FALSE END-3" << endl;
query.finish();
return false;
}
- //qDebug() << "DataBase::updateModeIdTableAward: END OK" << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: END OK" << endl;
query.finish();
return true;
}
else
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::updateModeIdTableAward: FALSE END-4" << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: FALSE END-4" << endl;
query.finish();
return false;
}
- //qDebug() << "DataBase::updateModeIdTableAward: Checkif seen END" << endl;
+ //qDebug() << "DataBase::updateModeIdTableAward: Checkif seen END" << endl;
//query.finish();
//return false;
}
@@ -4341,7 +4322,7 @@ bool DataBase::updateModeIdTableAward(const int _db)
bool DataBase::updateModeIdTableLogToNewOnes()
{
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: " << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: " << endl;
QString bandtxt = QString();
@@ -4399,7 +4380,7 @@ bool DataBase::updateModeIdTableLogToNewOnes()
id = (query.value(1)).toInt();
bandtxt = getModeNameFromNumber(bandFound, false);
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: mode found: " << bandtxt << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: mode found: " << bandtxt << endl;
sq = QString("SELECT id FROM modetemp WHERE name='%1'").arg(bandtxt);
sqlOk2 = query2.exec(sq);
@@ -4415,36 +4396,36 @@ bool DataBase::updateModeIdTableLogToNewOnes()
sqlOk3 = query3.exec(sq);
if (sqlOk3)
{
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: ID: " << QString::number(id) << " updated to: " << QString::number(bandFound) <<"/"<< bandtxt << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: ID: " << QString::number(id) << " updated to: " << QString::number(bandFound) <<"/"<< bandtxt << endl;
}
else
{
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: ID: " << QString::number(id) << " NOT updated-2" << endl;
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes - QSOs not updated to main log" << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: ID: " << QString::number(id) << " NOT updated-2" << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes - QSOs not updated to main log" << endl;
errorCode = query3.lastError().number();
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes - query error: " << QString::number(errorCode) << endl;
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: LastQuery: " << query3.lastQuery() << endl;
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: LastError-data: " << query3.lastError().databaseText() << endl;
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: LastError-driver: " << query3.lastError().driverText() << endl;
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: LastError-n: " << QString::number(query3.lastError().number() ) << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes - query error: " << QString::number(errorCode) << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: LastQuery: " << query3.lastQuery() << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: LastError-data: " << query3.lastError().databaseText() << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: LastError-driver: " << query3.lastError().driverText() << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: LastError-n: " << QString::number(query3.lastError().number() ) << endl;
}
}
else
{
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: query2 not valid " << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: query2 not valid " << endl;
}
}
else
{
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: query2 not next " << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: query2 not next " << endl;
}
}
else
{
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: ID: " << QString::number(id) << " NOT updated-1" << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: ID: " << QString::number(id) << " NOT updated-1" << endl;
}
}
@@ -4489,7 +4470,7 @@ bool DataBase::updateModeIdTableLogToNewOnes()
{
return false;
}
- //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: FINISHED OK" << endl;
+ //qDebug() << "DataBase::updateModeIdTableLogToNewOnes: FINISHED OK" << endl;
return true;
}
else
@@ -4503,7 +4484,7 @@ bool DataBase::updateModeIdTableLogToNewOnes()
bool DataBase::updateTo007()
{// Updates the DB to 0.0.7
- //qDebug() << "DataBase::updateTo007: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo007: latestRead: " << getDBVersion() << endl;
bool IAmIn007 = false;
bool IAmIn006 = false;
bool ErrorUpdating = false;
@@ -4515,12 +4496,12 @@ bool DataBase::updateTo007()
if (latestReaded >= float(0.007))
{
- //qDebug() << "DataBase::updateTo007: - I am in 007" << endl;
+ //qDebug() << "DataBase::updateTo007: - I am in 007" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateTo007: - I am not in 007" << endl;
+ //qDebug() << "DataBase::updateTo007: - I am not in 007" << endl;
IAmIn007 = false;
}
@@ -4529,15 +4510,15 @@ bool DataBase::updateTo007()
{
while (!IAmIn006 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo007: - And I am not in 006" << endl;
+ //qDebug() << "DataBase::updateTo007: - And I am not in 006" << endl;
IAmIn006 = updateTo006();
}
- //qDebug() << "DataBase::updateTo007: - And I am in 006!!!!" << endl;
+ //qDebug() << "DataBase::updateTo007: - And I am in 006!!!!" << endl;
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo007: NOK-1" << endl;
+ //qDebug() << "DataBase::updateTo007: NOK-1" << endl;
return false;
}
sqlOk = updateDBVersion(softVersion, "0.007");
@@ -4548,13 +4529,13 @@ bool DataBase::updateTo007()
}
else
{ // Version not updated
- //qDebug() << "DataBase::updateTo007: NOK-2" << endl;
+ //qDebug() << "DataBase::updateTo007: NOK-2" << endl;
return false;
}
//DO ALL THE TASKS TO BE IN 0.007 from 0.006 HERE and set ErrorUpdating if it is not possible.
IAmIn007 = true;
}
- //qDebug() << "DataBase::updateTo007: END" << endl;
+ //qDebug() << "DataBase::updateTo007: END" << endl;
return IAmIn007;
}
@@ -4563,7 +4544,7 @@ bool DataBase::updateTo007()
bool DataBase::updateTo008()
{// Updates the DB to 0.0.8
- //qDebug() << "DataBase::updateTo008: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo008: latestRead: " << getDBVersion() << endl;
bool IAmIn008 = false;
bool IAmIn007 = false;
bool ErrorUpdating = false;
@@ -4575,12 +4556,12 @@ bool DataBase::updateTo008()
latestReaded = getDBVersion().toFloat();
if (latestReaded >= (0.008))
{
- //qDebug() << "DataBase::updateTo008: - I am in 008" << endl;
+ //qDebug() << "DataBase::updateTo008: - I am in 008" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateTo008: - I am not in 008" << endl;
+ //qDebug() << "DataBase::updateTo008: - I am not in 008" << endl;
IAmIn008 = false;
}
@@ -4589,14 +4570,14 @@ bool DataBase::updateTo008()
{
while (!IAmIn007 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo008: - And I am not in 007" << endl;
+ //qDebug() << "DataBase::updateTo008: - And I am not in 007" << endl;
IAmIn007 = updateTo007();
}
- //qDebug() << "DataBase::updateTo008: - I am in 007" << endl;
+ //qDebug() << "DataBase::updateTo008: - I am in 007" << endl;
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo008: - NOK-1" << endl;
+ //qDebug() << "DataBase::updateTo008: - NOK-1" << endl;
return false;
}
@@ -4608,22 +4589,22 @@ bool DataBase::updateTo008()
bool sqlOk = updateDBVersion(softVersion, "0.008");
if (sqlOk)
{ // Version updated
- //qDebug() << "DataBase::updateTo008: - OK" << endl;
+ //qDebug() << "DataBase::updateTo008: - OK" << endl;
}
else
{ // Version not updated
- //qDebug() << "DataBase::updateTo008: - NOK-3" << endl;
+ //qDebug() << "DataBase::updateTo008: - NOK-3" << endl;
return false;
}
}
else
{
- //qDebug() << "DataBase::updateTo008: - NOK-2" << endl;
+ //qDebug() << "DataBase::updateTo008: - NOK-2" << endl;
return false;
}
}
- //qDebug() << "DataBase::updateTo008: - END" << endl;
+ //qDebug() << "DataBase::updateTo008: - END" << endl;
return IAmIn008;
}
@@ -4631,7 +4612,7 @@ bool DataBase::updateTo008()
bool DataBase::updateTo009()
{// Updates the DB to 0.0.9 - We add the Satellite tables
- //qDebug() << "DataBase::updateTo009: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo009: latestRead: " << getDBVersion() << endl;
bool IAmIn009 = false;
bool IAmIn008 = false;
bool ErrorUpdating = false;
@@ -4641,30 +4622,30 @@ bool DataBase::updateTo009()
//if (latestReaded >= 0.009)
- //qDebug() << "DataBase::updateTo009: Checking:" << QString::number(latestReaded) << ":" << QString::number(0.009)<< endl;
+ //qDebug() << "DataBase::updateTo009: Checking:" << QString::number(latestReaded) << ":" << QString::number(0.009)<< endl;
latestReaded = getDBVersion().toFloat();
if (latestReaded >= float(0.009))
//if ((latestReaded = 0.009) || (latestReaded > 0.009))
{
- //qDebug() << "DataBase::updateTo009: - I am in 009" << endl;
+ //qDebug() << "DataBase::updateTo009: - I am in 009" << endl;
//IAmIn009 = true;
return true;
}
else
{
- //qDebug() << "DataBase::updateTo009: - I am not in 009 I am in: " << QString::number(latestReaded)<< endl;
+ //qDebug() << "DataBase::updateTo009: - I am not in 009 I am in: " << QString::number(latestReaded)<< endl;
IAmIn009 = false;
}
- //qDebug() << "DataBase::updateTo009: compared latestRead: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo009: compared latestRead: " << QString::number(latestReaded) << endl;
while (!IAmIn009 && !ErrorUpdating)
{
while (!IAmIn008 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo009: - And I am not in 008" << endl;
+ //qDebug() << "DataBase::updateTo009: - And I am not in 008" << endl;
IAmIn008 = updateTo008();
}
- //qDebug() << "DataBase::updateTo009: - And I am already at least in 008" << endl;
+ //qDebug() << "DataBase::updateTo009: - And I am already at least in 008" << endl;
if (ErrorUpdating)
{
return false;
@@ -4673,43 +4654,43 @@ bool DataBase::updateTo009()
if (sqlOk)
{ // Version updated
- //qDebug() << "DataBase::updateTo009: - version updated" << endl;
+ //qDebug() << "DataBase::updateTo009: - version updated" << endl;
//IAmIn009 = updateTableLog(6);
}
else
{ // Version not updated
- //qDebug() << "DataBase::updateTo009: - version not updated" << endl;
+ //qDebug() << "DataBase::updateTo009: - version not updated" << endl;
}
//DO ALL THE TASKS TO BE IN 0.009 from 0.008 HERE and set ErrorUpdating if it is not possible.
if (recreateSatelliteData())
//if (createTableSatellites(true))
{
- //qDebug() << "DataBase::updateTo009: - createTableSatellites OK" << endl;
+ //qDebug() << "DataBase::updateTo009: - createTableSatellites OK" << endl;
//if (populateTableSatellites(true))
if (updateTableEntity())
{
- //qDebug() << "DataBase::updateTo009: - updateTableEntity OK" << endl;
+ //qDebug() << "DataBase::updateTo009: - updateTableEntity OK" << endl;
if (updateTheEntityTableISONames())
{
- //qDebug() << "DataBase::updateTo009: - isonames updated" << endl;
+ //qDebug() << "DataBase::updateTo009: - isonames updated" << endl;
// Now I need to update the logs table
if (updateTableLogs())
{
- //qDebug() << "DataBase::updateTo009: - logs updated and Function finished successfuly!!" << endl;
+ //qDebug() << "DataBase::updateTo009: - logs updated and Function finished successfuly!!" << endl;
IAmIn009 = true;
}
else
{
- //qDebug() << "DataBase::updateTo009: - logs NOT updated" << endl;
+ //qDebug() << "DataBase::updateTo009: - logs NOT updated" << endl;
IAmIn009 = false;
ErrorUpdating = true;
}
}
else
{
- //qDebug() << "DataBase::updateTo009: - isonames NOT updated" << endl;
+ //qDebug() << "DataBase::updateTo009: - isonames NOT updated" << endl;
IAmIn009 = false;
ErrorUpdating = true;
}
@@ -4722,13 +4703,13 @@ bool DataBase::updateTo009()
}
else
{
- //qDebug() << "DataBase::updateTo009: - createTableSatellites FALSE" << endl;
+ //qDebug() << "DataBase::updateTo009: - createTableSatellites FALSE" << endl;
ErrorUpdating = true;
IAmIn009 = false;
}
}
- //qDebug() << "DataBase::updateTo009: - END" << endl;
+ //qDebug() << "DataBase::updateTo009: - END" << endl;
return IAmIn009;
}
@@ -4738,7 +4719,7 @@ bool DataBase::updateTo010()
// We add FT8 mode and
// AS Propagation
- //qDebug() << "DataBase::updateTo010: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo010: latestRead: " << getDBVersion() << endl;
bool IAmIn010 = false;
bool IAmIn009 = false;
bool ErrorUpdating = false;
@@ -4746,36 +4727,36 @@ bool DataBase::updateTo010()
QSqlQuery query;
latestReaded = getDBVersion().toFloat();
- //qDebug() << "DataBase::updateTo010: Checking (latestRead/dbVersion):" << QString::number(latestReaded) << "/" << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateTo010: Checking (latestRead/dbVersion):" << QString::number(latestReaded) << "/" << QString::number(dbVersion) << endl;
if (latestReaded >= float(0.01))
{
- //qDebug() << "DataBase::updateTo010: - I am in 010" << endl;
+ //qDebug() << "DataBase::updateTo010: - I am in 010" << endl;
IAmIn010 = true;
return true;
}
else
{
- //qDebug() << "DataBase::updateTo010: - I am not in 010 I am in: " << QString::number(latestReaded)<< endl;
+ //qDebug() << "DataBase::updateTo010: - I am not in 010 I am in: " << QString::number(latestReaded)<< endl;
while (!IAmIn009 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo010: - Check if I am in 009: !" << endl;
+ //qDebug() << "DataBase::updateTo010: - Check if I am in 009: !" << endl;
IAmIn009 = updateTo009();
if (IAmIn009)
{
- //qDebug() << "DataBase::updateTo010: - updateTo009 returned TRUE - I am in 0.009: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo010: - updateTo009 returned TRUE - I am in 0.009: " << QString::number(latestReaded) << endl;
}
else
{
- //qDebug() << "DataBase::updateTo010: - updateTo009 returned FALSE - I am NOT in 0.009: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo010: - updateTo009 returned FALSE - I am NOT in 0.009: " << QString::number(latestReaded) << endl;
ErrorUpdating = false;
}
}
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo010: - I Could not update to: " << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateTo010: - I Could not update to: " << QString::number(dbVersion) << endl;
return false;
}
@@ -4785,12 +4766,12 @@ bool DataBase::updateTo010()
bool sqlOk = execQuery(Q_FUNC_INFO, "UPDATE band SET lower = '0.1357', upper = '0.1378' WHERE name='2190M'");
if (sqlOk)
{
- //qDebug() << "DataBase::updateTo010: - Band update OK" << endl;
+ //qDebug() << "DataBase::updateTo010: - Band update OK" << endl;
}
else
{
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::updateTo010: - Band update NOK" << endl;
+ //qDebug() << "DataBase::updateTo010: - Band update NOK" << endl;
}
@@ -4800,16 +4781,16 @@ bool DataBase::updateTo010()
if (updateDBVersion(softVersion, "0.010"))
{
- //qDebug() << "DataBase::updateTo010: - We are in 010! " << endl;
+ //qDebug() << "DataBase::updateTo010: - We are in 010! " << endl;
IAmIn010 = true;
}
else
{
- //qDebug() << "DataBase::updateTo010: - Failed to go to 010! " << endl;
+ //qDebug() << "DataBase::updateTo010: - Failed to go to 010! " << endl;
IAmIn010 = false;
}
- //qDebug() << "DataBase::updateTo010: - END" << endl;
+ //qDebug() << "DataBase::updateTo010: - END" << endl;
return IAmIn010;
}
@@ -4817,7 +4798,7 @@ bool DataBase::updateDBVersion(QString _softV, QString _dbV)
{
QString dateString = (QDate::currentDate()).toString("yyyyMMdd");
- //qDebug() << "DataBase::updateDBVersion: (date/SoftVersion/dbVersion): " << dateString << "/" << _softV << "/" << _dbV << endl;
+ //qDebug() << "DataBase::updateDBVersion: (date/SoftVersion/dbVersion): " << dateString << "/" << _softV << "/" << _dbV << endl;
QString stringQuery = "INSERT INTO softwarecontrol (dateupgrade, softversion, dbversion) VALUES ('" + dateString + "', '" + _softV + "', '" + _dbV + "')";
return execQuery(Q_FUNC_INFO, stringQuery);
}
@@ -4825,7 +4806,7 @@ bool DataBase::updateDBVersion(QString _softV, QString _dbV)
bool DataBase::updateTheModeTableAndSyncLog()
{
- //qDebug() << "DataBase::updateTheModeTableAndSyncLog" << endl;
+ //qDebug() << "DataBase::updateTheModeTableAndSyncLog" << endl;
QSqlQuery query;
createTableMode(false); // Create modetemp
@@ -4841,7 +4822,7 @@ bool DataBase::updateTheModeTableAndSyncLog()
if (sqlOK)
{
//QSqlDatabase::database().commit();
- //qDebug() << "DataBase::updateTheModeTableAndSyncLog - OK - mode was dropped" << endl;
+ //qDebug() << "DataBase::updateTheModeTableAndSyncLog - OK - mode was dropped" << endl;
return execQuery(Q_FUNC_INFO, "ALTER TABLE modetemp RENAME TO mode");
@@ -4849,16 +4830,16 @@ bool DataBase::updateTheModeTableAndSyncLog()
else
{
//queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::updateTheModeTableAndSyncLog - ERROR - modetemp not dropped" << endl;
+ //qDebug() << "DataBase::updateTheModeTableAndSyncLog - ERROR - modetemp not dropped" << endl;
return false;
}
- //qDebug() << "DataBase::updateTheModeTableAndSyncLog END" << endl;
+ //qDebug() << "DataBase::updateTheModeTableAndSyncLog END" << endl;
//return true;
}
bool DataBase::recreateTableBand()
{
- //qDebug() << "DataBase::recreateTableBand" << endl;
+ //qDebug() << "DataBase::recreateTableBand" << endl;
QSqlQuery query;
createTableBand(false); // Create modetemp
@@ -4871,27 +4852,27 @@ bool DataBase::recreateTableBand()
else
{
//queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataBase::recreateTableBand - ERROR - bandtemp not dropped" << endl;
+ //qDebug() << "DataBase::recreateTableBand - ERROR - bandtemp not dropped" << endl;
return false;
}
- //qDebug() << "DataBase::recreateTableBand END" << endl;
+ //qDebug() << "DataBase::recreateTableBand END" << endl;
//return true;
}
bool DataBase::updateTheEntityTableISONames()
{
- //qDebug() << "DataBase::updateTheEntityTableISONames" << endl;
+ //qDebug() << "DataBase::updateTheEntityTableISONames" << endl;
QSqlQuery query;
QString sq;
//First of all we will check if the entity table does contain data. We can't update something non existent!
if (!hasTheTableData("entity"))
{
- //qDebug() << "DataBase::updateTheEntityTableISONames: Entity has NO data" << endl;
+ //qDebug() << "DataBase::updateTheEntityTableISONames: Entity has NO data" << endl;
return false;
}
- //qDebug() << "DataBase::updateTheEntityTableISONames-1" << endl;
+ //qDebug() << "DataBase::updateTheEntityTableISONames-1" << endl;
sq = QString ("UPDATE entity SET isoname='mt' WHERE dxcc='246'"); //Sovereign Order of Malta
bool sqlOK = execQuery(Q_FUNC_INFO, sq);
@@ -4900,7 +4881,7 @@ bool DataBase::updateTheEntityTableISONames()
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
return false;
}
- //qDebug() << "DataBase::updateTheEntityTableISONames-2" << endl;
+ //qDebug() << "DataBase::updateTheEntityTableISONames-2" << endl;
sq = QString ("UPDATE entity SET isoname='un' WHERE dxcc='247'"); //Spratly
sqlOK = execQuery(Q_FUNC_INFO, sq);
@@ -6654,7 +6635,7 @@ bool DataBase::updateTheEntityTableISONames()
if (!sqlOK)
{return false;}
- //qDebug() << "DataBase::updateTheEntityTableISONames-END" << endl;
+ //qDebug() << "DataBase::updateTheEntityTableISONames-END" << endl;
return true;
}
@@ -6674,12 +6655,12 @@ bool DataBase::isTheTableExisting(const QString &_tableName)
query.finish();
if (_n > 0)
{
- //qDebug() << "DataBase::isTheTableExisting - Table Exists" << endl;
+ //qDebug() << "DataBase::isTheTableExisting - Table Exists" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::isTheTableExisting - Table does not Exist" << endl;
+ //qDebug() << "DataBase::isTheTableExisting - Table does not Exist" << endl;
return false;
}
}
@@ -6696,7 +6677,7 @@ bool DataBase::isTheTableExisting(const QString &_tableName)
bool DataBase::hasTheTableData(const QString &_tableName)
{
- //qDebug() << "DataBase::hasTheTableData" << _tableName << endl;
+ //qDebug() << "DataBase::hasTheTableData" << _tableName << endl;
QSqlQuery query;
@@ -6708,40 +6689,40 @@ bool DataBase::hasTheTableData(const QString &_tableName)
query.next();
if (query.isValid())
{
- //qDebug() << "DataBase::hasTheTableData - valid" << endl;
+ //qDebug() << "DataBase::hasTheTableData - valid" << endl;
int _num = (query.value(0)).toInt();
query.finish();
if (_num > 0)
{
- //qDebug() << "DataBase::hasTheTableData - DB Exists" << endl;
+ //qDebug() << "DataBase::hasTheTableData - DB Exists" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::hasTheTableData - DB does not Exist" << endl;
+ //qDebug() << "DataBase::hasTheTableData - DB does not Exist" << endl;
return false;
}
}
else
{
- //qDebug() << "DataBase::hasTheTableData - not valid" << endl;
+ //qDebug() << "DataBase::hasTheTableData - not valid" << endl;
query.finish();
return false;
}
}
else
{
- //qDebug() << "DataBase::hasTheTableData: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "DataBase::hasTheTableData: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "DataBase::hasTheTableData: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "DataBase::hasTheTableData LastError-n: " << QString::number(query.lastError().number() ) << endl;
- //qDebug() << "DataBase::updateTheEntityTableISONames" << endl;
+ //qDebug() << "DataBase::hasTheTableData: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "DataBase::hasTheTableData: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "DataBase::hasTheTableData: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "DataBase::hasTheTableData LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "DataBase::updateTheEntityTableISONames" << endl;
queryErrorManagement(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return false;
}
- //qDebug() << "DataBase::isTheDBCreated: END FALSE" << endl;
+ //qDebug() << "DataBase::isTheDBCreated: END FALSE" << endl;
//query.finish();
//return false;
}
@@ -6752,7 +6733,7 @@ bool DataBase::updateTo011()
// AS Propagation
- //qDebug() << "DataBase::updateTo011: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo011: latestRead: " << getDBVersion() << endl;
bool IAmIn011 = false;
bool IAmIn010 = false;
@@ -6761,36 +6742,36 @@ bool DataBase::updateTo011()
//bool sqlOk = false;
latestReaded = getDBVersion().toFloat();
- //qDebug() << "DataBase::updateTo011: Checking (latestRead/dbVersion):" << QString::number(latestReaded) << "/" << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateTo011: Checking (latestRead/dbVersion):" << QString::number(latestReaded) << "/" << QString::number(dbVersion) << endl;
if (latestReaded >= float(0.011))
{
- //qDebug() << "DataBase::updateTo011: - I am in 011" << endl;
+ //qDebug() << "DataBase::updateTo011: - I am in 011" << endl;
IAmIn011 = true;
return true;
}
else
{
- //qDebug() << "DataBase::updateTo011: - I am not in 0.012 I am in: " << QString::number(latestReaded)<< endl;
+ //qDebug() << "DataBase::updateTo011: - I am not in 0.012 I am in: " << QString::number(latestReaded)<< endl;
bool ErrorUpdating = false;
while (!IAmIn010 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo011: - Check if I am in 010: !" << endl;
+ //qDebug() << "DataBase::updateTo011: - Check if I am in 010: !" << endl;
IAmIn010 = updateTo010();
if (IAmIn010)
{
- //qDebug() << "DataBase::updateTo011: - updateTo010 returned TRUE - I am in 0.010: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo011: - updateTo010 returned TRUE - I am in 0.010: " << QString::number(latestReaded) << endl;
}
else
{
- //qDebug() << "DataBase::updateTo011: - updateTo009 returned FALSE - I am NOT in 0.010: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo011: - updateTo009 returned FALSE - I am NOT in 0.010: " << QString::number(latestReaded) << endl;
ErrorUpdating = false;
}
}
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo011: - I Could not update to: " << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateTo011: - I Could not update to: " << QString::number(dbVersion) << endl;
return false;
}
@@ -6798,60 +6779,60 @@ bool DataBase::updateTo011()
if (!recreateSatelliteData())
{
- //qDebug() << "DataBase::updateTo011: - Sats update NOK " << endl;
+ //qDebug() << "DataBase::updateTo011: - Sats update NOK " << endl;
return false;
}
if (!recreateTableDXCC())
{
- //qDebug() << "DataBase::updateTo011: - recreateTableDXCC NOK " << endl;
+ //qDebug() << "DataBase::updateTo011: - recreateTableDXCC NOK " << endl;
return false;
}
if (!recreateTableWAZ())
{
- //qDebug() << "DataBase::updateTo011: - recreateTableWAZ NOK " << endl;
+ //qDebug() << "DataBase::updateTo011: - recreateTableWAZ NOK " << endl;
return false;
}
if(!execQuery(Q_FUNC_INFO, "INSERT INTO mode (submode, name, cabrillo, deprecated) VALUES ('MSK144', 'MSK144', 'NO', '0')"))
{
- //qDebug() << "DataBase::updateTo011: - MSK NOK " << endl;
+ //qDebug() << "DataBase::updateTo011: - MSK NOK " << endl;
return false;
}
if (!recreateTableLog())
{
- //qDebug() << "DataBase::updateTo011: - Failed to recreate Table Log " << endl;
+ //qDebug() << "DataBase::updateTo011: - Failed to recreate Table Log " << endl;
return false;
}
if (updateDBVersion(softVersion, "0.011"))
{
- //qDebug() << "DataBase::updateTo011: - We are in 011! " << endl;
+ //qDebug() << "DataBase::updateTo011: - We are in 011! " << endl;
IAmIn011 = true;
}
else
{
- //qDebug() << "DataBase::updateTo011: - Failed to go to 011! " << endl;
+ //qDebug() << "DataBase::updateTo011: - Failed to go to 011! " << endl;
IAmIn011 = false;
}
if (!updateAwardDXCCTable())
{
- //qDebug() << "DataBase::updateTo011: - updateAwardDXCCTable NOK " << endl;
+ //qDebug() << "DataBase::updateTo011: - updateAwardDXCCTable NOK " << endl;
IAmIn011 = false;
return false;
}
if (!updateAwardWAZTable())
{
- //qDebug() << "DataBase::updateTo011: - updateAwardWAZTable NOK " << endl;
+ //qDebug() << "DataBase::updateTo011: - updateAwardWAZTable NOK " << endl;
IAmIn011 = false;
}
- //qDebug() << "DataBase::updateTo011: - END" << endl;
+ //qDebug() << "DataBase::updateTo011: - END" << endl;
return IAmIn011;
}
@@ -6863,37 +6844,37 @@ bool DataBase::updateTo012()
// Solve the supportedContest table missing bug in some deployments
- //qDebug() << "DataBase::updateTo012: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo012: latestRead: " << getDBVersion() << endl;
bool IAmIn011 = false;
bool ErrorUpdating = false;
latestReaded = getDBVersion().toFloat();
- //qDebug() << "DataBase::updateTo012: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateTo012: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
if (latestReaded >= float(0.012))
{
- //qDebug() << "DataBase::updateTo012: - I am in 012" << endl;
+ //qDebug() << "DataBase::updateTo012: - I am in 012" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateTo012: - I am not in 0.012 I am in: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo012: - I am not in 0.012 I am in: " << getDBVersion() << endl;
while (!IAmIn011 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo012: - Check if I am in 011: !" << endl;
+ //qDebug() << "DataBase::updateTo012: - Check if I am in 011: !" << endl;
IAmIn011 = updateTo011();
if (IAmIn011)
{
- //qDebug() << "DataBase::updateTo012: - updateTo011 returned TRUE - I am in 0.011: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo012: - updateTo011 returned TRUE - I am in 0.011: " << QString::number(latestReaded) << endl;
}
else
{
- //qDebug() << "DataBase::updateTo012: - updateTo011 returned FALSE - I am NOT in 0.011: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo012: - updateTo011 returned FALSE - I am NOT in 0.011: " << QString::number(latestReaded) << endl;
ErrorUpdating = false;
}
}
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo012: - I Could not update to: " << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateTo012: - I Could not update to: " << QString::number(dbVersion) << endl;
return false;
}
}
@@ -6912,7 +6893,7 @@ bool DataBase::updateTo012()
}
else
{
- //qDebug() << "DataBase::updateTo012: UPDATED NOK-1!" << endl;
+ //qDebug() << "DataBase::updateTo012: UPDATED NOK-1!" << endl;
return false;
}
}
@@ -6923,7 +6904,7 @@ bool DataBase::updateTo012()
{
if (!recreateSupportedContest())
{
- //qDebug() << "DataBase::updateTo012: UPDATED NOK-2!" << endl;
+ //qDebug() << "DataBase::updateTo012: UPDATED NOK-2!" << endl;
return false;
}
}
@@ -6931,15 +6912,15 @@ bool DataBase::updateTo012()
if (updateDBVersion(softVersion, "0.012"))
{
- //qDebug() << "DataBase::updateTo012: - We are in 012! " << endl;
+ //qDebug() << "DataBase::updateTo012: - We are in 012! " << endl;
}
else
{
- //qDebug() << "DataBase::updateTo011: - Failed to go to 012! " << endl;
+ //qDebug() << "DataBase::updateTo011: - Failed to go to 012! " << endl;
return false;
}
- //qDebug() << "DataBase::updateTo012: UPDATED OK!" << endl;
+ //qDebug() << "DataBase::updateTo012: UPDATED OK!" << endl;
return true;
}
@@ -6951,37 +6932,37 @@ bool DataBase::updateTo013()
// Solve the supportedContest table missing bug in some deployments
- //qDebug() << "DataBase::updateTo013: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo013: latestRead: " << getDBVersion() << endl;
bool IAmIn012 = false;
bool ErrorUpdating = false;
latestReaded = getDBVersion().toFloat();
- //qDebug() << "DataBase::updateTo013: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateTo013: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
if (latestReaded >= float(0.013))
{
- //qDebug() << "DataBase::updateTo013: - I am in 013" << endl;
+ //qDebug() << "DataBase::updateTo013: - I am in 013" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateTo013: - I am not in 0.013 I am in: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateTo013: - I am not in 0.013 I am in: " << getDBVersion() << endl;
while (!IAmIn012 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo013: - Check if I am in 012: !" << endl;
+ //qDebug() << "DataBase::updateTo013: - Check if I am in 012: !" << endl;
IAmIn012 = updateTo012();
if (IAmIn012)
{
- //qDebug() << "DataBase::updateTo013: - updateTo012 returned TRUE - I am in 0.012: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo013: - updateTo012 returned TRUE - I am in 0.012: " << QString::number(latestReaded) << endl;
}
else
{
- //qDebug() << "DataBase::updateTo013: - updateTo011 returned FALSE - I am NOT in 0.012: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateTo013: - updateTo011 returned FALSE - I am NOT in 0.012: " << QString::number(latestReaded) << endl;
ErrorUpdating = false;
}
}
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateTo013: - I Could not update to: " << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateTo013: - I Could not update to: " << QString::number(dbVersion) << endl;
return false;
}
}
@@ -7013,15 +6994,15 @@ bool DataBase::updateTo013()
if (updateDBVersion(softVersion, "0.013"))
{
- //qDebug() << "DataBase::updateTo013: - We are in 013! " << endl;
+ //qDebug() << "DataBase::updateTo013: - We are in 013! " << endl;
}
else
{
- //qDebug() << "DataBase::updateTo013: - Failed to go to 013! " << endl;
+ //qDebug() << "DataBase::updateTo013: - Failed to go to 013! " << endl;
return false;
}
- //qDebug() << "DataBase::updateTo013: UPDATED OK!" << endl;
+ //qDebug() << "DataBase::updateTo013: UPDATED OK!" << endl;
return true;
}
@@ -7033,37 +7014,37 @@ bool DataBase::updateTo014()
// Updates the Satellite DB
- //qDebug() << "DataBase::updateto014: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateto014: latestRead: " << getDBVersion() << endl;
bool IAmIn013 = false;
bool ErrorUpdating = false;
latestReaded = getDBVersion().toFloat();
- //qDebug() << "DataBase::updateto014: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateto014: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
if (latestReaded >= float(0.14))
{
- //qDebug() << "DataBase::updateto014: - I am in 013" << endl;
+ //qDebug() << "DataBase::updateto014: - I am in 013" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateto014: - I am not in 0.013 I am in: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateto014: - I am not in 0.013 I am in: " << getDBVersion() << endl;
while (!IAmIn013 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateto014: - Check if I am in 013: !" << endl;
+ //qDebug() << "DataBase::updateto014: - Check if I am in 013: !" << endl;
IAmIn013 = updateTo013();
if (IAmIn013)
{
- //qDebug() << "DataBase::updateto014: - updateTo012 returned TRUE - I am in 0.013: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateto014: - updateTo012 returned TRUE - I am in 0.013: " << QString::number(latestReaded) << endl;
}
else
{
- //qDebug() << "DataBase::updateto014: - updateTo011 returned FALSE - I am NOT in 0.013: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateto014: - updateTo011 returned FALSE - I am NOT in 0.013: " << QString::number(latestReaded) << endl;
ErrorUpdating = false;
}
}
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateto014: - I Could not update to: " << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateto014: - I Could not update to: " << QString::number(dbVersion) << endl;
return false;
}
}
@@ -7073,22 +7054,22 @@ bool DataBase::updateTo014()
if (!recreateSatelliteData())
{
- //qDebug() << "DataBase::updateTo014: - Sats update NOK " << endl;
+ //qDebug() << "DataBase::updateTo014: - Sats update NOK " << endl;
return false;
}
if (updateDBVersion(softVersion, "0.014"))
{
- //qDebug() << "DataBase::updateto014: - We are in 013! " << endl;
+ //qDebug() << "DataBase::updateto014: - We are in 013! " << endl;
}
else
{
- //qDebug() << "DataBase::updateto014: - Failed to go to 013! " << endl;
+ //qDebug() << "DataBase::updateto014: - Failed to go to 013! " << endl;
return false;
}
- //qDebug() << "DataBase::updateTo014: UPDATED OK!" << endl;
+ //qDebug() << "DataBase::updateTo014: UPDATED OK!" << endl;
return true;
}
@@ -7098,36 +7079,36 @@ bool DataBase::updateTo015()
// Updates the DB to 0.015:
// Adds the FT4 mode
- //qDebug() << "DataBase::updateto015: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateto015: latestRead: " << getDBVersion() << endl;
bool IAmIn014 = false;
bool ErrorUpdating = false;
latestReaded = getDBVersion().toFloat();
- //qDebug() << "DataBase::updateto015: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateto015: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
if (latestReaded >= float(0.15))
{
- //qDebug() << "DataBase::updateto015: - I am in 013" << endl;
+ //qDebug() << "DataBase::updateto015: - I am in 013" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateto014: - I am not in 0.014 I am in: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateto014: - I am not in 0.014 I am in: " << getDBVersion() << endl;
while (!IAmIn014 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateto015: - Check if I am in 014: !" << endl;
+ //qDebug() << "DataBase::updateto015: - Check if I am in 014: !" << endl;
IAmIn014 = updateTo014();
if (IAmIn014)
{
- //qDebug() << "DataBase::updateto015: - updateTo013 returned TRUE - I am in 0.014: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateto015: - updateTo013 returned TRUE - I am in 0.014: " << QString::number(latestReaded) << endl;
}
else
{
- //qDebug() << "DataBase::updateto015: - updateTo011 returned FALSE - I am NOT in 0.014: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateto015: - updateTo011 returned FALSE - I am NOT in 0.014: " << QString::number(latestReaded) << endl;
ErrorUpdating = false;
}
}
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateto015: - I Could not update to: " << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateto015: - I Could not update to: " << QString::number(dbVersion) << endl;
return false;
}
}
@@ -7137,26 +7118,26 @@ bool DataBase::updateTo015()
if (updateTheModeTableAndSyncLog())
{
- //qDebug() << "DataBase::updateTo015: - updateTheModeTableAndSyncLog OK" << endl;
+ //qDebug() << "DataBase::updateTo015: - updateTheModeTableAndSyncLog OK" << endl;
}
else
{
- //qDebug() << "DataBase::updateTo015: UPDATED NOK!(9)" << endl;
+ //qDebug() << "DataBase::updateTo015: UPDATED NOK!(9)" << endl;
//ErrorUpdating = true;
}
if (updateDBVersion(softVersion, "0.015"))
{
- //qDebug() << "DataBase::updateto015: - We are in 015! " << endl;
+ //qDebug() << "DataBase::updateto015: - We are in 015! " << endl;
}
else
{
- //qDebug() << "DataBase::updateto015: - Failed to go to 014! " << endl;
+ //qDebug() << "DataBase::updateto015: - Failed to go to 014! " << endl;
return false;
}
- //qDebug() << "DataBase::updateTo015: UPDATED OK!" << endl;
+ //qDebug() << "DataBase::updateTo015: UPDATED OK!" << endl;
return true;
}
@@ -7168,37 +7149,37 @@ bool DataBase::updateTo016()
// Updates the Satellite DB
- //qDebug() << "DataBase::updateto016: latestRead: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateto016: latestRead: " << getDBVersion() << endl;
bool IAmIn015 = false;
bool ErrorUpdating = false;
latestReaded = getDBVersion().toFloat();
- //qDebug() << "DataBase::updateto016: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateto016: Checking (latestRead/dbVersion):" << getDBVersion() << "/" << QString::number(dbVersion) << endl;
if (latestReaded >= float(0.16))
{
- //qDebug() << "DataBase::updateto016: - I am in 015" << endl;
+ //qDebug() << "DataBase::updateto016: - I am in 015" << endl;
return true;
}
else
{
- //qDebug() << "DataBase::updateto016: - I am not in 0.015 I am in: " << getDBVersion() << endl;
+ //qDebug() << "DataBase::updateto016: - I am not in 0.015 I am in: " << getDBVersion() << endl;
while (!IAmIn015 && !ErrorUpdating)
{
- //qDebug() << "DataBase::updateto014: - Check if I am in 015: !" << endl;
+ //qDebug() << "DataBase::updateto014: - Check if I am in 015: !" << endl;
IAmIn015 = updateTo015();
if (IAmIn015)
{
- //qDebug() << "DataBase::updateto016: - updateTo015 returned TRUE - I am in 0.015: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateto016: - updateTo015 returned TRUE - I am in 0.015: " << QString::number(latestReaded) << endl;
}
else
{
- //qDebug() << "DataBase::updateto016: - updateTo015 returned FALSE - I am NOT in 0.015: " << QString::number(latestReaded) << endl;
+ //qDebug() << "DataBase::updateto016: - updateTo015 returned FALSE - I am NOT in 0.015: " << QString::number(latestReaded) << endl;
ErrorUpdating = false;
}
}
if (ErrorUpdating)
{
- //qDebug() << "DataBase::updateto016: - I Could not update to: " << QString::number(dbVersion) << endl;
+ //qDebug() << "DataBase::updateto016: - I Could not update to: " << QString::number(dbVersion) << endl;
return false;
}
}
@@ -7207,25 +7188,25 @@ bool DataBase::updateTo016()
if (!recreateSatelliteData())
{
- //qDebug() << "DataBase::updateTo016: - Sats update NOK " << endl;
+ //qDebug() << "DataBase::updateTo016: - Sats update NOK " << endl;
return false;
}
if (updateDBVersion(softVersion, "0.016"))
{
- //qDebug() << "DataBase::updateto014: - We are in 016! " << endl;
+ //qDebug() << "DataBase::updateto014: - We are in 016! " << endl;
}
else
{
- //qDebug() << "DataBase::updateto014: - Failed to go to 016! " << endl;
+ //qDebug() << "DataBase::updateto014: - Failed to go to 016! " << endl;
return false;
}
- //qDebug() << "DataBase::updateTo016: UPDATED OK!" << endl;
+ //qDebug() << "DataBase::updateTo016: UPDATED OK!" << endl;
return true;
}
bool DataBase::updateAwardDXCCTable()
{
- //qDebug() << "DataBase::updateAwardDXCCTable" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable" << endl;
QList dxccStatusList;
//QList dxccStatusListCheck;
@@ -7259,7 +7240,7 @@ bool DataBase::updateAwardDXCCTable()
}
else
{
- //qDebug() << "DataBase::updateAwardDXCCTable SELECT when OK" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable SELECT when OK" << endl;
}
QStringList dxccStatus = QStringList(); //dxcc, band, mode, confirmed, lognumber, qsoid (per award set)
QStringList dxccStatusCheck = QStringList(); //dxcc, band, mode, confirmed, lognumber (per award set) just to check
@@ -7267,20 +7248,20 @@ bool DataBase::updateAwardDXCCTable()
QString _aux = QString();
- //qDebug() << "DataBase::updateAwardDXCCTable before the while" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable before the while" << endl;
while (query.next())
{
- //qDebug() << "DataBase::updateAwardDXCCTable IN the while" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable IN the while" << endl;
if (query.isValid())
{
- //qDebug() << "DataBase::updateAwardDXCCTable VALID" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable VALID" << endl;
awardEntry.dxcc.clear();
awardEntry.band.clear();
awardEntry.status.clear();
awardEntry.logNumber.clear();
awardEntry.qsoID.clear();
- //qDebug() << "DataBase::updateAwardDXCCTable in the while" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable in the while" << endl;
nameCol = rec.indexOf("qsl_rcvd");
if ((query.value(nameCol)).toString() == "Y")
@@ -7291,7 +7272,7 @@ bool DataBase::updateAwardDXCCTable()
{
awardEntry.status = "0";
}
- //qDebug() << "DataBase::updateAwardDXCCTable - status" << awardEntry.status << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable - status" << awardEntry.status << endl;
if ((awardEntry.status == "1") || (awardEntry.status == "0") )
{
@@ -7312,7 +7293,7 @@ bool DataBase::updateAwardDXCCTable()
nameCol = rec.indexOf("lognumber");
awardEntry.logNumber = (query.value(nameCol)).toString();
- //qDebug() << "DataBase::updateAwardDXCCTable: Adding: " << awardEntry.dxcc <<"/" << awardEntry.band <<"/" << awardEntry.mode <<"/" << awardEntry.status <<"/" << awardEntry.logNumber <<"/" << awardEntry.qsoID << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable: Adding: " << awardEntry.dxcc <<"/" << awardEntry.band <<"/" << awardEntry.mode <<"/" << awardEntry.status <<"/" << awardEntry.logNumber <<"/" << awardEntry.qsoID << endl;
dxccStatusList.append(awardEntry);
}
@@ -7320,12 +7301,12 @@ bool DataBase::updateAwardDXCCTable()
}
} // END OF WHILE
- //qDebug() << "DataBase::updateAwardDXCCTable - END OF WHILE" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable - END OF WHILE" << endl;
query.finish();
- //qDebug() << "DataBase::updateAwardDXCCTable: Log analized... let's clean the table!" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable: Log analized... let's clean the table!" << endl;
stringQuery = QString("DELETE FROM awarddxcc");
@@ -7334,11 +7315,11 @@ bool DataBase::updateAwardDXCCTable()
{return false;}
else
{
- //qDebug() << "DataBase::updateAwardDXCCTable: awarddxcc table DELETED" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable: awarddxcc table DELETED" << endl;
}
- //qDebug() << "DataBase::updateAwardDXCCTable: Now we start writing the table!!" << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable: Now we start writing the table!!" << endl;
//int i = 0;
_aux.clear();
@@ -7350,7 +7331,7 @@ bool DataBase::updateAwardDXCCTable()
progress.setMaximum(qsos);
progress.setWindowModality(Qt::WindowModal);
- //qDebug() << "DataBase::updateAwardDXCCTable: INSERTING: " << QString::number(qsos) << " QSOS..." << endl;
+ //qDebug() << "DataBase::updateAwardDXCCTable: INSERTING: " << QString::number(qsos) << " QSOS..." << endl;
for (int j=0;j dxccStatusList;
//QList dxccStatusListCheck;
dxccStatusList.clear();
@@ -7482,7 +7463,7 @@ bool DataBase::updateAwardWAZTable()
}
else
{
- //qDebug() << "DataBase::updateAwardWAZTable SELECT when OK" << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable SELECT when OK" << endl;
}
QStringList dxccStatus = QStringList(); //cqz, band, mode, confirmed, lognumber, qsoid (per award set)
QStringList dxccStatusCheck = QStringList(); //cqz, band, mode, confirmed, lognumber (per award set) just to check
@@ -7490,20 +7471,20 @@ bool DataBase::updateAwardWAZTable()
QString _aux = QString();
- //qDebug() << "DataBase::updateAwardWAZTable before the while" << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable before the while" << endl;
while (query.next())
{
- //qDebug() << "DataBase::updateAwardWAZTable IN the while" << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable IN the while" << endl;
if (query.isValid())
{
- //qDebug() << "DataBase::updateAwardWAZTable VALID" << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable VALID" << endl;
awardEntry.dxcc.clear();
awardEntry.band.clear();
awardEntry.status.clear();
awardEntry.logNumber.clear();
awardEntry.qsoID.clear();
- //qDebug() << "DataBase::updateAwardWAZTable in the while" << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable in the while" << endl;
nameCol = rec.indexOf("qsl_rcvd");
if ((query.value(nameCol)).toString() == "Y")
@@ -7514,7 +7495,7 @@ bool DataBase::updateAwardWAZTable()
{
awardEntry.status = "0";
}
- //qDebug() << "DataBase::updateAwardWAZTable - status" << awardEntry.status << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable - status" << awardEntry.status << endl;
if ((awardEntry.status == "1") || (awardEntry.status == "0") )
{
@@ -7535,7 +7516,7 @@ bool DataBase::updateAwardWAZTable()
nameCol = rec.indexOf("lognumber");
awardEntry.logNumber = (query.value(nameCol)).toString();
- //qDebug() << "DataBase::updateAwardWAZTable: Adding: " << awardEntry.dxcc <<"/" << awardEntry.band <<"/" << awardEntry.mode <<"/" << awardEntry.status <<"/" << awardEntry.logNumber <<"/" << awardEntry.qsoID << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable: Adding: " << awardEntry.dxcc <<"/" << awardEntry.band <<"/" << awardEntry.mode <<"/" << awardEntry.status <<"/" << awardEntry.logNumber <<"/" << awardEntry.qsoID << endl;
dxccStatusList.append(awardEntry);
}
@@ -7543,12 +7524,12 @@ bool DataBase::updateAwardWAZTable()
}
} // END OF WHILE
- //qDebug() << "DataBase::updateAwardWAZTable - END OF WHILE" << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable - END OF WHILE" << endl;
query.finish();
- //qDebug() << "DataBase::updateAwardWAZTable: Log analized... let's clean the table!" << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable: Log analized... let's clean the table!" << endl;
stringQuery = QString("DELETE FROM awardwaz");
@@ -7557,11 +7538,11 @@ bool DataBase::updateAwardWAZTable()
{return false;}
else
{
- //qDebug() << "DataBase::updateAwardWAZTable: awardwaz table DELETED" << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable: awardwaz table DELETED" << endl;
}
- //qDebug() << "DataBase::updateAwardWAZTable: Now we start writing the table!!" << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable: Now we start writing the table!!" << endl;
//int i = 0;
_aux.clear();
@@ -7573,7 +7554,7 @@ bool DataBase::updateAwardWAZTable()
progress.setMaximum(qsos);
progress.setWindowModality(Qt::WindowModal);
- //qDebug() << "DataBase::updateAwardWAZTable: INSERTING: " << QString::number(qsos) << " QSOS..." << endl;
+ //qDebug() << "DataBase::updateAwardWAZTable: INSERTING: " << QString::number(qsos) << " QSOS..." << endl;
for (int j=0;j. *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
@@ -108,8 +108,8 @@ public:
QString getFreqFromBandId(const int _i);
- //int getLogTypeNumber(const QString &_logType);
- //QString getLogTypeName(const int _logType);
+ int getLogTypeNumber(const QString &_logType);
+ QString getLogTypeName(const int _logType);
bool unMarkAllQSO();
bool updateIfNeeded();
diff --git a/dataproxy_sqlite.cpp b/dataproxy_sqlite.cpp
index 1e8a7b8e..cc37ccc4 100644
--- a/dataproxy_sqlite.cpp
+++ b/dataproxy_sqlite.cpp
@@ -20,7 +20,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
@@ -30,9 +30,9 @@
DataProxy_SQLite::DataProxy_SQLite(const QString &_softVersion, const QString &_parentFunction)
{
- //qDebug() << "DataProxy_SQLite::DataProxy_SQLite" << _softVersion << _parentFunction << endl;
+ //qDebug() << "DataProxy_SQLite::DataProxy_SQLite" << _softVersion << _parentFunction << endl;
- //qDebug() << "DataProxy_SQLite::DataProxy_SQLite 1" << endl;
+ //qDebug() << "DataProxy_SQLite::DataProxy_SQLite 1" << endl;
util = new Utilities();
util->setVersion(_softVersion);
@@ -40,18 +40,18 @@ DataProxy_SQLite::DataProxy_SQLite(const QString &_softVersion, const QString &_
//db = new DataBase(Q_FUNC_INFO, util->getKLogDBFile());
dbCreated = db->createConnection(Q_FUNC_INFO);
//dbCreated = db->createBandModeMaps();
- //qDebug() << "DataProxy_SQLite::DataProxy_SQLite - END" << endl;
+ //qDebug() << "DataProxy_SQLite::DataProxy_SQLite - END" << endl;
searching = false;
executionN = 0;
//preparedQuery = new QSqlQuery;
//db = new DataBase(0);
//DataProxy_SQLite = new DataProxy_SQLite();
- //qDebug() << "DataProxy_SQLite::DataProxy_SQLite END" << endl;
+ //qDebug() << "DataProxy_SQLite::DataProxy_SQLite END" << endl;
}
DataProxy_SQLite::~DataProxy_SQLite(){
- //qDebug() << "DataProxy_SQLite::~DataProxy_SQLite" << endl;
+ //qDebug() << "DataProxy_SQLite::~DataProxy_SQLite" << endl;
}
@@ -67,18 +67,18 @@ QString DataProxy_SQLite::getSoftVersion()
{
QString v = (query.value(0)).toString();
query.finish();
- //qDebug() << "DataProxy_SQLite::getSoftVersion: DATA: " << v << endl;
+ //qDebug() << "DataProxy_SQLite::getSoftVersion: DATA: " << v << endl;
if (v.length()<1)
{
//The following is not a query error but if the softwareversion value is lower than 0 or empty
- queryError(Q_FUNC_INFO, tr("Software version in DB is null"), -1, tr("Query didn't failed")); // To alert about any failed query execution
+ queryError(Q_FUNC_INFO, tr("Software version in DB is null"), -1, tr("No query failed")); // To alert about any failed query execution
}
return v;
}
else
{
query.finish();
- //qDebug() << "DataProxy_SQLite::getSoftVersion: version empty-1" << endl;
+ //qDebug() << "DataProxy_SQLite::getSoftVersion: version empty-1" << endl;
return QString();
}
}
@@ -86,7 +86,7 @@ QString DataProxy_SQLite::getSoftVersion()
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "DataProxy_SQLite::getSoftVersion: version empty-1 - ERROR" << endl;
+ //qDebug() << "DataProxy_SQLite::getSoftVersion: version empty-1 - ERROR" << endl;
return QString();
}
}
@@ -125,16 +125,16 @@ bool DataProxy_SQLite::reconnectDB()
}
void DataProxy_SQLite::createLogModel(){
- //qDebug() << "DataProxy_SQLite::createLogModel" << endl;
+ //qDebug() << "DataProxy_SQLite::createLogModel" << endl;
}
void DataProxy_SQLite::createLogPanel(){
- //qDebug() << "DataProxy_SQLite::createLogPanel" << endl;
+ //qDebug() << "DataProxy_SQLite::createLogPanel" << endl;
}
int DataProxy_SQLite::getIdFromModeName(const QString& _modeName)
{
- //qDebug() << "DataProxy_SQLite::getIdFromModeName: " << _modeName << "/" << QString::number(db->getModeIDFromName2(_modeName)) << endl;
+ //qDebug() << "DataProxy_SQLite::getIdFromModeName: " << _modeName << "/" << QString::number(db->getModeIDFromName2(_modeName)) << endl;
if (_modeName.length()<2)
{
return -4;
@@ -145,7 +145,7 @@ int DataProxy_SQLite::getIdFromModeName(const QString& _modeName)
int DataProxy_SQLite::getSubModeIdFromSubMode(const QString &_subModeName)
{
- //qDebug() << "DataProxy_SQLite::getSubModeIdFromSubMode: " << _subModeName << endl;
+ //qDebug() << "DataProxy_SQLite::getSubModeIdFromSubMode: " << _subModeName << endl;
if (_subModeName.length()<2)
{
@@ -226,10 +226,10 @@ bool DataProxy_SQLite::isModeDeprecated (const QString &_sm)
int DataProxy_SQLite::getIdFromBandName(const QString& _bandName)
{
-// //qDebug() << "DataProxy_SQLite::getIdFromBandName: " << _bandName << "/" << QString::number(db->getBandIDFromName2(_bandName))<< endl;
+// //qDebug() << "DataProxy_SQLite::getIdFromBandName: " << _bandName << "/" << QString::number(db->getBandIDFromName2(_bandName))<< endl;
if (_bandName.length()<1)
{
- //qDebug() << "DataProxy_SQLite::getIdFromBandName:-4: " << _bandName << "/" << QString::number(db->getBandIDFromName2(_bandName))<< endl;
+ //qDebug() << "DataProxy_SQLite::getIdFromBandName:-4: " << _bandName << "/" << QString::number(db->getBandIDFromName2(_bandName))<< endl;
return -4;
}
@@ -238,13 +238,13 @@ int DataProxy_SQLite::getIdFromBandName(const QString& _bandName)
QString DataProxy_SQLite::getNameFromBandId (const int _id)
{
- //qDebug() << "DataProxy_SQLite::getNameFromBandId: " << QString::number(_id) << endl;
+ //qDebug() << "DataProxy_SQLite::getNameFromBandId: " << QString::number(_id) << endl;
return db->getBandNameFromID2(_id);
}
QString DataProxy_SQLite::getNameFromModeId (const int _id)
{
- //qDebug() << "DataProxy_SQLite::getNameFromModeId" << endl;
+ //qDebug() << "DataProxy_SQLite::getNameFromModeId" << endl;
//return db->getModeNameFromID2(_id);
return db->getModeNameFromNumber(_id);
@@ -252,7 +252,7 @@ QString DataProxy_SQLite::getNameFromModeId (const int _id)
QString DataProxy_SQLite::getNameFromSubModeId (const int _id)
{
- //qDebug() << "DataProxy_SQLite::getNameFromSubModeId: " << QString::number(_id) << "DB: " << db->getModeNameFromID2(_id) << endl;
+ //qDebug() << "DataProxy_SQLite::getNameFromSubModeId: " << QString::number(_id) << "DB: " << db->getModeNameFromID2(_id) << endl;
return db->getSubModeNameFromID2(_id);
/*
@@ -288,7 +288,7 @@ QString DataProxy_SQLite::getNameFromSubModeId (const int _id)
QString DataProxy_SQLite::getSubModeFromId (const int _id)
{
- //qDebug() << "DataProxy_SQLite::getSubModeFromId: " << QString::number(_id) << endl;
+ //qDebug() << "DataProxy_SQLite::getSubModeFromId: " << QString::number(_id) << endl;
QSqlQuery query;
QString queryString = QString("SELECT submode FROM mode WHERE id='%1'").arg(_id);
bool sqlOK = query.exec(queryString);
@@ -359,7 +359,7 @@ QString DataProxy_SQLite::getFreqFromBandId(const int _id)
int DataProxy_SQLite::getBandIdFromFreq(const double _n)
{
- //qDebug() << "DataProxy_SQLite::getBandIdFromFreq: " << QString::number(_n) << endl;
+ //qDebug() << "DataProxy_SQLite::getBandIdFromFreq: " << QString::number(_n) << endl;
//Freq should be in MHz
bool sqlOk = false;
QString queryString = QString("SELECT id FROM band WHERE lower <= '%1' and upper >= '%2'").arg(_n).arg(_n);
@@ -367,10 +367,10 @@ int DataProxy_SQLite::getBandIdFromFreq(const double _n)
QSqlQuery query(queryString);
sqlOk = query.exec();
- //qDebug() << "DataProxy_SQLite::getBandIdFromFreq: Query: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getBandIdFromFreq: Query: " << query.lastQuery() << endl;
if (sqlOk)
{
- //qDebug() << "DataProxy_SQLite::getBandIdFromFreq: Query OK" << endl;
+ //qDebug() << "DataProxy_SQLite::getBandIdFromFreq: Query OK" << endl;
query.next();
@@ -388,7 +388,7 @@ int DataProxy_SQLite::getBandIdFromFreq(const double _n)
}
else
{
- //qDebug() << "DataProxy_SQLite::getBandIdFromFreq: Query NOK" << endl;
+ //qDebug() << "DataProxy_SQLite::getBandIdFromFreq: Query NOK" << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return -2;
@@ -398,13 +398,13 @@ int DataProxy_SQLite::getBandIdFromFreq(const double _n)
QString DataProxy_SQLite::getBandNameFromFreq(const double _n)
{
- //qDebug() << "DataProxy_SQLite::getBandNameFromFreq: " << QString::number(_n) << endl;
+ //qDebug() << "DataProxy_SQLite::getBandNameFromFreq: " << QString::number(_n) << endl;
return getNameFromBandId(getBandIdFromFreq(_n));
}
double DataProxy_SQLite::getLowLimitBandFromBandName(const QString &_sm)
{
- //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName: " << _sm << endl;
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName: " << _sm << endl;
QSqlQuery query;
QString queryString = QString("SELECT lower FROM band WHERE name='%1' OR name='%2'").arg(_sm).arg(_sm.toUpper());
bool sqlOK = query.exec(queryString);
@@ -416,13 +416,13 @@ double DataProxy_SQLite::getLowLimitBandFromBandName(const QString &_sm)
{
if ( (query.value(0)).toDouble()<0 )
{
- //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName: -1.0-1" << endl;
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName: -1.0-1" << endl;
query.finish();
return -1.0;
}
else
{
- //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName(else): " << QString::number((query.value(0)).toDouble()) << endl;
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName(else): " << QString::number((query.value(0)).toDouble()) << endl;
double v = (query.value(0)).toDouble();
query.finish();
return v;
@@ -430,12 +430,12 @@ double DataProxy_SQLite::getLowLimitBandFromBandName(const QString &_sm)
}
else
{
- //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName: -1.0-2" << endl;
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName: -1.0-2" << endl;
query.finish();
return -1.0;
}
- //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName: -1.0-3" << endl;
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandName: -1.0-3" << endl;
//query.finish();
//return -1.0;
}
@@ -451,7 +451,7 @@ double DataProxy_SQLite::getLowLimitBandFromBandName(const QString &_sm)
double DataProxy_SQLite::getLowLimitBandFromBandId(const QString &_sm)
{
- //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandId" << endl;
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandId" << endl;
QSqlQuery query;
QString queryString = QString("SELECT lower FROM band WHERE id='%1'").arg(_sm.toUpper());
bool sqlOK = query.exec(queryString);
@@ -463,13 +463,13 @@ double DataProxy_SQLite::getLowLimitBandFromBandId(const QString &_sm)
{
if ( (query.value(1)).toDouble()<0 )
{
- //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandId: -1.0-1" << endl;
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandId: -1.0-1" << endl;
query.finish();
return -1.0;
}
else
{
- //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandId: " << QString::number((query.value(0)).toDouble()) << endl;
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandId: " << QString::number((query.value(0)).toDouble()) << endl;
double v = (query.value(0)).toDouble();
query.finish();
return v;
@@ -477,12 +477,12 @@ double DataProxy_SQLite::getLowLimitBandFromBandId(const QString &_sm)
}
else
{
- //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandId: -1.0-2" << endl;
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandId: -1.0-2" << endl;
query.finish();
return -1.0;
}
-
+ //qDebug() << "DataProxy_SQLite::getLowLimitBandFromBandId: -1.0-3" << endl;
//query.finish();
//return -1.0;
}
@@ -503,7 +503,7 @@ bool DataProxy_SQLite::isThisFreqInBand(const QString &_band, const QString &_fr
QStringList DataProxy_SQLite::getBands()
{
- //qDebug() << "DataProxy_SQLite::getBands - DEPRECATED please use getBandNames - TODO: Remove this function and change the calls" << endl;
+ //qDebug() << "DataProxy_SQLite::getBands - DEPRECATED please use getBandNames - TODO: Remove this function and change the calls" << endl;
return getBandNames();
@@ -522,7 +522,7 @@ QStringList DataProxy_SQLite::getBands()
QStringList DataProxy_SQLite::getBandNames()
{
- //qDebug() << "DataProxy_SQLite::getBandNames" << endl;
+ //qDebug() << "DataProxy_SQLite::getBandNames" << endl;
QStringList bands = QStringList();
QSqlQuery query;
QString queryString;
@@ -537,7 +537,7 @@ QStringList DataProxy_SQLite::getBandNames()
if (query.isValid())
{
queryString = (query.value(0)).toString();
- //qDebug() << "DataProxy_SQLite::getBandNames: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getBandNames: " << queryString << endl;
bands.append(queryString);
}
else
@@ -577,31 +577,37 @@ QStringList DataProxy_SQLite::getModes()
QStringList DataProxy_SQLite::sortBandNamesBottonUp(const QStringList _qs)
{
//Receives a list of band names, sorts it from the lower band to the upper band and returns
- //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp: " << QString::number(_qs.length()) << endl;
+ //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp: " << QString::number(_qs.length()) << endl;
if (_qs.length()<2)
{
return _qs;
}
+ //Next lines to be commented out
+ //for (int i=0; i<_qs.length();i++)
+ //{
+ // //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp - band: " << _qs.at(i) << QString::number(i) << "/" << QString::number(_qs.length())<< endl;
+ //}
+ //Previous lines to be commented out
QMap map;
map.clear();
QStringList qs;
qs.clear();
- //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp-00" << endl;
+ //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp-00" << endl;
for (int j=0; j<_qs.count(); j++)
{
map.insert(getLowLimitBandFromBandName(_qs.at(j)), _qs.at(j));
}
- //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp-10" << endl;
+ //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp-10" << endl;
QMap::const_iterator i = map.constBegin();
- //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp-20" << endl;
+ //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp-20" << endl;
while (i != map.constEnd()) {
qs << i.value();
++i;
}
- //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp - END -lengh = " << QString::number(qs.length()) << endl;
+ //qDebug() << "DataProxy_SQLite::sortBandNamesBottonUp - END -lengh = " << QString::number(qs.length()) << endl;
qs.removeDuplicates();
return qs;
}
@@ -609,7 +615,7 @@ QStringList DataProxy_SQLite::sortBandNamesBottonUp(const QStringList _qs)
QStringList DataProxy_SQLite::getBandIDs()
{
- //qDebug() << "DataProxy_SQLite::getBandIDs" << endl;
+ //qDebug() << "DataProxy_SQLite::getBandIDs" << endl;
QStringList bands = QStringList();
QSqlQuery query("SELECT id FROM band");
@@ -662,7 +668,7 @@ QStringList DataProxy_SQLite::getModesIDs()
QStringList DataProxy_SQLite::getBandsInLog(const int _log)
{
- //qDebug() << "DataProxy_SQLite::getBandsInLog: " << endl;
+ //qDebug() << "DataProxy_SQLite::getBandsInLog: " << endl;
QStringList bands = QStringList();
QString queryString = QString();
if (_log <= 0)
@@ -688,7 +694,7 @@ QStringList DataProxy_SQLite::getBandsInLog(const int _log)
QStringList DataProxy_SQLite::getModesInLog(const int _log)
{
- //qDebug() << "DataProxy_SQLite::getModesInLog: " << endl;
+ //qDebug() << "DataProxy_SQLite::getModesInLog: " << endl;
QStringList modes = QStringList();
QString queryString = QString();
if (_log <=0 )
@@ -709,14 +715,14 @@ QStringList DataProxy_SQLite::getModesInLog(const int _log)
}
}
query.finish();
- //qDebug() << "DataProxy_SQLite::getModesInLog: " << modes.join(" - ") << endl;
+ //qDebug() << "DataProxy_SQLite::getModesInLog: " << modes.join(" - ") << endl;
modes.sort();
return modes;
}
int DataProxy_SQLite::getMostUsedBand(const int _log)
{
- //qDebug() << "DataProxy_SQLite::getMostUsedBand: " << endl;
+ //qDebug() << "DataProxy_SQLite::getMostUsedBand: " << endl;
QString queryString = QString();
if (_log <=0 )
@@ -738,7 +744,7 @@ int DataProxy_SQLite::getMostUsedBand(const int _log)
{
int v = query.value(0).toInt();
query.finish();
- //qDebug() << "DataProxy_SQLite::getMostUsedBand-OK: " << QString::number(v)<< endl;
+ //qDebug() << "DataProxy_SQLite::getMostUsedBand-OK: " << QString::number(v)<< endl;
return v;
}
}
@@ -747,16 +753,16 @@ int DataProxy_SQLite::getMostUsedBand(const int _log)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "DataProxy_SQLite::getMostUsedBand-ERROR-1: " << endl;
+ //qDebug() << "DataProxy_SQLite::getMostUsedBand-ERROR-1: " << endl;
return -1;
}
- //qDebug() << "DataProxy_SQLite::getMostUsedBand-ERROR-2: " << endl;
+ //qDebug() << "DataProxy_SQLite::getMostUsedBand-ERROR-2: " << endl;
return -2;
}
int DataProxy_SQLite::getMostUsedMode(const int _log)
{
- //qDebug() << "DataProxy_SQLite::getMostUsedMode: " << endl;
+ //qDebug() << "DataProxy_SQLite::getMostUsedMode: " << endl;
QString queryString = QString();
if (_log <=0 )
@@ -796,7 +802,7 @@ int DataProxy_SQLite::getMostUsedMode(const int _log)
int DataProxy_SQLite::getLastQSOid()
{
- //qDebug() << "DataProxy_SQLite::getLastQSOid" << endl;
+ //qDebug() << "DataProxy_SQLite::getLastQSOid" << endl;
QSqlQuery query;
bool sqlOK = query.exec("SELECT MAX(id) from log");
@@ -824,126 +830,27 @@ int DataProxy_SQLite::getLastQSOid()
}
-QDate DataProxy_SQLite::getFirstQSODateFromCall (const QString &_call)
-{
- //qDebug() << "DataProxy_SQLite::getFirstQSODateFromCall: " << _call << endl;
-
- QSqlQuery query;
- QString stringQuery;
- QDate _date;
- if (util->isValidCall(_call))
- {
- stringQuery = QString("SELECT qso_date from log where station_callsign='%1' ORDER BY qso_date ASC LIMIT 1").arg(_call);
- }
- else
- {
- stringQuery = QString("SELECT qso_date from log where 1 ORDER BY qso_date ASC LIMIT 1");
- }
-
- bool sqlOK = query.exec(stringQuery);
-
- if (sqlOK)
- {
- query.next();
- if (query.isValid())
- {
- _date = QDate::fromString((query.value(0)).toString(), "yyyy/MM/dd");
- //stringQuery = query.value(0).toString();
- query.finish();
- if (_date.isValid())
- {
- return _date;
- }
- else
- {
- return QDate();
- }
-
- }
- else
- {
- query.finish();
- return QDate();
- }
- }
- else
- {
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- query.finish();
- return QDate();
- }
-}
-
-QDate DataProxy_SQLite::getLastQSODateFromCall (const QString &_call)
-{
- //qDebug() << "DataProxy_SQLite::getLastQSODateFromCall: " << _call << endl;
- QSqlQuery query;
- QString stringQuery;
- QDate _date;
- if (util->isValidCall(_call))
- {
- stringQuery = QString("SELECT qso_date from log where station_callsign='%1' ORDER BY qso_date DESC LIMIT 1").arg(_call);
- }
- else
- {
- stringQuery = QString("SELECT qso_date from log where 1 ORDER BY qso_date DESC LIMIT 1");
- }
-
- bool sqlOK = query.exec(stringQuery);
-
- if (sqlOK)
- {
- query.next();
- if (query.isValid())
- {
- _date = QDate::fromString((query.value(0)).toString(), "yyyy/MM/dd");
- //stringQuery = query.value(0).toString();
- query.finish();
- if (_date.isValid())
- {
- return _date;
- }
- else
- {
- return QDate();
- }
-
- }
- else
- {
- query.finish();
- return QDate();
- }
- }
- else
- {
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- query.finish();
- return QDate();
- }
-}
-
bool DataProxy_SQLite::clearLog()
{
- //qDebug() << "DataProxy_SQLite::clearLog" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog" << endl;
//int errorCode = 0;
QSqlQuery query;
bool sqlOK = query.exec("DELETE FROM log");
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::clearLog: Log deleted!" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: Log deleted!" << endl;
}
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::clearLog: Log deleted FAILED" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: Log deleted FAILED" << endl;
//errorCode = query.lastError().number();
-
- //qDebug() << "DataProxy_SQLite::clearLog: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog - query error: " << QString::number(errorCode) << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-n: " << QString::number(query.lastError().number() ) << endl;
}
query.finish();
sqlOK = query.exec("DELETE FROM awarddxcc");
@@ -951,34 +858,34 @@ bool DataProxy_SQLite::clearLog()
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::clearLog: Awarddxcc deleted!" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: Awarddxcc deleted!" << endl;
}
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::clearLog: Awarddxcc deletedFAILED" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: Awarddxcc deletedFAILED" << endl;
- //qDebug() << "DataProxy_SQLite::clearLog - query error: " << QString::number(query.lastError().number()) << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog - query error: " << QString::number(query.lastError().number()) << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-n: " << QString::number(query.lastError().number() ) << endl;
}
query.finish();
if (query.exec("DELETE FROM awardwaz"))
{
- //qDebug() << "DataProxy_SQLite::clearLog: Awardwaz deleted!" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: Awardwaz deleted!" << endl;
}
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::clearLog: Awardwaz deleted FAILED" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: Awardwaz deleted FAILED" << endl;
//errorCode = query.lastError().number();
- //qDebug() << "DataProxy_SQLite::clearLog - query error: " << QString::number(query.lastError().number()) << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog - query error: " << QString::number(query.lastError().number()) << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-n: " << QString::number(query.lastError().number() ) << endl;
}
query.finish();
@@ -986,7 +893,7 @@ bool DataProxy_SQLite::clearLog()
if (query.isActive())
{
- //qDebug() << "DataProxy_SQLite::clearLog: Query Active!" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: Query Active!" << endl;
query.finish();
return false;
}
@@ -994,23 +901,23 @@ bool DataProxy_SQLite::clearLog()
{
query.prepare("VACUUM;");
- //qDebug() << "DataProxy_SQLite::clearLog: Query Not Active!" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: Query Not Active!" << endl;
if (query.exec())
{
- //qDebug() << "DataProxy_SQLite::clearLog: VACUUM OK!" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: VACUUM OK!" << endl;
query.finish();
return true;
}
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::clearLog: VACUUM FAILED" << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: VACUUM FAILED" << endl;
//errorCode = query.lastError().number();
- //qDebug() << "DataProxy_SQLite::clearLog - query error: " << QString::number(query.lastError().number()) << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "DataProxy_SQLite::clearLog: LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog - query error: " << QString::number(query.lastError().number()) << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "DataProxy_SQLite::clearLog: LastError-n: " << QString::number(query.lastError().number() ) << endl;
}
}
query.finish();
@@ -1019,11 +926,11 @@ bool DataProxy_SQLite::clearLog()
bool DataProxy_SQLite::qslSentViaDirect(const int _qsoId, const QString &_updateDate)
{
- //qDebug() << "DataProxy_SQLite::qslSentViaDirect" << endl;
+ //qDebug() << "DataProxy_SQLite::qslSentViaDirect" << endl;
QSqlQuery query;
QString queryString;
queryString = QString("UPDATE log SET qsl_sent = 'Y', qsl_sent_via = 'D', qslsdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
- //qDebug() << "DataProxy_SQLite::qslSentViaDirect: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::qslSentViaDirect: " << queryString << endl;
bool sqlOK = query.exec(queryString);
query.finish();
if (sqlOK)
@@ -1034,12 +941,13 @@ bool DataProxy_SQLite::qslSentViaDirect(const int _qsoId, const QString &_update
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
}
+
return false;
}
bool DataProxy_SQLite::qslSentViaBureau(const int _qsoId, const QString &_updateDate)
{
- //qDebug() << "DataProxy_SQLite::qslSentViaBureau" << endl;
+ //qDebug() << "DataProxy_SQLite::qslSentViaBureau" << endl;
QSqlQuery query;
QString queryString;
@@ -1061,7 +969,7 @@ bool DataProxy_SQLite::qslSentViaBureau(const int _qsoId, const QString &_update
bool DataProxy_SQLite::qslRecViaBureau(const int _qsoId, const QString &_updateDate)
{
- //qDebug() << "DataProxy_SQLite::" << QString::number (_qsoId) << "/" << _updateDate << endl;
+ //qDebug() << "DataProxy_SQLite::" << QString::number (_qsoId) << "/" << _updateDate << endl;
QSqlQuery query;
QString queryString;
@@ -1071,7 +979,7 @@ bool DataProxy_SQLite::qslRecViaBureau(const int _qsoId, const QString &_updateD
query.finish();
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite:: TRUE" << endl;
+ //qDebug() << "DataProxy_SQLite:: TRUE" << endl;
//setDXCCAwardStatus(_qsoId);
//setWAZAwardStatus(_qsoId);
return true;
@@ -1081,13 +989,13 @@ bool DataProxy_SQLite::qslRecViaBureau(const int _qsoId, const QString &_updateD
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
}
- //qDebug() << "DataProxy_SQLite:: FALSE" << endl;
+ //qDebug() << "DataProxy_SQLite:: FALSE" << endl;
return false;
}
bool DataProxy_SQLite::qslRecViaBureau(const int _qsoId, const QString &_updateDate, const bool _queueSentQSL)
{
- //qDebug() << "DataProxy_SQLite::qslRecViaBureau: " << _updateDate << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaBureau: " << _updateDate << endl;
QSqlQuery query;
QString queryString;
//bool requestQSL = false;
@@ -1109,27 +1017,27 @@ bool DataProxy_SQLite::qslRecViaBureau(const int _qsoId, const QString &_updateD
if ((queryString == "Y") || (queryString == "R"))
{
// NO ACTION REQUIRED, QSL IS ALREADY SENT
- //qDebug() << "DataProxy_SQLite::qslRecViaBureau: QSL already requested" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaBureau: QSL already requested" << endl;
//requestQSL = false;
queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'B', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
}
else
{
- //qDebug() << "DataProxy_SQLite::qslRecViaBureau: Request QSL-1" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaBureau: Request QSL-1" << endl;
//requestQSL = true;
queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'B', qsl_sent='R', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
}
}
else
{
- //qDebug() << "DataProxy_SQLite::qslRecViaBureau: Request QSL-2" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaBureau: Request QSL-2" << endl;
queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'B', qsl_sent='R', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
//requestQSL = true;
}
}
else
{
- //qDebug() << "DataProxy_SQLite::qslRecViaBureau: Request QSL-3" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaBureau: Request QSL-3" << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'B', qsl_sent='R', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
//requestQSL = true;
@@ -1148,7 +1056,7 @@ bool DataProxy_SQLite::qslRecViaBureau(const int _qsoId, const QString &_updateD
//queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'B', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::qslRecViaBureau TRUE" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaBureau TRUE" << endl;
query.finish();
//setDXCCAwardStatus(_qsoId);
//setWAZAwardStatus(_qsoId);
@@ -1160,14 +1068,14 @@ bool DataProxy_SQLite::qslRecViaBureau(const int _qsoId, const QString &_updateD
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
}
- //qDebug() << "DataProxy_SQLite::qslRecViaBureau FALSE" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaBureau FALSE" << endl;
query.finish();
return false;
}
bool DataProxy_SQLite::qslRecViaDirect(const int _qsoId, const QString &_updateDate)
{
- //qDebug() << "DataProxy_SQLite::qslRecViaDirect" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaDirect" << endl;
QSqlQuery query;
QString queryString;
queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'D', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
@@ -1190,7 +1098,7 @@ bool DataProxy_SQLite::qslRecViaDirect(const int _qsoId, const QString &_updateD
bool DataProxy_SQLite::qslRecViaDirect(const int _qsoId, const QString &_updateDate, const bool _queueSentQSL)
{
- //qDebug() << "DataProxy_SQLite::qslRecViaDirect: " << _updateDate << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaDirect: " << _updateDate << endl;
QSqlQuery query;
QString queryString;
bool sqlOK;
@@ -1209,25 +1117,25 @@ bool DataProxy_SQLite::qslRecViaDirect(const int _qsoId, const QString &_updateD
if ((queryString == "Y") || (queryString == "R"))
{
// NO ACTION REQUIRED, QSL IS ALREADY SENT
- //qDebug() << "DataProxy_SQLite::qslRecViaDirect: QSL already requested" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaDirect: QSL already requested" << endl;
queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'D', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
}
else
{
- //qDebug() << "DataProxy_SQLite::qslRecViaDirect: Request QSL-1" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaDirect: Request QSL-1" << endl;
queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'D', qsl_sent='R', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
}
}
else
{
- //qDebug() << "DataProxy_SQLite::qslRecViaDirect: Request QSL-2" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaDirect: Request QSL-2" << endl;
queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'D', qsl_sent='R', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
}
}
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::qslRecViaDirect: Request QSL-3" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaDirect: Request QSL-3" << endl;
queryString = QString("UPDATE log SET qsl_rcvd = 'Y', qsl_rcvd_via = 'D', qsl_sent='R', qslrdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
}
@@ -1242,7 +1150,7 @@ bool DataProxy_SQLite::qslRecViaDirect(const int _qsoId, const QString &_updateD
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::qslRecViaDirect TRUE" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaDirect TRUE" << endl;
query.finish();
//setDXCCAwardStatus(_qsoId);
//setWAZAwardStatus(_qsoId);
@@ -1253,7 +1161,7 @@ bool DataProxy_SQLite::qslRecViaDirect(const int _qsoId, const QString &_updateD
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
}
- //qDebug() << "DataProxy_SQLite::qslRecViaDirect FALSE" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecViaDirect FALSE" << endl;
query.finish();
return false;
}
@@ -1262,17 +1170,17 @@ bool DataProxy_SQLite::qslRecViaDirect(const int _qsoId, const QString &_updateD
bool DataProxy_SQLite::qslSentAsRequested(const int _qsoId, const QString &_updateDate)
{
//TODO: Add some protection to the data before modifying
- //qDebug() << "DataProxy_SQLite::qslSentAsRequested" << endl;
+ //qDebug() << "DataProxy_SQLite::qslSentAsRequested" << endl;
QSqlQuery query;
QString queryString;
queryString = QString("UPDATE log SET qsl_sent = 'R', qslsdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
- //qDebug() << "DataProxy_SQLite::qslSentAsRequested: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::qslSentAsRequested: " << queryString << endl;
bool sqlOK = query.exec(queryString);
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::qslSentAsRequested" << endl;
+ //qDebug() << "DataProxy_SQLite::qslSentAsRequested" << endl;
query.finish();
return true;
}
@@ -1287,17 +1195,17 @@ bool DataProxy_SQLite::qslSentAsRequested(const int _qsoId, const QString &_upda
bool DataProxy_SQLite::qslRecAsRequested(const int _qsoId, const QString &_updateDate)
{
//TODO: Add some protection to the data before modifying
- //qDebug() << "DataProxy_SQLite::qslRecAsRequested" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecAsRequested" << endl;
QSqlQuery query;
QString queryString;
queryString = QString("UPDATE log SET qsl_rcvd = 'R', qslsdate = '%1' WHERE id = '%2'").arg(_updateDate).arg(_qsoId);
- //qDebug() << "DataProxy_SQLite::qslRecAsRequested: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecAsRequested: " << queryString << endl;
bool sqlOK = query.exec(queryString);
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::qslRecAsRequested" << endl;
+ //qDebug() << "DataProxy_SQLite::qslRecAsRequested" << endl;
query.finish();
return true;
}
@@ -1315,12 +1223,12 @@ bool DataProxy_SQLite::setClubLogSent(const int _qsoId, const QString &_st, cons
QSqlQuery query;
QString queryString;
queryString = QString("UPDATE log SET clublog_qso_upload_status = '%1', clublog_qso_upload_date = '%2' WHERE id = '%3'").arg(_st).arg(_updateDate).arg(_qsoId);
- //qDebug() << "DataProxy_SQLite::setClubLogSent: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::setClubLogSent: " << queryString << endl;
bool sqlOK = query.exec(queryString);
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::setClubLogSent - TRUE" << endl;
+ //qDebug() << "DataProxy_SQLite::setClubLogSent - TRUE" << endl;
query.finish();
return true;
}
@@ -1328,7 +1236,7 @@ bool DataProxy_SQLite::setClubLogSent(const int _qsoId, const QString &_st, cons
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
}
- //qDebug() << "DataProxy_SQLite::setClubLogSent - FALSE" << endl;
+ //qDebug() << "DataProxy_SQLite::setClubLogSent - FALSE" << endl;
query.finish();
return false;
}
@@ -1337,7 +1245,7 @@ bool DataProxy_SQLite::setClubLogSent(const int _qsoId, const QString &_st, cons
bool DataProxy_SQLite::isQSLReceived(const int _qsoId)
{
- //qDebug() << "DataProxy_SQLite::isQSLReceived" << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::isQSLReceived" << QString::number(_qsoId) << endl;
QSqlQuery query;
QString queryString;
queryString = QString("SELECT qsl_rcvd FROM log WHERE id = '%1'").arg(_qsoId);
@@ -1353,18 +1261,18 @@ bool DataProxy_SQLite::isQSLReceived(const int _qsoId)
query.finish();
if (queryString == "Y")
{
- //qDebug() << "DataProxy_SQLitew::isQSLReceived: " << QString::number(_qsoId) << "QSL Received" << endl;
+ //qDebug() << "DataProxy_SQLitew::isQSLReceived: " << QString::number(_qsoId) << "QSL Received" << endl;
return true;
}
else
{
- //qDebug() << "DataProxy_SQLite::isQSLReceived: " << QString::number(_qsoId) << "QSL NOT Received-1" << endl;
+ //qDebug() << "DataProxy_SQLite::isQSLReceived: " << QString::number(_qsoId) << "QSL NOT Received-1" << endl;
return false;
}
}
else
{
- //qDebug() << "DataProxy_SQLite::isQSLReceived: " << QString::number(_qsoId) << "QSL NOT Received-2" << endl;
+ //qDebug() << "DataProxy_SQLite::isQSLReceived: " << QString::number(_qsoId) << "QSL NOT Received-2" << endl;
query.finish();
return false;
}
@@ -1381,7 +1289,7 @@ bool DataProxy_SQLite::isQSLReceived(const int _qsoId)
bool DataProxy_SQLite::isQSLSent(const int _qsoId)
{
- //qDebug() << "DataProxy_SQLite::isQSLSent: " << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::isQSLSent: " << QString::number(_qsoId) << endl;
QSqlQuery query;
QString queryString;
queryString = QString("SELECT qsl_sent FROM log WHERE id = '%1'").arg(_qsoId);
@@ -1397,18 +1305,18 @@ bool DataProxy_SQLite::isQSLSent(const int _qsoId)
query.finish();
if (queryString == "Y")
{
- //qDebug() << "DataProxy_SQLite::isQSLSent: " << QString::number(_qsoId) << "QSL Sent" << endl;
+ //qDebug() << "DataProxy_SQLite::isQSLSent: " << QString::number(_qsoId) << "QSL Sent" << endl;
return true;
}
else
{
- //qDebug() << "DataProxy_SQLite::isQSLSent: " << QString::number(_qsoId) << "QSL NOT Sent-1" << endl;
+ //qDebug() << "DataProxy_SQLite::isQSLSent: " << QString::number(_qsoId) << "QSL NOT Sent-1" << endl;
return false;
}
}
else
{
- //qDebug() << "DataProxy_SQLite::isQSLSent: " << QString::number(_qsoId) << "QSL NOT Sent-2" << endl;
+ //qDebug() << "DataProxy_SQLite::isQSLSent: " << QString::number(_qsoId) << "QSL NOT Sent-2" << endl;
return false;
}
}
@@ -1541,7 +1449,7 @@ int DataProxy_SQLite::getCQZFromId(const int _qsoId)
QString DataProxy_SQLite::getCallFromId(const int _qsoId)
{
- //qDebug() << "DataProxy_SQLite::getCallFromId" << endl;
+ //qDebug() << "DataProxy_SQLite::getCallFromId" << endl;
QSqlQuery query;
QString queryString = QString("SELECT call FROM log WHERE id='%1'").arg(_qsoId);
bool sqlOK = query.exec(queryString);
@@ -1572,7 +1480,7 @@ QString DataProxy_SQLite::getCallFromId(const int _qsoId)
QStringList DataProxy_SQLite::getClubLogRealTimeFromId(const int _qsoId)
{
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: " << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: " << QString::number(_qsoId) << endl;
/* Return a QStringList with 16 fields with these data:
QSO_DATE, TIME_ON, QSLRDATE, QSLSDATE, CALL, OPERATOR, MODE, BAND, BAND_RX, FREQ, QSL_RCVD,
@@ -1600,7 +1508,7 @@ LOTW_QSL_RCVD, QSL_SENT, DXCC, PROP_MODE, CREDIT_GRANTED
{
QSqlRecord rec = query.record();
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId sqlOK" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId sqlOK" << endl;
if (query.next())
//if (1)
{
@@ -1612,14 +1520,14 @@ LOTW_QSL_RCVD, QSL_SENT, DXCC, PROP_MODE, CREDIT_GRANTED
aux1 = (query.value(nameCol)).toString();
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time: " << aux1 << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time: " << aux1 << endl;
if ( ((aux1.length()) == 5) || ((aux1.length()) == 8) ){
aux1.remove(QChar(':'), Qt::CaseInsensitive);
dataC << aux1;
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time1.5: " << aux1 << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time1.5: " << aux1 << endl;
}
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time2: " << aux1 << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time2: " << aux1 << endl;
@@ -1673,13 +1581,13 @@ LOTW_QSL_RCVD, QSL_SENT, DXCC, PROP_MODE, CREDIT_GRANTED
//dataC << (query.value(nameCol)).toString();
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: RETURNING ... OK" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: RETURNING ... OK" << endl;
return dataC;
}
else
{
//NO VALID
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NO VALID NOT OK" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NO VALID NOT OK" << endl;
query.finish();
return QStringList();
}
@@ -1688,7 +1596,7 @@ LOTW_QSL_RCVD, QSL_SENT, DXCC, PROP_MODE, CREDIT_GRANTED
{
QString queryString = QString("SELECT qso_date, time_on, qslrdate, qslsdate, call, station_callsign, operator, M.name, B.name, freq, qsl_rcvd, lotw_qsl_rcvd, qsl_sent, dxcc, prop_mode, credit_granted FROM log INNER JOIN band as B ON bandid = B.id INNER JOIN mode as M ON modeid = M.id WHERE log.id='%1'").arg(_qsoId);
//QString queryString = QString("SELECT qso_date, time_on, qslrdate, qslsdate, call, operator, M.name, B.name, freq, qsl_rcvd, lotw_qsl_rcvd, qsl_sent, dxcc, prop_mode, credit_granted FROM log INNER JOIN band as B ON bandid = B.id INNER JOIN mode as M ON modeid = M.id WHERE log.id='%1'").arg(_qsoId);
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NO NEXT NOT OK" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NO NEXT NOT OK" << endl;
call = QString();
sqlOk = query2.exec(queryString);
@@ -1696,10 +1604,10 @@ LOTW_QSL_RCVD, QSL_SENT, DXCC, PROP_MODE, CREDIT_GRANTED
rec = query2.record();
if (sqlOk)
{
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId OK2" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId OK2" << endl;
if (query2.next())
{
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NEXT OK2" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NEXT OK2" << endl;
if (query2.isValid())
{
nameCol = rec.indexOf("qso_date");
@@ -1707,14 +1615,14 @@ LOTW_QSL_RCVD, QSL_SENT, DXCC, PROP_MODE, CREDIT_GRANTED
nameCol = rec.indexOf("time_on");
aux1 = (query2.value(nameCol)).toString();
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time2-1: " << aux1 << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time2-1: " << aux1 << endl;
if ( ((aux1.length()) == 5) || ((aux1.length()) == 8) ){
aux1.remove(QChar(':'), Qt::CaseInsensitive);
dataC << aux1;
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time2-1.5: " << aux1 << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time2-1.5: " << aux1 << endl;
}
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time2-2: " << aux1 << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId time2-2: " << aux1 << endl;
//dataC << (query.value(nameCol)).toString();
@@ -1764,21 +1672,21 @@ LOTW_QSL_RCVD, QSL_SENT, DXCC, PROP_MODE, CREDIT_GRANTED
}
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: RETURNING ... OK" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: RETURNING ... OK" << endl;
query2.finish();
return dataC;
}
else
{
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NO VALID NOT OK2" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NO VALID NOT OK2" << endl;
query2.finish();
return QStringList();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NO NEXT NOT OK2" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NO NEXT NOT OK2" << endl;
query.finish();
return QStringList();
}
@@ -1788,7 +1696,7 @@ LOTW_QSL_RCVD, QSL_SENT, DXCC, PROP_MODE, CREDIT_GRANTED
}
else
{
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NOT OK2" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NOT OK2" << endl;
emit queryError(Q_FUNC_INFO, query2.lastError().databaseText(), query2.lastError().number(), query2.lastQuery());
query2.finish();
return QStringList();
@@ -1800,18 +1708,18 @@ LOTW_QSL_RCVD, QSL_SENT, DXCC, PROP_MODE, CREDIT_GRANTED
}
else
{
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NOT sqlOK" << endl;
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: 2 LastQuery: " << query.lastQuery() << endl;
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: 2 LastError-data: " << query.lastError().databaseText() << endl;
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: 2 LastError-driver: " << query.lastError().driverText() << endl;
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: 2 LastError-n: " << QString::number(query.lastError().number() ) << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId NOT sqlOK" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: 2 LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: 2 LastError-data: " << query.lastError().databaseText() << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: 2 LastError-driver: " << query.lastError().driverText() << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId: 2 LastError-n: " << QString::number(query.lastError().number() ) << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return QStringList();
}
//query.finish();
//query2.finish();
- //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId END NOT OK" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogRealTimeFromId END NOT OK" << endl;
//return QStringList();
}
@@ -1819,7 +1727,7 @@ QString DataProxy_SQLite::getNameFromQRZ(const QString &_call)
{
if (_call.length() <= 0)
{
- //qDebug() << "DataProxy_SQLite::getNameFromQRZ return 0" << endl;
+ //qDebug() << "DataProxy_SQLite::getNameFromQRZ return 0" << endl;
return QString();
}
@@ -1836,7 +1744,7 @@ QString DataProxy_SQLite::getNameFromQRZ(const QString &_call)
{
if (((query.value(0)).toString()).length()>0)
{
- //qDebug() << "DataProxy_SQLite::getNameFromQRZ: " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataProxy_SQLite::getNameFromQRZ: " << (query.value(0)).toString() << endl;
QString v = (query.value(0)).toString();
query.finish();
return v;
@@ -1963,6 +1871,7 @@ QString DataProxy_SQLite::getIOTAFromQRZ(const QString &_call)
query.finish();
return QString();
}
+
}
@@ -2004,15 +1913,15 @@ QString DataProxy_SQLite::getQSLViaFromQRZ(const QString &_call)
bool DataProxy_SQLite::updateAwardDXCC()
{
- //qDebug() << "DataProxy_SQLite::updateAwardDXCC" << endl;
+ //qDebug() << "DataProxy_SQLite::updateAwardDXCC" << endl;
fillEmptyDXCCInTheLog();
return db->updateAwardDXCCTable();
- //qDebug() << "DataProxy_SQLite::updateAwardDXCC-END" << endl;
+ //qDebug() << "DataProxy_SQLite::updateAwardDXCC-END" << endl;
}
bool DataProxy_SQLite::updateAwardWAZ()
{
- //qDebug() << "DataProxy_SQLite::updateAwardWAZ" << endl;
+ //qDebug() << "DataProxy_SQLite::updateAwardWAZ" << endl;
return db->updateAwardWAZTable();
}
@@ -2021,7 +1930,7 @@ bool DataProxy_SQLite::addQSOFromWSJTX(const QString &_dxcall, const double _fre
const QString &_tx_power, const QString &_comments, const QString &_name, const QString &_time_on,
const int _dxcc, const QString &_opQrz, const QString &_stQrz, const QString &_myLoc, const int _logN)
{
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: " << _dxcall << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: " << _dxcall << endl;
//void MainWindow::slotWSJTXloggedQSO(const int _type, const QString &_dxcall, const quint64 _freq, const QString &_mode,
// const QString &_dx_grid, const QString &_time_off, const QString &_report_sent, const QString &_report_rec,
@@ -2054,7 +1963,7 @@ bool DataProxy_SQLite::addQSOFromWSJTX(const QString &_dxcall, const double _fre
}
else
{
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: call" << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: call" << endl;
return false;
}
@@ -2065,15 +1974,15 @@ bool DataProxy_SQLite::addQSOFromWSJTX(const QString &_dxcall, const double _fre
}
else
{
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: time-on" << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: time-on" << endl;
return false;
}
QString _band;
_band = QString::number(_freq);
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: freq: " << QString::number(_freq) << endl;
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: freq: " << QString::number(_freq/1000) << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: freq: " << QString::number(_freq) << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: freq: " << QString::number(_freq/1000) << endl;
if (_band.length()>0)
{
stringFields = stringFields + "bandid, " ;
@@ -2084,7 +1993,7 @@ bool DataProxy_SQLite::addQSOFromWSJTX(const QString &_dxcall, const double _fre
}
else
{
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: band" << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: band" << endl;
emit queryError(Q_FUNC_INFO, "Incorrect band: " + _band, -1000 , "No query error");
@@ -2092,8 +2001,8 @@ bool DataProxy_SQLite::addQSOFromWSJTX(const QString &_dxcall, const double _fre
}
int _modeid = getSubModeIdFromSubMode(_mode);
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: mode: " << _mode << endl;
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: modeid: " << QString::number(_modeid) << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: mode: " << _mode << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: modeid: " << QString::number(_modeid) << endl;
if (util->isValidModeId(_modeid))
{
stringFields = stringFields + "modeid, ";
@@ -2101,7 +2010,7 @@ bool DataProxy_SQLite::addQSOFromWSJTX(const QString &_dxcall, const double _fre
}
else
{
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: mode" << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: mode" << endl;
emit queryError(Q_FUNC_INFO, "Incorrect mode: " + _mode, -1000, "No query error");
return false;
}
@@ -2189,23 +2098,23 @@ bool DataProxy_SQLite::addQSOFromWSJTX(const QString &_dxcall, const double _fre
}
*/
stringQuery = "INSERT INTO log (" + stringFields + ") values (" + stringData +")" ;
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Query: " << stringQuery << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Query: " << stringQuery << endl;
bool sqlOK = query.exec(stringQuery);
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: LastQuery: " << query.lastQuery() << endl;
if (sqlOK)
{
query.finish();
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: SQL OK" << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: SQL OK" << endl;
return true;
}
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: SQL " << endl;
+ //qDebug() << "DataProxy_SQLite::addQSOFromWSJTX: Error: SQL " << endl;
return false;
}
@@ -2213,7 +2122,7 @@ bool DataProxy_SQLite::addQSOFromWSJTX(const QString &_dxcall, const double _fre
bool DataProxy_SQLite::deleteQSO(const int _qsoId)
{
- //qDebug() << "DataProxy_SQLite::deleteQSO" << endl;
+ //qDebug() << "DataProxy_SQLite::deleteQSO" << endl;
QSqlQuery query;
QString queryString = QString("DELETE FROM log WHERE id='%1'").arg(_qsoId);
bool sqlOK = query.exec(queryString);
@@ -2233,7 +2142,7 @@ bool DataProxy_SQLite::deleteQSO(const int _qsoId)
int DataProxy_SQLite::isWorkedB4(const QString &_qrz, const int _currentLog)
{
- //qDebug() << "DataProxy_SQLite::isWorkedB4" << endl;
+ //qDebug() << "DataProxy_SQLite::isWorkedB4" << endl;
//Returns the QSO id
QSqlQuery query;
QString queryString;
@@ -2274,7 +2183,7 @@ int DataProxy_SQLite::isWorkedB4(const QString &_qrz, const int _currentLog)
bool DataProxy_SQLite::isThisQSODuplicated(const QString &_qrz, const QString &_date, const QString &_time, const int _band, const int _mode)
{
- //qDebug() << "DataProxy_SQLite::isThisQSODuplicated" << endl;
+ //qDebug() << "DataProxy_SQLite::isThisQSODuplicated" << endl;
QSqlQuery query;
QString queryString;
@@ -2315,7 +2224,7 @@ bool DataProxy_SQLite::isThisQSODuplicated(const QString &_qrz, const QString &_
int DataProxy_SQLite::getDuplicatedQSOId(const QString &_qrz, const QString &_date, const QString &_time, const int _band, const int _mode)
{
- //qDebug() << "DataProxy_SQLite::isThisQSODuplicated" << endl;
+ //qDebug() << "DataProxy_SQLite::isThisQSODuplicated" << endl;
QSqlQuery query;
QString queryString;
int qsoId = -1;
@@ -2359,7 +2268,7 @@ int DataProxy_SQLite::getDuplicatedQSOId(const QString &_qrz, const QString &_da
bool DataProxy_SQLite::isDXCCConfirmed(const int _dxcc, const int _currentLog)
{
- //qDebug() << "DataProxy_SQLite::isDXCCConfirmed: " << QString::number(_dxcc) << "/" << QString::number(_currentLog) << endl;
+ //qDebug() << "DataProxy_SQLite::isDXCCConfirmed: " << QString::number(_dxcc) << "/" << QString::number(_currentLog) << endl;
QString queryString = QString("SELECT confirmed from awarddxcc WHERE dxcc='%1' AND lognumber='%2'").arg(_dxcc).arg(_currentLog);
QSqlQuery query;
@@ -2372,20 +2281,20 @@ bool DataProxy_SQLite::isDXCCConfirmed(const int _dxcc, const int _currentLog)
{
if ( (query.value(0)).toInt() == 1)
{
- //qDebug() << "DataProxy_SQLite::isDXCCConfrmed: TRUE" << endl;
+ //qDebug() << "DataProxy_SQLite::isDXCCConfrmed: TRUE" << endl;
query.finish();
return true;
}
else
{
- //qDebug() << "DataProxy_SQLite::isDXCCConfrmed: FALSE1" << endl;
+ //qDebug() << "DataProxy_SQLite::isDXCCConfrmed: FALSE1" << endl;
query.finish();
return false;
}
}
else
{
- //qDebug() << "DataProxy_SQLite::isDXCCConfrmed: FALSE2" << endl;
+ //qDebug() << "DataProxy_SQLite::isDXCCConfrmed: FALSE2" << endl;
query.finish();
return false;
}
@@ -2393,7 +2302,7 @@ bool DataProxy_SQLite::isDXCCConfirmed(const int _dxcc, const int _currentLog)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::isDXCCConfrmed: FALSE3" << endl;
+ //qDebug() << "DataProxy_SQLite::isDXCCConfrmed: FALSE3" << endl;
query.finish();
return false;
}
@@ -2403,12 +2312,12 @@ bool DataProxy_SQLite::isHF(const int _band)
{// 160M is considered as HF
if ( (_band>=getIdFromBandName("10M")) && (_band<=getIdFromBandName("160M")) )
{
- //qDebug() << "DataProxy_SQLite::isHF: TRUE" << endl;
+ //qDebug() << "DataProxy_SQLite::isHF: TRUE" << endl;
return true;
}
else
{
- //qDebug() << "DataProxy_SQLite::isHF: FALSE" << endl;
+ //qDebug() << "DataProxy_SQLite::isHF: FALSE" << endl;
return false;
}
}
@@ -2417,12 +2326,12 @@ bool DataProxy_SQLite::isWARC(const int _band)
{
if ( (_band==getIdFromBandName("12M")) || (_band==getIdFromBandName("17M")) || ((_band==getIdFromBandName("30M")) ) )
{
- //qDebug() << "DataProxy_SQLite::isWARC: tRUE" << endl;
+ //qDebug() << "DataProxy_SQLite::isWARC: tRUE" << endl;
return true;
}
else
{
- //qDebug() << "DataProxy_SQLite::isWARC: FALSE" << endl;
+ //qDebug() << "DataProxy_SQLite::isWARC: FALSE" << endl;
return false;
}
}
@@ -2431,12 +2340,12 @@ bool DataProxy_SQLite::isVHF(const int _band)
{
if (_band<=getIdFromBandName("6M"))
{
- //qDebug() << "DataProxy_SQLite::isVHF: TRUE" << endl;
+ //qDebug() << "DataProxy_SQLite::isVHF: TRUE" << endl;
return true;
}
else
{
- //qDebug() << "DataProxy_SQLite::isVHF: FALSE" << endl;
+ //qDebug() << "DataProxy_SQLite::isVHF: FALSE" << endl;
return false;
}
}
@@ -2445,19 +2354,19 @@ bool DataProxy_SQLite::isUHF(const int _band)
{
if (_band<=getIdFromBandName("70CM"))
{
- //qDebug() << "DataProxy_SQLite::isUHF: TRUE" << endl;
+ //qDebug() << "DataProxy_SQLite::isUHF: TRUE" << endl;
return true;
}
else
{
- //qDebug() << "DataProxy_SQLite::isUHF: FALSE" << endl;
+ //qDebug() << "DataProxy_SQLite::isUHF: FALSE" << endl;
return false;
}
}
QStringList DataProxy_SQLite::getOperatingYears(const int _currentLog)
{
- //qDebug() << "DataProxy_SQLite::getYearsOperating: " << QString::number(_currentLog) << endl;
+ //qDebug() << "DataProxy_SQLite::getYearsOperating: " << QString::number(_currentLog) << endl;
QStringList years = QStringList();
//QStringList yearsSorted = QStringList();
QSqlQuery query;
@@ -2473,27 +2382,27 @@ QStringList DataProxy_SQLite::getOperatingYears(const int _currentLog)
QString year = QString();
- //qDebug() << "DataProxy_SQLite::getYearsOperating: -1" << endl;
+ //qDebug() << "DataProxy_SQLite::getYearsOperating: -1" << endl;
bool sqlOk = query.exec(queryString);
if (sqlOk)
{
- //qDebug() << "DataProxy_SQLite::getYearsOperating: sqlOk = true" << endl;
+ //qDebug() << "DataProxy_SQLite::getYearsOperating: sqlOk = true" << endl;
while (query.next())
{
if (query.isValid())
{
year = (query.value(0)).toString();
- //qDebug() << "DataProxy_SQLite::getYearsOperating: year=" << year << endl;
+ //qDebug() << "DataProxy_SQLite::getYearsOperating: year=" << year << endl;
years << year;
year.clear();
}
else
{
- //qDebug() << "DataProxy_SQLite::getYearsOperating: NOT VALID" << endl;
+ //qDebug() << "DataProxy_SQLite::getYearsOperating: NOT VALID" << endl;
}
}
- //qDebug() << "DataProxy_SQLite::getYearsOperating: END OK - " << QString::number(years.size())<< endl;
+ //qDebug() << "DataProxy_SQLite::getYearsOperating: END OK - " << QString::number(years.size())<< endl;
query.finish();
//return years;
if (years.length()>0)
@@ -2505,7 +2414,7 @@ QStringList DataProxy_SQLite::getOperatingYears(const int _currentLog)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getYearsOperating: sqlOk = false" << endl;
+ //qDebug() << "DataProxy_SQLite::getYearsOperating: sqlOk = false" << endl;
}
return years;
}
@@ -2524,7 +2433,7 @@ bool DataProxy_SQLite::lotwSentQueue(const QString &_updateDate, const int _curr
{// Mark LOTW QSL SENT as Q (Queued)
// If currentLog <0 ALL the QSO of the log will be queued
- //qDebug() << "DataProxy_SQLite::lotwSentQueue: Date:" << _updateDate << " /" << QString::number(_currentLog) << endl;
+ //qDebug() << "DataProxy_SQLite::lotwSentQueue: Date:" << _updateDate << " /" << QString::number(_currentLog) << endl;
QString queryString;
if (_currentLog<1)
@@ -2556,7 +2465,7 @@ bool DataProxy_SQLite::lotwSentYes(const QString &_updateDate, const int _curren
{// Mark LOTW QSL SENT as Q (Queued)
// If currentLog <0 ALL the QSO of the log will be queued
- //qDebug() << "DataProxy_SQLite::lotwSentQueue: " << QString::number(_currentLog) << endl;
+ //qDebug() << "DataProxy_SQLite::lotwSentQueue: " << QString::number(_currentLog) << endl;
QString queryString;
@@ -2603,276 +2512,11 @@ bool DataProxy_SQLite::lotwSentYes(const QString &_updateDate, const int _curren
return false;
}
-bool DataProxy_SQLite::lotwSentQSOs(const QList &_qsos)
-{
- //qDebug() << " DataProxy_SQLite::lotwSentQSOs" << QString::number(_qsos.count()) << endl;
- if (_qsos.count() < 1)
- {
- return true;
- }
- QString queryString;
- bool sqlOK;
- QSqlQuery query;
- for (int i = 0; i< _qsos.count(); i++)
- {
- //qDebug() << " DataProxy_SQLite::lotwSentQSOs: updating QSO: " << QString::number(_qsos.at(i)) << endl;
- queryString = QString("UPDATE log SET lotw_qsl_sent = 'Y', lotw_qslsdate = '%1' WHERE id='%2'").arg((QDate::currentDate()).toString("yyyy/MM/dd")).arg(QString::number(_qsos.at(i)));
- sqlOK = query.exec(queryString);
- query.finish();
- if (sqlOK)
- {
- //qDebug() << " DataProxy_SQLite::lotwSentQSOs: exec: " << query.lastQuery() << endl;
- }
- else
- {
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << " DataProxy_SQLite::lotwSentQSOs: END FALSE" << endl;
- return false;
- }
- }
- //qDebug() << " DataProxy_SQLite::lotwSentQSOs: END TRUE" << endl;
- return true;
-}
-
-int DataProxy_SQLite::lotwUpdateQSLReception (const QString &_call, const QString &_qso_date, const QString &_time_on, const QString &_band, const QString &_mode, const QString &_qslrdate)
-{ //Returns the QSO id updated or -1 if none was updated.
-
- int bandid = getIdFromBandName(_band);
- int modeid = getIdFromModeName(_mode);
- QString qso_date;
- if (_qso_date.contains('/'))
- {
- qso_date = _qso_date;
- }
- else
- {
- qso_date = (QDate::fromString(_qso_date, "yyyyMMdd")).toString("yyyy/MM/dd");
-
- }
-
- QString timeon;
- if (_time_on.contains(':'))
- {
- timeon = _time_on;
- }
- else
- {
- timeon = (QTime::fromString(_time_on, "hhmmss")).toString("hh:mm:ss");
-
- }
-
-
- QString queryString;
- queryString = QString("SELECT id, lotw_qsl_rcvd FROM log WHERE call='%1' AND qso_date='%2' AND time_on='%3' AND bandid='%4' AND modeid='%5'").arg(_call).arg(qso_date).arg(timeon).arg(bandid).arg(modeid);
-
- QSqlQuery query;
-
- bool sqlOK = query.exec(queryString);
- if (sqlOK)
- {
- query.next();
- if (query.isValid())
- {
- int id = (query.value(0)).toInt();
- QString _lotwQSLReceived = (query.value(1).toString());
-
- if (( id > 0) && (_lotwQSLReceived!="Y"))
- {
- query.finish();
-
-
- QString qslrdate;
- if (_qslrdate.contains('/'))
- {
- qslrdate = _qslrdate;
- }
- else
- {
- qslrdate = (QDate::fromString(_qslrdate, "yyyyMMdd")).toString("yyyy/MM/dd");
-
- }
-
- //QString qslsdate = (QDate::fromString(_qslsdate, "yyyyMMdd")).toString("yyyy/MM/dd");
- //QString qslrdate = (QDate::fromString(_qslrdate, "yyyyMMdd")).toString("yyyy/MM/dd");
- queryString = QString("UPDATE log SET lotw_qsl_rcvd = 'Y', lotw_qslrdate = '%1' WHERE id='%2'").arg(qslrdate).arg(QString::number(id));
-
- sqlOK = query.exec(queryString);
- query.finish();
- if (sqlOK)
- {
- return id;
- }
- else
- {
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- return -4;
- }
- }
- else
- {
- //qDebug() << "DataProxy_SQLite::lotwUpdateQSLReception ID Not found" << endl;
- query.finish();
- return -1;
- }
- }
- else
- {
- //qDebug() << "DataProxy_SQLite::lotwUpdateQSLReception Query not valid: " << query.lastQuery() << endl;
-
- query.finish();
- return -2;
- }
- }
- else
- {
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- }
- query.finish();
- return -3;
-}
-
-QList DataProxy_SQLite::getQSOsListLoTWNotSent(const QString &_stationCallsign, const QDate &_startDate, const QDate &_endDate, bool _justQueued)
-{
- //qDebug() << "DataProxy_SQLite::getQSOsListLoTWNotSent Call/Start/end: " << _stationCallsign << _startDate.toString("yyyyMMdd") << "/" << _endDate.toString("yyyyMMdd") << endl;
- QList qsoList;
- qsoList.clear();
- QDate tmpDate;
- QString aux = QString();
- QStringList qs;
- qs.clear();
- QString queryString;
-
- QString _queryST_string;
- if (util->isValidCall(_stationCallsign))
- {
- _queryST_string = QString("station_callsign='%1'").arg(_stationCallsign);
- }
- else if (_stationCallsign == "ALL")
- {
- _queryST_string = QString("station_callsign!='ALL'");
- }
- else
- {
- _queryST_string = QString("station_callsign=''");
- }
-
- QString _query_justQueued;
- if (_justQueued)
- {
- _query_justQueued = QString("lotw_qsl_sent='Q'");
- }
- else
- {
- _query_justQueued = QString("lotw_qsl_sent!='1'");
- }
-
- queryString = QString("SELECT id, qso_date FROM log WHERE ") + _queryST_string + " AND " + _query_justQueued;
-
- /*
- if (justQueued)
- {
- queryString = QString("SELECT id, qso_date FROM log WHERE station_callsign='%1' AND lotw_qsl_sent='Q'").arg(_stationCallsign);
- }
- else
- {
- queryString = QString("SELECT id, qso_date FROM log WHERE station_callsign='%1' ").arg(_stationCallsign);
- }
- */
-
-
- QSqlQuery query;
-
- bool sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::getQSOsListLoTWNotSent Query: " << query.lastQuery() << endl;
-
- if (sqlOK)
- {
- // //qDebug() << "DataProxy_SQLite::getQSOsListLoTWNotSent Query: " << query.lastQuery() << endl;
-
- while ( (query.next())) {
- if (query.isValid())
- {
- aux.clear();
- aux = (query.value(1)).toString() ;
- tmpDate = QDate::fromString(aux, "yyyy/MM/dd");
- if ((_startDate<=tmpDate) && _endDate>=tmpDate)
- {
- qsoList.append((query.value(0)).toInt());
- }
- }
- else
- {
- }
- }
- }
- else
- {
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- query.finish();
- qsoList.clear();
- return qsoList;
- }
- query.finish();
- qs.sort();
- return qsoList;
-
-}
-
-QStringList DataProxy_SQLite::getQSODetailsForLoTWDownload(const int _id)
-{ //Returns QRZ << date+time << Band (txt) << mode (txt)
- //qDebug() << "DataProxy_SQLite::getQSODetailsForLoTWDownload" << QString::number(_id) << endl;
- QStringList result;
- result.clear();
- //getNameFromBandId
- QSqlQuery query;
- QString queryString = QString("SELECT call, qso_date, time_on, bandid, modeid FROM log WHERE id='%0'").arg(_id);
-
- bool sqlOk = query.exec(queryString);
-
- if (sqlOk)
- {
- if (query.next())
- {
- if (query.isValid())
- {
- QString call = query.value(0).toString();
- QString date = query.value(1).toString();
- QString time = query.value(2).toString();
- QString bandid = query.value(3).toString();
- QString modeid = query.value(4).toString();
- query.finish();
- //qDebug() << "DataProxy_SQLite::getQSODetailsForLoTWDownload - date: " << date << endl;
- //qDebug() << "DataProxy_SQLite::getQSODetailsForLoTWDownload - time: " << time << endl;
- QString dateTime = (QDateTime::fromString(date+"-"+time, "yyyy/MM/dd-hh:mm:ss")).toString("yyyy/MM/dd-hh:mm");
- bandid = getNameFromBandId(bandid.toInt());
- modeid = getNameFromModeId(modeid.toInt());
-
- result.append(call);
- result.append(dateTime);
- result.append(bandid);
- result.append(modeid);
- //qDebug() << "DataProxy_SQLite::getQSODetailsForLoTWDownload - END: call: " << call << endl;
- return result;
- }
- //qDebug() << "DataProxy_SQLite::getQSODetailsForLoTWDownload - END: no valid " << endl;
- }
- query.finish();
- //qDebug() << "DataProxy_SQLite::getQSODetailsForLoTWDownload - END: no next " << endl;
- return result;
- }
- else
- {
- //qDebug() << "DataProxy_SQLite::getQSODetailsForLoTWDownload - END: SQL NOK " << endl;
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- query.finish();
- return result;
- }
-}
int DataProxy_SQLite::getQSOonYear(const int _year, const int _logNumber)
{
- //qDebug() << "DataProxy_SQLite::getQSOonYear: " << QString::number(_year) << "/" << QString::number(_logNumber) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOonYear: " << QString::number(_year) << "/" << QString::number(_logNumber) << endl;
QSqlQuery query;
QString queryString;
@@ -2890,20 +2534,20 @@ int DataProxy_SQLite::getQSOonYear(const int _year, const int _logNumber)
sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::getQSOonYear: queryString: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOonYear: queryString: " << queryString << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getQSOonYear: " << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOonYear: " << QString::number((query.value(0)).toInt()) << endl;
int v = (query.value(0)).toInt();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getQSOonYear: 0" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOonYear: 0" << endl;
query.finish();
return 0;
}
@@ -2911,7 +2555,7 @@ int DataProxy_SQLite::getQSOonYear(const int _year, const int _logNumber)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getDXCConYear: Query error" << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCConYear: Query error" << endl;
query.finish();
return 0;
}
@@ -2919,37 +2563,37 @@ int DataProxy_SQLite::getQSOonYear(const int _year, const int _logNumber)
int DataProxy_SQLite::getDXCConYear(const int _year, const int _logNumber)
{
- //qDebug() << "DataProxy_SQLite::getDXCConYear: " << QString::number(_year) << "/" << QString::number(_logNumber) << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCConYear: " << QString::number(_year) << "/" << QString::number(_logNumber) << endl;
QSqlQuery query;
QString queryString;
bool sqlOK;
if (_logNumber < 0)
{
- queryString = QString("SELECT COUNT (DISTINCT dxcc) FROM log WHERE dxcc>'0' AND qso_date LIKE '%1%'").arg(_year);
+ queryString = QString("SELECT COUNT (DISTINCT dxcc) FROM log where qso_date LIKE '%1%'").arg(_year);
}
else
{
- queryString = QString("SELECT COUNT (DISTINCT dxcc) FROM log WHERE dxcc>'0' AND lognumber='%1' AND qso_date LIKE '%2%'").arg(_logNumber).arg(_year);
+ queryString = QString("SELECT COUNT (DISTINCT dxcc) FROM log where lognumber='%1' AND qso_date LIKE '%2%'").arg(_logNumber).arg(_year);
}
sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::getDXCConYear: queryString: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCConYear: queryString: " << queryString << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getDXCConYear: " << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCConYear: " << QString::number((query.value(0)).toInt()) << endl;
int v = (query.value(0)).toInt();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getDXCConYear: 0" << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCConYear: 0" << endl;
query.finish();
return 0;
}
@@ -2957,7 +2601,7 @@ int DataProxy_SQLite::getDXCConYear(const int _year, const int _logNumber)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getDXCConYear: Query error" << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCConYear: Query error" << endl;
query.finish();
return 0;
}
@@ -2965,35 +2609,35 @@ int DataProxy_SQLite::getDXCConYear(const int _year, const int _logNumber)
int DataProxy_SQLite::getCQzonYear(const int _year, const int _logNumber)
{
- //qDebug() << "DataProxy_SQLite::getCQzonYear: " << QString::number(_year) << endl;
+ //qDebug() << "DataProxy_SQLite::getCQzonYear: " << QString::number(_year) << endl;
QSqlQuery query;
QString queryString;
bool sqlOK;
if (_logNumber < 0)
{
- queryString = QString("SELECT COUNT (DISTINCT cqz) FROM log where qso_date LIKE '%1%' AND cqz>'0' AND cqz < '41'").arg(_year);
+ queryString = QString("SELECT COUNT (DISTINCT cqz) FROM log where qso_date LIKE '%1%' AND cqz < '41' AND cqz > '0'").arg(_year);
}
else
{
- queryString = QString("SELECT COUNT (DISTINCT cqz) FROM log where lognumber='%1' AND cqz>'0' AND cqz<'41' AND qso_date LIKE '%2%'").arg(_logNumber).arg(_year);
+ queryString = QString("SELECT COUNT (DISTINCT cqz) FROM log where lognumber='%1' AND qso_date LIKE '%2%'").arg(_logNumber).arg(_year);
}
sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::getCQzonYear: queryString: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getCQzonYear: queryString: " << queryString << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getCQzonYear: " << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataProxy_SQLite::getCQzonYear: " << QString::number((query.value(0)).toInt()) << endl;
int v = (query.value(0)).toInt();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getCQzonYear: 0" << endl;
+ //qDebug() << "DataProxy_SQLite::getCQzonYear: 0" << endl;
query.finish();
return 0;
}
@@ -3001,7 +2645,7 @@ int DataProxy_SQLite::getCQzonYear(const int _year, const int _logNumber)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getCQzonYear: Query error" << endl;
+ //qDebug() << "DataProxy_SQLite::getCQzonYear: Query error" << endl;
query.finish();
return 0;
}
@@ -3010,7 +2654,7 @@ int DataProxy_SQLite::getCQzonYear(const int _year, const int _logNumber)
int DataProxy_SQLite::getQSOsWithDXCC(const int _dxcc, const int _logNumber)
{
- //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: " << QString::number(_dxcc) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: " << QString::number(_dxcc) << endl;
QSqlQuery query;
QString queryString;
bool sqlOK;
@@ -3026,20 +2670,20 @@ int DataProxy_SQLite::getQSOsWithDXCC(const int _dxcc, const int _logNumber)
sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: queryString: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: queryString: " << queryString << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: " << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: " << QString::number((query.value(0)).toInt()) << endl;
int v = (query.value(0)).toInt();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: 0" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: 0" << endl;
query.finish();
return 0;
}
@@ -3048,7 +2692,7 @@ int DataProxy_SQLite::getQSOsWithDXCC(const int _dxcc, const int _logNumber)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: Query error" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithDXCC: Query error" << endl;
query.finish();
return 0;
}
@@ -3056,7 +2700,7 @@ int DataProxy_SQLite::getQSOsWithDXCC(const int _dxcc, const int _logNumber)
int DataProxy_SQLite::getQSOsAtHour(const int _hour, const int _log)
{
- //qDebug() << "DataProxy_SQLite::getQSOsAtHour: " << QString::number(_hour) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHour: " << QString::number(_hour) << endl;
QSqlQuery query;
QString queryString;
bool sqlOK;
@@ -3081,20 +2725,20 @@ int DataProxy_SQLite::getQSOsAtHour(const int _hour, const int _log)
sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::getQSOsAtHour: queryString: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHour: queryString: " << queryString << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getQSOsAtHour: " << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHour: " << QString::number((query.value(0)).toInt()) << endl;
int v = (query.value(0)).toInt();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getQSOsAtHour: 0" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHour: 0" << endl;
query.finish();
return 0;
}
@@ -3102,7 +2746,7 @@ int DataProxy_SQLite::getQSOsAtHour(const int _hour, const int _log)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getQSOsAtHour: Query error" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHour: Query error" << endl;
query.finish();
return 0;
}
@@ -3111,7 +2755,7 @@ int DataProxy_SQLite::getQSOsAtHour(const int _hour, const int _log)
int DataProxy_SQLite::getQSOsAtHourOnBand(const int _hour, const int _band, const int _log)
{
- //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBand: " << QString::number(_hour) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBand: " << QString::number(_hour) << endl;
QSqlQuery query;
QString queryString;
bool sqlOK;
@@ -3137,20 +2781,20 @@ int DataProxy_SQLite::getQSOsAtHourOnBand(const int _hour, const int _band, cons
sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBand: queryString: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBand: queryString: " << queryString << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBand: " << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBand: " << QString::number((query.value(0)).toInt()) << endl;
int v = (query.value(0)).toInt();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBand: 0" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBand: 0" << endl;
query.finish();
return 0;
}
@@ -3158,7 +2802,7 @@ int DataProxy_SQLite::getQSOsAtHourOnBand(const int _hour, const int _band, cons
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBandç: Query error" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHourOnBandç: Query error" << endl;
query.finish();
return 0;
}
@@ -3166,7 +2810,7 @@ int DataProxy_SQLite::getQSOsAtHourOnBand(const int _hour, const int _band, cons
int DataProxy_SQLite::getQSOsOnMonth(const int _month, const int _log)
{
- //qDebug() << "DataProxy_SQLite::getgetQSOsOnMonth: " << QString::number(_month) << endl;
+ //qDebug() << "DataProxy_SQLite::getgetQSOsOnMonth: " << QString::number(_month) << endl;
QSqlQuery query;
QString queryString;
bool sqlOK;
@@ -3191,20 +2835,20 @@ int DataProxy_SQLite::getQSOsOnMonth(const int _month, const int _log)
sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::getQSOsAtHour: queryString: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHour: queryString: " << queryString << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getQSOsAtHour: " << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHour: " << QString::number((query.value(0)).toInt()) << endl;
int v = (query.value(0)).toInt();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getQSOsAtHour: 0" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHour: 0" << endl;
query.finish();
return 0;
}
@@ -3212,7 +2856,7 @@ int DataProxy_SQLite::getQSOsOnMonth(const int _month, const int _log)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getQSOsAtHour: Query error" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsAtHour: Query error" << endl;
query.finish();
return 0;
}
@@ -3220,7 +2864,7 @@ int DataProxy_SQLite::getQSOsOnMonth(const int _month, const int _log)
bool DataProxy_SQLite::newDXMarathon(const int _dxcc, const int _cq, const int _year, const int _logNumber)
{
- //qDebug() << "DataProxy_SQLite::newDXMarathon" << endl;
+ //qDebug() << "DataProxy_SQLite::newDXMarathon" << endl;
QSqlQuery query;
QString queryString;
bool sqlOK;
@@ -3239,12 +2883,12 @@ bool DataProxy_SQLite::newDXMarathon(const int _dxcc, const int _cq, const int _
{
if ( (query.value(0)).toInt() == _dxcc)
{
- //qDebug() << "DataProxy_SQLite::newDXMarathon - Existing DXCC" << endl;
+ //qDebug() << "DataProxy_SQLite::newDXMarathon - Existing DXCC" << endl;
existingDXCC = true;
}
if ( (query.value(1)).toInt() == _cq)
{
- //qDebug() << "DataProxy_SQLite::newDXMarathon - Existing CQz" << endl;
+ //qDebug() << "DataProxy_SQLite::newDXMarathon - Existing CQz" << endl;
existingCQz = true;
}
@@ -3253,13 +2897,13 @@ bool DataProxy_SQLite::newDXMarathon(const int _dxcc, const int _cq, const int _
if (existingDXCC && existingCQz)
{
- //qDebug() << "DataProxy_SQLite::newDXMarathon - FALSE" << endl;
+ //qDebug() << "DataProxy_SQLite::newDXMarathon - FALSE" << endl;
query.finish();
return false;
}
else
{
- //qDebug() << "DataProxy_SQLite::newDXMarathon - TRUE1" << endl;
+ //qDebug() << "DataProxy_SQLite::newDXMarathon - TRUE1" << endl;
query.finish();
return true;
}
@@ -3267,7 +2911,7 @@ bool DataProxy_SQLite::newDXMarathon(const int _dxcc, const int _cq, const int _
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::newDXMarathon - TRUE2" << endl;
+ //qDebug() << "DataProxy_SQLite::newDXMarathon - TRUE2" << endl;
query.finish();
return true; // It is an error inthe query but Work First Worry Later, let us work that QSO.
}
@@ -3275,7 +2919,7 @@ bool DataProxy_SQLite::newDXMarathon(const int _dxcc, const int _cq, const int _
QStringList DataProxy_SQLite::getContestNames()
{
- //qDebug() << "DataProxy_SQLite::getContestNames() " << endl;
+ //qDebug() << "DataProxy_SQLite::getContestNames() " << endl;
QStringList contests = QStringList();
QSqlQuery query;
QString queryString;
@@ -3292,7 +2936,7 @@ QStringList DataProxy_SQLite::getContestNames()
if (query.isValid())
{
queryString = (query.value(0)).toString();
- //qDebug() << "DataProxy_SQLite::getContestNames: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getContestNames: " << queryString << endl;
contests.append(queryString);
}
else
@@ -3345,7 +2989,7 @@ QStringList DataProxy_SQLite::getContestCat(const int _catn)
break;
default:
return QStringList();
- //break;
+ break;
}
sqlOK = query.exec(queryString);
@@ -3380,7 +3024,7 @@ QStringList DataProxy_SQLite::getContestCat(const int _catn)
QStringList DataProxy_SQLite::getContestOverlays()
{
- //qDebug() << "DataProxy_SQLite::getContestOverlays: "<< endl;
+ //qDebug() << "DataProxy_SQLite::getContestOverlays: "<< endl;
QStringList contests = QStringList();
QSqlQuery query;
@@ -3398,7 +3042,7 @@ QStringList DataProxy_SQLite::getContestOverlays()
if (query.isValid())
{
queryString = (query.value(0)).toString();
- //qDebug() << "DataProxy_SQLite::getContestOverlays: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getContestOverlays: " << queryString << endl;
contests.append(queryString);
}
else
@@ -3421,7 +3065,7 @@ QStringList DataProxy_SQLite::getContestOverlays()
QStringList DataProxy_SQLite::getPropModeList()
{
- //qDebug() << "DataProxy_SQLite::getPropModeLists" << endl;
+ //qDebug() << "DataProxy_SQLite::getPropModeLists" << endl;
QString aux = QString();
QStringList qs;
qs.clear();
@@ -3430,7 +3074,7 @@ QStringList DataProxy_SQLite::getPropModeList()
QSqlQuery query;
bool sqlOK = query.exec(queryString);
- QString num;
+
if (sqlOK)
{
@@ -3515,12 +3159,7 @@ QStringList DataProxy_SQLite::getPropModeList()
}
aux.clear();
- num = (query.value(0)).toString();
- if (num.toInt() <= 9)
- {
- num = "0" + num;
- }
- aux = num + " - " + (query.value(1)).toString() + " - " + translatedValue;
+ aux = (query.value(0)).toString() + " - " + (query.value(1)).toString() + " - " + translatedValue;
qs << aux;
}
else
@@ -3560,7 +3199,7 @@ bool DataProxy_SQLite::clearSatList()
bool DataProxy_SQLite::addSatellite(const QString &_arrlId, const QString &_name, const QString &_downLink, const QString &_upLink, const QString &_mode, int id)
{
- //qDebug() << "DataProxy_SQLite::addSatellite: " << QString::number(id) << endl;
+ //qDebug() << "DataProxy_SQLite::addSatellite: " << QString::number(id) << endl;
QSqlQuery query;
QString queryString;
@@ -3575,18 +3214,18 @@ bool DataProxy_SQLite::addSatellite(const QString &_arrlId, const QString &_name
}
bool sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::addSatellite - query: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::addSatellite - query: " << query.lastQuery() << endl;
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::addSatellite - TRUE" << endl;
- //qDebug() << "DataProxy_SQLite::addSatellite - TRUE - ERROR: " << QString::number(query.lastError().number()) << endl;
+ //qDebug() << "DataProxy_SQLite::addSatellite - TRUE" << endl;
+ //QDebug() << "DataProxy_SQLite::addSatellite - TRUE - ERROR: " << QString::number(query.lastError().number()) << endl;
query.finish();
return true;
}
else
{
- //qDebug() << "DataProxy_SQLite::addSatellite - FALSE" << endl;
+ //QDebug() << "DataProxy_SQLite::addSatellite - FALSE" << endl;
//if (query.lastError().number() == 19)
//{ // Duplicate Satellite
// QMessageBox msgBox;
@@ -3605,7 +3244,7 @@ bool DataProxy_SQLite::addSatellite(const QString &_arrlId, const QString &_name
int DataProxy_SQLite::getDBSatId(const QString &_arrlId)
{
- //qDebug() << "DataProxy_SQLite::getDBSatId: " << _arrlId << endl;
+ //qDebug() << "DataProxy_SQLite::getDBSatId: " << _sat << endl;
int aux = -1;
QString queryString = QString("SELECT id FROM satellites WHERE satarrlid='%1'").arg(_arrlId);
QSqlQuery query;
@@ -3621,25 +3260,25 @@ int DataProxy_SQLite::getDBSatId(const QString &_arrlId)
}
else
{
- //qDebug() << "DataProxy_SQLite::getDBSatId: query not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getDBSatId: query not valid" << endl;
query.finish();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteUplink: query failed: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteUplink: query failed: " << query.lastQuery() << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
}
- //qDebug() << "DataProxy_SQLite::getSatelliteUplink: final: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteUplink: final: " << aux << endl;
query.finish();
return aux;
}
QStringList DataProxy_SQLite::getSatellitesList()
{
- //qDebug() << "DataProxy_SQLite::getSatellitesList" << endl;
+ //qDebug() << "DataProxy_SQLite::getSatellitesList" << endl;
QString aux = QString();
QStringList qs;
qs.clear();
@@ -3678,7 +3317,7 @@ QStringList DataProxy_SQLite::getSatellitesList()
QString DataProxy_SQLite::getSatelliteUplink(const QString &_sat)
{
- //qDebug() << "DataProxy_SQLite::getSatelliteUplink: " << _sat << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteUplink: " << _sat << endl;
QString aux = QString();
//QString aux2 = QString();
//double fr1, fr2, fr;
@@ -3697,20 +3336,20 @@ QString DataProxy_SQLite::getSatelliteUplink(const QString &_sat)
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteUplink: query not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteUplink: query not valid" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteUplink: query failed: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteUplink: query failed: " << query.lastQuery() << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getSatelliteUplink: final: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteUplink: final: " << aux << endl;
query.finish();
return aux;
}
@@ -3718,7 +3357,7 @@ QString DataProxy_SQLite::getSatelliteUplink(const QString &_sat)
QString DataProxy_SQLite::getSatelliteDownlink(const QString &_sat)
{
- //qDebug() << "DataProxy_SQLite::getSatelliteDownlink: " << _sat << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteDownlink: " << _sat << endl;
QString aux = QString();
//QString aux2 = QString();
//double fr1, fr2, fr;
@@ -3738,20 +3377,20 @@ QString DataProxy_SQLite::getSatelliteDownlink(const QString &_sat)
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteDownlink: query not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteDownlink: query not valid" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteDownlink: query failed: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteDownlink: query failed: " << query.lastQuery() << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getSatelliteDownlink: final: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteDownlink: final: " << aux << endl;
query.finish();
return aux;
}
@@ -3782,26 +3421,26 @@ QString DataProxy_SQLite::getSatelliteMode(const QString &_sat)
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteMode: query not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteMode: query not valid" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteMode: query failed: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteMode: query failed: " << query.lastQuery() << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getSatelliteMode: final: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteMode: final: " << aux << endl;
return aux;
}
QString DataProxy_SQLite::getSatelliteFullUplink(const QString &_sat)
{
- //qDebug() << "DataProxy_SQLite::getSatelliteFullUplink: " << _sat << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteFullUplink: " << _sat << endl;
QString aux = QString();
//QString aux2 = QString();
//double fr1, fr2, fr;
@@ -3819,27 +3458,27 @@ QString DataProxy_SQLite::getSatelliteFullUplink(const QString &_sat)
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteFullUplink: query not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteFullUplink: query not valid" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteFullUplink: query failed: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteFullUplink: query failed: " << query.lastQuery() << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getSatelliteFullUplink: final: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteFullUplink: final: " << aux << endl;
query.finish();
return aux;
}
QString DataProxy_SQLite::getSatelliteFullDownlink(const QString &_sat)
{
- //qDebug() << "DataProxy_SQLite::getSatelliteFullDownlink: " << _sat << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteFullDownlink: " << _sat << endl;
QString aux = QString();
//QString aux2 = QString();
//double fr1, fr2, fr;
@@ -3858,20 +3497,20 @@ QString DataProxy_SQLite::getSatelliteFullDownlink(const QString &_sat)
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteFullDownlink: query not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteFullDownlink: query not valid" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteFullDownlink: query failed: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteFullDownlink: query failed: " << query.lastQuery() << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getSatelliteFullDownlink: final: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteFullDownlink: final: " << aux << endl;
query.finish();
return aux;
@@ -3898,26 +3537,26 @@ QString DataProxy_SQLite::getSatelliteFullMode(const QString &_sat)
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteMode: query not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteMode: query not valid" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteMode: query failed: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteMode: query failed: " << query.lastQuery() << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getSatelliteMode: final: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteMode: final: " << aux << endl;
return aux;
}
QString DataProxy_SQLite::getSatelliteName(const QString &_sat)
{
- //qDebug() << "DataProxy_SQLite::getSatelliteName: " << _sat << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteName: " << _sat << endl;
QString aux = QString();
QString queryString = QString("SELECT satname FROM satellites WHERE satarrlid='%1'").arg(_sat);
@@ -3935,20 +3574,20 @@ QString DataProxy_SQLite::getSatelliteName(const QString &_sat)
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteName: query not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteName: query not valid" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getSatelliteName: query failed: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteName: query failed: " << query.lastQuery() << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getSatelliteName: final: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getSatelliteName: final: " << aux << endl;
query.finish();
return aux;
}
@@ -3972,27 +3611,27 @@ QString DataProxy_SQLite::getSateliteArrlIdFromId(const int _id)
}
else
{
- //qDebug() << "DataProxy_SQLite::getSateliteArrlIdFromId: query not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getSateliteArrlIdFromId: query not valid" << endl;
query.finish();
return QString();
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getSateliteArrlIdFromId: query failed: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getSateliteArrlIdFromId: query failed: " << query.lastQuery() << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getSateliteArrlIdFromId: final: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getSateliteArrlIdFromId: final: " << aux << endl;
return aux;
}
double DataProxy_SQLite::getFreqFromRange(QString _fr)
{ //May even receive: 145.900-146.00 and should return the mid in the range (145.950)
- //qDebug() << "DataProxy_SQLite::getFreqFromRange: " << _fr << endl;
+ //qDebug() << "DataProxy_SQLite::getFreqFromRange: " << _fr << endl;
QString fr1, fr2, aux;
double f1, f2;
@@ -4008,39 +3647,39 @@ double DataProxy_SQLite::getFreqFromRange(QString _fr)
{ // Potentially somethink like: 435.030-435.456,146.180
// We select the first range
- //qDebug() << "DataProxy_SQLite::getFreqFromRange: has several freqs: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getFreqFromRange: has several freqs: " << aux << endl;
aux = aux.section(',', 0, 0); // We select the first package
}
if (aux.contains('-')) // Potentially somethink like: 435.030-435.456
{
- //qDebug() << "DataProxy_SQLite::getFreqFromRange: has several freqs: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getFreqFromRange: has several freqs: " << aux << endl;
fr2 = aux.section('-', 1, 1); // We select the second freq
fr1 = aux.section('-', 0, 0); // We select the first freq
- //qDebug() << "DataProxy_SQLite::getFreqFromRange: fr1: " << fr1 << endl;
- //qDebug() << "DataProxy_SQLite::getFreqFromRange: fr2: " << fr2 << endl;
+ //qDebug() << "DataProxy_SQLite::getFreqFromRange: fr1: " << fr1 << endl;
+ //qDebug() << "DataProxy_SQLite::getFreqFromRange: fr2: " << fr2 << endl;
f1 = fr1.toDouble();
f2 = fr2.toDouble();
- //qDebug() << "DataProxy_SQLite::getFreqFromRange: f1: " << QString::number(f1) << endl;
- //qDebug() << "DataProxy_SQLite::getFreqFromRange: f2: " << QString::number(f2) << endl;
+ //qDebug() << "DataProxy_SQLite::getFreqFromRange: f1: " << QString::number(f1) << endl;
+ //qDebug() << "DataProxy_SQLite::getFreqFromRange: f2: " << QString::number(f2) << endl;
f1 = (f2 + f1)/2;
- //qDebug() << "DataProxy_SQLite::getFreqFromRange: f1 after calc: " << QString::number(f1) << endl;
+ //qDebug() << "DataProxy_SQLite::getFreqFromRange: f1 after calc: " << QString::number(f1) << endl;
}
else
{ // It is only one freq 145.950 so this is what must be returned
f1 = aux.toDouble();
}
- //qDebug() << "DataProxy_SQLite::getFreqFromRange: Return: " << QString::number(f1) << endl;
+ //qDebug() << "DataProxy_SQLite::getFreqFromRange: Return: " << QString::number(f1) << endl;
return f1;
}
QStringList DataProxy_SQLite::getQSLRcvdList()
{
- //qDebug() << "DataProxy_SQLite::getQSLRcvdList" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSLRcvdList" << endl;
QString aux = QString();
QStringList qs;
qs.clear();
@@ -4106,7 +3745,7 @@ QStringList DataProxy_SQLite::getQSLRcvdList()
QStringList DataProxy_SQLite::getQSLSentList()
{
- //qDebug() << "DataProxy_SQLite::getQSLSentList" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSLSentList" << endl;
QString aux = QString();
QStringList qs;
qs.clear();
@@ -4174,7 +3813,7 @@ QStringList DataProxy_SQLite::getQSLSentList()
QStringList DataProxy_SQLite::getClubLogStatusList()
{
- //qDebug() << "DataProxy_SQLite::getClubLogStatusList" << endl;
+ //qDebug() << "DataProxy_SQLite::getClubLogStatusList" << endl;
QString aux = QString();
QStringList qs;
qs.clear();
@@ -4229,7 +3868,7 @@ QStringList DataProxy_SQLite::getClubLogStatusList()
QStringList DataProxy_SQLite::getQSLViaList()
{
- //qDebug() << "DataProxy_SQLite::getQSLViaList" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSLViaList" << endl;
QString aux = QString();
QStringList qs;
qs.clear();
@@ -4293,7 +3932,7 @@ QStringList DataProxy_SQLite::getQSLViaList()
/*
QStringList DataProxy_SQLite::getValidCatOptions(const int _currentCat, const int _lowerCat)
{
- //qDebug() << "DataProxy_SQLite::getContestNames: " << QString::number(_currentCat) <<"/" << QString::number(_lowerCat) << endl;
+ //qDebug() << "DataProxy_SQLite::getContestNames: " << QString::number(_currentCat) <<"/" << QString::number(_lowerCat) << endl;
QStringList contests = QStringList();
QSqlQuery query;
QString queryString;
@@ -4357,7 +3996,7 @@ QStringList DataProxy_SQLite::getValidCatOptions(const int _currentCat, const in
bool DataProxy_SQLite::haveAtLeastOneLog()
{
- //qDebug() << "DataProxy_SQLite::haveAtLeastOneLog()" << endl;
+ //qDebug() << "DataProxy_SQLite::haveAtLeastOneLog()" << endl;
QSqlQuery query;
bool sqlOK = query.exec("SELECT COUNT(id) from logs");
@@ -4396,13 +4035,13 @@ bool DataProxy_SQLite::haveAtLeastOneLog()
QStringList DataProxy_SQLite::getColumnNamesFromTableLog()
{
- //qDebug() << "DataProxy_SQLite::getColumnNamesFromTableLog" << endl;
+ //qDebug() << "DataProxy_SQLite::getColumnNamesFromTableLog" << endl;
return getColumnNamesFromTable("log");
}
QStringList DataProxy_SQLite::getColumnNamesFromTable(const QString &_tableName)
{
- //qDebug() << "DataProxy_SQLite::getColumnNamesFromTable" << endl;
+ //qDebug() << "DataProxy_SQLite::getColumnNamesFromTable" << endl;
return db->getColumnNamesFromTable(_tableName);
}
@@ -4413,38 +4052,38 @@ bool DataProxy_SQLite::setDXCCAwardStatus(const int _qsoId)
// If the band/mode/log is already worked and status confirmed: Update and Return true
// If not worked: Add and Return true
- //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: " << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: " << QString::number(_qsoId) << endl;
if (_qsoId <= 0)
{
- //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: QSOid <=0 " << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: QSOid <=0 " << QString::number(_qsoId) << endl;
return false;
}
int _dxcc = getDXCCFromId(_qsoId);
if (_dxcc <= 0)
{
- //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: DXCC <= 0: DXCC: " << QString::number(_dxcc) << " - " << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: DXCC <= 0: DXCC: " << QString::number(_dxcc) << " - " << QString::number(_qsoId) << endl;
return false;
}
int _band = getBandFromId(_qsoId);
if (_band <= 0)
{
- //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Band <= 0: BAND: " << QString::number(_band) << " - " << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Band <= 0: BAND: " << QString::number(_band) << " - " << QString::number(_qsoId) << endl;
return false;
}
int _mode = getModeFromId(_qsoId);
if (_mode <= 0)
{
- //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Mode <= 0: Mode: " << QString::number(_mode) << " - " << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Mode <= 0: Mode: " << QString::number(_mode) << " - " << QString::number(_qsoId) << endl;
return false;
}
int _log = getLogNumberFromQSOId(_qsoId);
if (_log <= 0)
{
- //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Log <= 0: Log: " << QString::number(_log) << " - " << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Log <= 0: Log: " << QString::number(_log) << " - " << QString::number(_qsoId) << endl;
return false;
}
@@ -4460,7 +4099,7 @@ bool DataProxy_SQLite::setDXCCAwardStatus(const int _qsoId)
QString queryString = QString("SELECT id, confirmed, qsoid FROM awarddxcc WHERE band='%1' AND mode='%2' AND dxcc='%3'").arg(_band).arg(_mode).arg(_dxcc);
bool sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Queryexec-1: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Queryexec-1: " << queryString << endl;
queryString.clear();
if (sqlOK)
@@ -4512,14 +4151,14 @@ bool DataProxy_SQLite::setDXCCAwardStatus(const int _qsoId)
//#4 - If not worked: Add and Return true
query.finish();
// awarddxcc id dxcc band mode confirmed qsoid lognumber
- queryString = QString("INSERT INTO awarddxcc (dxcc, band, mode, confirmed, qsoid, lognumber) values('%1','%2','%3','0', '%4', '%5')").arg(_dxcc).arg(_band).arg(_mode).arg(_qsoId).arg(_log);
+ queryString = QString("INSERT INTO awarddxcc (dxcc, band, mode, confirmed, qsoid, lognumber) values('%1','%2','%3','0', '%5', '%6')").arg(_dxcc).arg(_band).arg(_mode).arg(_qsoId).arg(_log);
}
if (queryString.length()>5)
{
if (query.exec(queryString))
{
- //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Queryexec-2: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: Queryexec-2: " << queryString << endl;
query.finish();
return true;
}
@@ -4560,7 +4199,7 @@ bool DataProxy_SQLite::setWAZAwardStatus(const int _qsoId)
// If the band/mode/log is already worked and status confirmed: Update and Return true
// If not worked: Add and Return true
- //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: " << QString::number(_qsoId) << endl;
+ //qDebug() << "DataProxy_SQLite::setDXCCAwardStatus: " << QString::number(_qsoId) << endl;
if (_qsoId <= 0)
{
return false;
@@ -4653,7 +4292,7 @@ bool DataProxy_SQLite::setWAZAwardStatus(const int _qsoId)
//#4 - If not worked: Add and Return true
query.finish();
// awarddxcc id dxcc band mode confirmed qsoid lognumber
- queryString = QString("INSERT INTO awardwaz (cqz, band, mode, confirmed, qsoid, lognumber) values('%1','%2','%3','0', '%4', '%5')").arg(_cqz).arg(_band).arg(_mode).arg(_qsoId).arg(_log);
+ queryString = QString("INSERT INTO awardwaz (cqz, band, mode, confirmed, qsoid, lognumber) values('%1','%2','%3','%4', '%5', '%6')").arg(_cqz);
}
if (queryString.length()>5)
@@ -4692,7 +4331,7 @@ bool DataProxy_SQLite::setWAZAwardStatus(const int _qsoId)
int DataProxy_SQLite::getNumberOfManagedLogs()
{
- //qDebug() << "DataProxy_SQLite::getNumberOfManagedLogs" << endl;
+ //qDebug() << "DataProxy_SQLite::getNumberOfManagedLogs" << endl;
QSqlQuery query;
bool sqlOK = query.exec("SELECT COUNT (*) from logs");
@@ -4755,7 +4394,7 @@ int DataProxy_SQLite::getMaxLogNumber()
QStringList DataProxy_SQLite::getListOfManagedLogs()
{
//This function returns the list of log IDs that are being managed
- //qDebug() << "DataProxy_SQLite::getListOfManagedLogs" << endl;
+ //qDebug() << "DataProxy_SQLite::getListOfManagedLogs" << endl;
QSqlQuery query;
QStringList qs;
qs.clear();
@@ -4769,7 +4408,7 @@ QStringList DataProxy_SQLite::getListOfManagedLogs()
if (query.isValid())
{
qs << (query.value(0)).toString();
- //qDebug() << "DataProxy_SQLite::getListOfManagedLogs: " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataProxy_SQLite::getListOfManagedLogs: " << (query.value(0)).toString() << endl;
}
}
}
@@ -4784,7 +4423,7 @@ QStringList DataProxy_SQLite::getListOfManagedLogs()
QString DataProxy_SQLite::getStationCallSignFromLog(const int _log)
{
- //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: " << QString::number(_log)<< endl;
+ //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: " << QString::number(_log)<< endl;
QSqlQuery query;
QString queryString = QString("SELECT stationcall FROM logs WHERE id='%1'").arg(_log);
bool sqlOK = query.exec(queryString);
@@ -4794,14 +4433,14 @@ QString DataProxy_SQLite::getStationCallSignFromLog(const int _log)
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: " << (query.value(0)).toString() << endl;
QString v = (query.value(0)).toString();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: Not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: Not valid" << endl;
query.finish();
return QString();
}
@@ -4809,32 +4448,24 @@ QString DataProxy_SQLite::getStationCallSignFromLog(const int _log)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: query failed" << endl;
+ //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: query failed" << endl;
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: END" << endl;
+ //qDebug() << "DataProxy_SQLite::getStationCallSignFromLog: END" << endl;
//return QString();
}
QStringList DataProxy_SQLite::getStationCallSignsFromLog(const int _log)
{
- //qDebug() << "DataProxy_SQLite::getStationCallSignsFromLog" << endl;
+ //qDebug() << "DataProxy_SQLite::getStationCallSignsFromLog" << endl;
QStringList calls = QStringList();
QSqlQuery query;
QString queryString;
bool sqlOK;
- if (doesThisLogExist(_log))
- {
- queryString = QString("SELECT DISTINCT station_callsign FROM log WHERE lognumber='%1'").arg(_log);
- }
- else
- {
- queryString = QString("SELECT DISTINCT station_callsign FROM log");
- }
-
+ queryString = QString("SELECT DISTINCT station_callsign FROM log");
sqlOK = query.exec(queryString);
if (sqlOK)
@@ -4848,7 +4479,7 @@ QStringList DataProxy_SQLite::getStationCallSignsFromLog(const int _log)
{
calls.append(queryString);
}
- //qDebug() << "DataProxy_SQLite::getStationCallSignsFromLog: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getStationCallSignsFromLog: " << queryString << endl;
}
else
@@ -4877,43 +4508,43 @@ QStringList DataProxy_SQLite::getStationCallSignsFromLog(const int _log)
QString DataProxy_SQLite::getOperatorsFromLog(const int _log)
{
- //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: " << QString::number(_log)<< endl;
- QSqlQuery query;
- QString queryString = QString("SELECT operators FROM logs WHERE id='%1'").arg(_log);
- bool sqlOK = query.exec(queryString);
+ //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: " << QString::number(_log)<< endl;
+ QSqlQuery query;
+ QString queryString = QString("SELECT operators FROM logs WHERE id='%1'").arg(_log);
+ bool sqlOK = query.exec(queryString);
- if (sqlOK)
- {
- query.next();
- if (query.isValid())
- {
- //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: " << (query.value(0)).toString() << endl;
- QString v = (query.value(0)).toString();
- query.finish();
- return v;
- }
- else
- {
- //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: Not valid" << endl;
- query.finish();
- return QString();
- }
- }
- else
- {
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: query failed" << endl;
- query.finish();
- return QString();
- }
+ if (sqlOK)
+ {
+ query.next();
+ if (query.isValid())
+ {
+ //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: " << (query.value(0)).toString() << endl;
+ QString v = (query.value(0)).toString();
+ query.finish();
+ return v;
+ }
+ else
+ {
+ //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: Not valid" << endl;
+ query.finish();
+ return QString();
+ }
+ }
+ else
+ {
+ emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
+ //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: query failed" << endl;
+ query.finish();
+ return QString();
+ }
- //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: END" << endl;
- //return QString();
+ //qDebug() << "DataProxy_SQLite::getOperatorsFromLog: END" << endl;
+ return QString();
}
QString DataProxy_SQLite::getCommentsFromLog(const int _log)
{
- //qDebug() << "DataProxy_SQLite::getLogDateFromLog: " << QString::number(_log)<< endl;
+ //qDebug() << "DataProxy_SQLite::getLogDateFromLog: " << QString::number(_log)<< endl;
QSqlQuery query;
QString queryString = QString("SELECT comment FROM logs WHERE id='%1'").arg(_log);
bool sqlOK = query.exec(queryString);
@@ -4923,14 +4554,14 @@ QString DataProxy_SQLite::getCommentsFromLog(const int _log)
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getCommentsFromLog: " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataProxy_SQLite::getLogDateFromLog: " << (query.value(0)).toString() << endl;
QString v = (query.value(0)).toString();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getCommentsFromLog: Not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getLogDateFromLog: Not valid" << endl;
query.finish();
return QString();
}
@@ -4938,18 +4569,18 @@ QString DataProxy_SQLite::getCommentsFromLog(const int _log)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getLogDateFromLog: query failed" << endl;
+ //qDebug() << "DataProxy_SQLite::getLogDateFromLog: query failed" << endl;
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getCommentsFromLog: END" << endl;
- //return QString();
+ //qDebug() << "DataProxy_SQLite::getCommentsFromLog: END" << endl;
+ return QString();
}
QString DataProxy_SQLite::getLogDateFromLog(const int _log)
{
- //qDebug() << "DataProxy_SQLite::getLogDateFromLog: " << QString::number(_log)<< endl;
+ //qDebug() << "DataProxy_SQLite::getLogDateFromLog: " << QString::number(_log)<< endl;
QSqlQuery query;
QString queryString = QString("SELECT logdate FROM logs WHERE id='%1'").arg(_log);
bool sqlOK = query.exec(queryString);
@@ -4959,14 +4590,14 @@ QString DataProxy_SQLite::getLogDateFromLog(const int _log)
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getLogDateFromLog: " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataProxy_SQLite::getLogDateFromLog: " << (query.value(0)).toString() << endl;
QString v = (query.value(0)).toString();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getLogDateFromLog: Not valid" << endl;
+ //qDebug() << "DataProxy_SQLite::getLogDateFromLog: Not valid" << endl;
query.finish();
return QString();
}
@@ -4974,13 +4605,211 @@ QString DataProxy_SQLite::getLogDateFromLog(const int _log)
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getLogDateFromLog: query failed" << endl;
+ //qDebug() << "DataProxy_SQLite::getLogDateFromLog: query failed" << endl;
query.finish();
return QString();
}
- //qDebug() << "DataProxy_SQLite::getLogDateFromLog: END" << endl;
- //return QString();
+ //qDebug() << "DataProxy_SQLite::getLogDateFromLog: END" << endl;
+ return QString();
+}
+
+QString DataProxy_SQLite::getLogTypeNFromLog(const int _log)
+{
+ //qDebug() << "DataProxy_SQLite::getLogTypeNFromLog: " << QString::number(_log)<< endl;
+ QSqlQuery query;
+ QString queryString = QString("SELECT logtypen FROM logs WHERE id='%1'").arg(_log);
+ bool sqlOK = query.exec(queryString);
+
+ if (sqlOK)
+ {
+ query.next();
+ if (query.isValid())
+ {
+ //qDebug() << "DataProxy_SQLite::getLogTypeNFromLog: " << (query.value(0)).toString() << endl;
+ QString v = (query.value(0)).toString();
+ query.finish();
+ return v;
+ }
+ else
+ {
+ //qDebug() << "DataProxy_SQLite::getLogTypeNFromLog: Not valid" << endl;
+ query.finish();
+ return QString();
+ }
+ }
+ else
+ {
+ emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
+ //qDebug() << "DataProxy_SQLite::getLogTypeNFromLog: query failed" << endl;
+ query.finish();
+ return QString();
+ }
+
+ //qDebug() << "DataProxy_SQLite::getLogTypeNFromLog: END" << endl;
+ return QString();
+}
+
+int DataProxy_SQLite::getContestTypeN(const int _co, const int _catop, const int _catas, const int _catpo, const int _catba, const int _catov, const int _catmo)
+{//typeContestSelected, contestCatOperators, contestCatAssisted, contestCatPower, contestCatBands, contestCatOverlay, contestCatMode
+ //qDebug() << "DataProxy_SQLite::getContestTypeN: " << endl;
+ QSqlQuery query;
+ QString queryString = QString("SELECT id FROM contest WHERE contest='%1' AND catoperator='%2' AND catassisted='%3' AND catpower='%4' AND catoverlay='%5' AND catmode='%6' AND catband='%7'").arg(_co).arg(_catop).arg(_catas).arg(_catpo).arg(_catov).arg(_catmo).arg(_catba);
+
+ //qDebug() << "DataProxy_SQLite::getContestTypeN: " << queryString << endl;
+
+ bool sqlOK = query.exec(queryString);
+
+ if (sqlOK)
+ {
+ //qDebug() << "DataProxy_SQLite::getContestTypeN: (OK) LastQuery: " << query.lastQuery() << endl;
+ query.next();
+ if (query.isValid())
+ {
+ //qDebug() << "DataProxy_SQLite::getContestTypeN: " << (query.value(0)).toString() << endl;
+ int v = (query.value(0)).toInt();
+ query.finish();
+ return v;
+ }
+ else
+ {
+ //qDebug() << "DataProxy_SQLite::getContestTypeN: Not valid (-1)" << endl;
+ query.finish();
+ return -1;
+ }
+ }
+ else
+ {
+ emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
+ //qDebug() << "DataProxy_SQLite::getContestTypeN: (ERROR) LastQuery: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::getContestTypeN: query failed (-1)" << endl;
+ query.finish();
+ return -1;
+ }
+
+ //qDebug() << "DataProxy_SQLite::getContestTypeN: END (-1)" << endl;
+ return -1;
+
+}
+
+QStringList DataProxy_SQLite::getDataFromContestType(const int _n)
+{
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType - n: " << QString::number(_n) << endl;
+ QStringList dataC = QStringList();
+ QSqlQuery query, query1;
+ QString queryString;
+ int nameCol = -1;
+ bool sqlOK;
+ queryString = QString("SELECT supportedcontests.name, contest.contest, contest.catoperator, contest.catassisted, contest.catpower, contest.catoverlay, contest.catmode, contest.catband FROM supportedcontests JOIN contest ON contest.contest=supportedcontests.id WHERE contest.id='%1'").arg(_n);
+ sqlOK = query.exec(queryString);
+
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType: LastQuery: " << query.lastQuery() << endl;
+ QSqlRecord rec = query.record();
+ if (sqlOK)
+ {
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType: Query OK" << endl;
+ if(query.next())
+ {
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType: Query Next" << endl;
+ if (query.isValid())
+ {
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType: Query Valid" << endl;
+
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType:-1 " << endl;
+ nameCol = rec.indexOf("contest");
+ dataC << (query.value(nameCol)).toString();
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType: -2" << endl;
+ nameCol = rec.indexOf("catoperator");
+ dataC << (query.value(nameCol)).toString();
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType: -3" << endl;
+ nameCol = rec.indexOf("catassisted");
+ dataC << (query.value(nameCol)).toString();
+ nameCol = rec.indexOf("catpower");
+ dataC << (query.value(nameCol)).toString();
+ nameCol = rec.indexOf("catoverlay");
+ dataC << (query.value(nameCol)).toString();
+ nameCol = rec.indexOf("catmode");
+ dataC << (query.value(nameCol)).toString();
+ nameCol = rec.indexOf("name");
+ dataC << (query.value(nameCol)).toString();
+ nameCol = rec.indexOf("catband");
+ dataC << (query.value(nameCol)).toString();
+ query.finish();
+ return dataC;
+
+ }
+ else
+ {
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType: Query value no valid" << endl;
+ query.finish();
+ return QStringList();
+ }
+
+ }
+ else
+ {
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType: No Next" << endl;
+ query.finish();
+ return QStringList();
+ }
+ //query.finish();
+ //return dataC;
+ }
+ else
+ {
+ emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
+ //qDebug() << "DataProxy_SQLite::getDataFromContestType: Query not OK" << endl;
+ query.finish();
+ return QStringList();
+ }
+}
+
+int DataProxy_SQLite::getLogTypeNumber(const QString &_logType)
+{
+ return db->getLogTypeNumber(_logType);
+}
+
+QString DataProxy_SQLite::getLogTypeName(const int _logType)
+{
+ return db->getLogTypeName(_logType);
+}
+
+QString DataProxy_SQLite::getLogTypeOfUserLog(const int _logN)
+{
+/*
+ * Returns the type of log (DX, CQ-WW-SSB, ...) or DX as default if nothing found
+*/
+ //qDebug() << "DataProxy_SQLite::getLogTypeOfUserLog: " << QString::number(_logN) << endl;
+ QSqlQuery query;
+ QString queryString;
+ queryString = QString("SELECT logtype FROM logs WHERE id='%1'").arg(_logN);
+ bool sqlOK = query.exec(queryString);
+
+ if (sqlOK)
+ {
+ query.next();
+ if (query.isValid())
+ {
+ //qDebug() << "DataProxy_SQLite::getLogTypeOfUserLog: found: " << (query.value(0)).toString() << endl;
+ queryString = (query.value(0)).toString();
+ query.finish();
+ return queryString;
+ }
+ else
+ {
+ //qDebug() << "DataProxy_SQLite::getLogTypeOfUserLog: NOT found: returning DX" << endl;
+ query.finish();
+ return "DX";
+ }
+
+ }
+ else
+ {
+ emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
+ //qDebug() << "DataProxy_SQLite::getLogTypeOfUserLog: Query error: returning DX" << endl;
+ query.finish();
+ return "DX";
+ }
}
int DataProxy_SQLite::getLogNumberFromQSOId(const int _qsoId)
@@ -5015,12 +4844,12 @@ int DataProxy_SQLite::getLogNumberFromQSOId(const int _qsoId)
bool DataProxy_SQLite::fillEmptyDXCCInTheLog()
{
- //qDebug() << "DataProxy_SQLite::fillEmptyDXCCInTheLog" << endl;
-
+ //qDebug() << "DataProxy_SQLite::fillEmptyDXCCInTheLog" << endl;
+ int nameCol = -1;
QSqlQuery query;
QSqlQuery query2;
- QString queryString = QString("SELECT COUNT (id) FROM log WHERE dxcc IS NULL OR dxcc<'1' OR cont IS NULL");
+ QString queryString = QString("SELECT COUNT (id) FROM log WHERE dxcc IS NULL OR dxcc<1 OR cont IS NULL");
bool sqlOK = query.exec(queryString);
int qsos = -1;
@@ -5053,8 +4882,6 @@ bool DataProxy_SQLite::fillEmptyDXCCInTheLog()
if (sqlOK)
{
- int nameCol = -1;
-
QSqlRecord rec = query.record();
QString _call = QString();
QString _id = QString();
@@ -5074,8 +4901,8 @@ bool DataProxy_SQLite::fillEmptyDXCCInTheLog()
_dxcc = QString::number(getPrefixId(_call));
_continent = getContinentShortNameFromEntity(_dxcc.toInt());
- //qDebug() << "DataBase::fillEmptyDXCCInTheLog: DXCC: " << _dxcc << endl;
- //qDebug() << "DataBase::fillEmptyDXCCInTheLog: Cont: " << _continent << endl;
+ //qDebug() << "DataBase::fillEmptyDXCCInTheLog: DXCC: " << _dxcc << endl;
+ //qDebug() << "DataBase::fillEmptyDXCCInTheLog: Cont: " << _continent << endl;
// UPDATE THE ID WITH THE DXCC
queryString = QString("UPDATE log SET dxcc = '%1', cont = '%2' WHERE id = '%3'").arg(_dxcc).arg(_continent).arg(_id);
sqlOK = query2.exec(queryString);
@@ -5096,7 +4923,7 @@ bool DataProxy_SQLite::fillEmptyDXCCInTheLog()
}
if ( progress.wasCanceled() )
{
- //qDebug() << "DataBase::fillEmptyDXCCInTheLog: progress canceled" << endl;
+ //qDebug() << "DataBase::fillEmptyDXCCInTheLog: progress canceled" << endl;
query.finish();
return true;
}
@@ -5126,7 +4953,7 @@ bool DataProxy_SQLite::fillEmptyDXCCInTheLog()
int DataProxy_SQLite::getHowManyQSOInLog(const int _log)
{
QString queryString = QString();
- QSqlQuery query = QSqlQuery();
+ QSqlQuery query;
if (_log < 0)
{
queryString = QString("SELECT count(id) FROM log");
@@ -5248,7 +5075,7 @@ int DataProxy_SQLite::getHowManyQSLSentInLog(const int _log)
int DataProxy_SQLite::getQSOsWithContinent(const QString &_cont, const int _logNumber)
{
- //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: " << _cont << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: " << _cont << endl;
QSqlQuery query;
QString queryString;
bool sqlOK;
@@ -5264,20 +5091,20 @@ int DataProxy_SQLite::getQSOsWithContinent(const QString &_cont, const int _logN
sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: queryString: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: queryString: " << queryString << endl;
if (sqlOK)
{
query.next();
if (query.isValid())
{
- //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: " << QString::number((query.value(0)).toInt()) << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: " << QString::number((query.value(0)).toInt()) << endl;
int v = (query.value(0)).toInt();
query.finish();
return v;
}
else
{
- //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: 0" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: 0" << endl;
query.finish();
return 0;
}
@@ -5286,7 +5113,7 @@ int DataProxy_SQLite::getQSOsWithContinent(const QString &_cont, const int _logN
else
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: Query error" << endl;
+ //qDebug() << "DataProxy_SQLite::getQSOsWithContinent: Query error" << endl;
query.finish();
return 0;
}
@@ -5390,13 +5217,15 @@ int DataProxy_SQLite::getQSOsInMode(const QString &_mode, const int _log)
bool DataProxy_SQLite::addNewLog (const QStringList _qs)
{
- //qDebug() << "DataProxy_SQLite::addNewLog: " << _qs.at(2) << "/" << _qs.at(5) << "/" << _qs.at(6) << endl;
- //qDebug() << "DataProxy_SQLite::addNewLog: Size: " << QString::number(_qs.size()) << endl;
- // newLogq << dateString << stationCallsign << operators << comment << QString::number(selectedLog) << _qs.at(4) ; (last field is 1 or 0 editing)
+ //qDebug() << "DataProxy_SQLite::addNewLog: " << _qs.at(2) << "/" << _qs.at(5) << "/" << _qs.at(6) << endl;
- if (_qs.size()!=6)
+ //_qs << dateString << stationCallsign << _qs.at(4) << comment << _qs.at(12);
+ //qDebug() << "DataProxy_SQLite::slotAnalyzeNewLogData: " << _qs.at(4) << "/" << _qs.at(12) << endl;
+ // Date/Call/Operators/"DX"/comment/"1"
+
+ if (_qs.size()!=8)
{
- //qDebug() << "DataProxy_SQLite::addNewLog: != 6" << endl;
+ //qDebug() << "DataProxy_SQLite::addNewLog: != 8" << endl;
return false;
}
//qDebug() << "DataProxy_SQLite::addNewLog: Has the appropriate length" << endl;
@@ -5410,12 +5239,11 @@ bool DataProxy_SQLite::addNewLog (const QStringList _qs)
//_operators.clear();
//_operators << (_qs.at(2)).split(',', QString::SkipEmptyParts);
- //QString _typeContest = _qs.at(3);
- QString _comment = _qs.at(3);
- //QString _typeContestN = _qs.at(5);
-
- QString id = _qs.at(4);
- QString editing = _qs.at(5);
+ QString _typeContest = _qs.at(3);
+ QString _comment = _qs.at(4);
+ QString _typeContestN = _qs.at(5);
+ QString id = _qs.at(6);
+ QString editing = _qs.at(7);
QString queryString;
QSqlQuery query;
@@ -5423,20 +5251,19 @@ bool DataProxy_SQLite::addNewLog (const QStringList _qs)
if (editing == "1")
{ // We are editing
- //qDebug() << "DataProxy_SQLite::addNewLog: We are editing!" << endl;
- //queryString = QString("UPDATE logs SET logdate = '%1', stationcall = '%2', operators = '%3', comment = '%4', logtype = '%5', logtypen = '%6' WHERE id = '%7'").arg(_dateString).arg(_stationCallsign).arg(_operators).arg(_comment).arg(_typeContest).arg(_typeContestN).arg(id);
- queryString = QString("UPDATE logs SET logdate = '%1', stationcall = '%2', operators = '%3', comment = '%4' WHERE id = '%5'").arg(_dateString).arg(_stationCallsign).arg(_operators).arg(_comment).arg(id);
+ //qDebug() << "DataProxy_SQLite::addNewLog: We are editing!" << endl;
+ queryString = QString("UPDATE logs SET logdate = '%1', stationcall = '%2', operators = '%3', comment = '%4', logtype = '%5', logtypen = '%6' WHERE id = '%7'").arg(_dateString).arg(_stationCallsign).arg(_operators).arg(_comment).arg(_typeContest).arg(_typeContestN).arg(id);
sqlOK = query.exec(queryString);
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::addNewLog: Editing OK!" << endl;
+ //qDebug() << "DataProxy_SQLite::addNewLog: Editing OK!" << endl;
query.finish();
return true;
}
else
{
- //qDebug() << "DataProxy_SQLite::addNewLog: Editing NOK!" << endl;
+ //qDebug() << "DataProxy_SQLite::addNewLog: Editing NOK!" << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
return false;
@@ -5444,14 +5271,13 @@ bool DataProxy_SQLite::addNewLog (const QStringList _qs)
//return false;
}
- //qDebug() << "DataProxy_SQLite::addNewLog: We are adding a new log" << endl;
+ //qDebug() << "DataProxy_SQLite::addNewLog: We are adding a new log" << endl;
// First we check if the log is already there
- //queryString = QString("SELECT id FROM logs WHERE logdate='%1' AND stationcall='%2' AND logtype='%3' AND logtypen='%4'").arg(_dateString).arg(_stationCallsign).arg(_typeContest).arg(_typeContestN);
- queryString = QString("SELECT id FROM logs WHERE logdate='%1' AND stationcall='%2'").arg(_dateString).arg(_stationCallsign);
+ queryString = QString("SELECT id FROM logs WHERE logdate='%1' AND stationcall='%2' AND logtype='%3' AND logtypen='%4'").arg(_dateString).arg(_stationCallsign).arg(_typeContest).arg(_typeContestN);
//"logs"
//"id, logdate, stationcall, comment, logtype"
- //qDebug() << "DataProxy_SQLite::addNewLog query1: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::addNewLog query1: " << queryString << endl;
sqlOK = query.exec(queryString);
if (sqlOK)
@@ -5476,9 +5302,8 @@ bool DataProxy_SQLite::addNewLog (const QStringList _qs)
//Now we add the new log
- //queryString = QString("INSERT INTO logs (logdate, stationcall, operators, comment, logtype, logtypen) values('%1','%2','%3','%4', '%5', '%6')").arg(_dateString).arg(_stationCallsign).arg(_operators).arg(_comment).arg(_typeContest).arg(_typeContestN);
- queryString = QString("INSERT INTO logs (logdate, stationcall, operators, comment) values('%1','%2','%3','%4')").arg(_dateString).arg(_stationCallsign).arg(_operators).arg(_comment);
- //qDebug() << "DataProxy_SQLite::addNewLog query1: " << queryString << endl;
+ queryString = QString("INSERT INTO logs (logdate, stationcall, operators, comment, logtype, logtypen) values('%1','%2','%3','%4', '%5', '%6')").arg(_dateString).arg(_stationCallsign).arg(_operators).arg(_comment).arg(_typeContest).arg(_typeContestN);
+ //qDebug() << "DataProxy_SQLite::addNewLog query1: " << queryString << endl;
sqlOK = query.exec(queryString);
@@ -5493,21 +5318,21 @@ bool DataProxy_SQLite::addNewLog (const QStringList _qs)
query.finish();
return false;
}
- //return false;
+ return false;
}
bool DataProxy_SQLite::doesThisLogExist(const int _log)
{
- //qDebug() << "DataProxy_SQLite::doesThisLogExist: " << QString::number(_log) << endl;
- //qDebug() << "DataProxy_SQLite::doesThisLogExist - Name:" << db->getDBName() << endl;
+ //qDebug() << "DataProxy_SQLite::doesThisLogExist: " << QString::number(_log) << endl;
+ //qDebug() << "DataProxy_SQLite::doesThisLogExist - Name:" << db->getDBName() << endl;
QSqlQuery query;
QString queryString = QString("SELECT id FROM logs WHERE id='%1'").arg(_log);
bool sqlOK = query.exec(queryString);
- //qDebug() << "DataProxy_SQLite::doesThisLogExist: query: " << query.lastQuery() << endl;
+ //qDebug() << "DataProxy_SQLite::doesThisLogExist: query: " << query.lastQuery() << endl;
if (sqlOK)
{
@@ -5516,20 +5341,20 @@ bool DataProxy_SQLite::doesThisLogExist(const int _log)
if (query.isValid())
{
query.finish();
- //qDebug() << "DataProxy_SQLite::doesThisLogExist: END TRUE" << endl;
+ //qDebug() << "DataProxy_SQLite::doesThisLogExist: END TRUE" << endl;
return true;
}
else
{
query.finish();
- //qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 1" << endl;
+ //qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 1" << endl;
return false;
}
}
else
{
query.finish();
- //qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 2" << endl;
+ //qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 2" << endl;
return false;
}
}
@@ -5537,10 +5362,10 @@ bool DataProxy_SQLite::doesThisLogExist(const int _log)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 3" << endl;
+ //qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 3" << endl;
return false;
}
- //qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 4" << endl;
+ //qDebug() << "DataProxy_SQLite::doesThisLogExist: END FALSE 4" << endl;
//return false;
}
@@ -5709,42 +5534,6 @@ bool DataProxy_SQLite::isValidContinentShortName(const QString &_n)
}
}
-bool DataProxy_SQLite::isValidDXCC(const int _e)
-{
- QString queryString = QString("SELECT id FROM entity WHERE dxcc ='%1'").arg(_e);
- QSqlQuery query;
- bool sqlOK = query.exec(queryString);
-
- if (sqlOK)
- {
- if (query.next())
- {
- if (query.isValid())
- {
- if (query.value(0).toInt()==1)
- query.finish();
- return true;
- }
- else
- {
- query.finish();
- return false;
- }
- }
- else
- {
- query.finish();
- return false;
- }
- }
- else
- {
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- query.finish();
- return false;
- }
-}
-
int DataProxy_SQLite::getITUzFromPrefix(const QString &_p)
{
QSqlQuery query;
@@ -5864,7 +5653,7 @@ int DataProxy_SQLite::getITUzFromEntity(const int _n)
QString DataProxy_SQLite::getEntityNameFromId(const int _n)
{
- //qDebug() << "DataProxy_SQLite::getEntityNameFromId: " << QString::number(_n) << endl;
+ //qDebug() << "DataProxy_SQLite::getEntityNameFromId: " << QString::number(_n) << endl;
QSqlQuery query;
QString queryString = QString("SELECT name FROM entity WHERE dxcc='%1'").arg(_n);
@@ -5936,7 +5725,7 @@ QString DataProxy_SQLite::getEntityNameFromId(const int _n)
int DataProxy_SQLite::getEntityIdFromName(const QString &_e)
{
- //qDebug() << "DataProxy_SQLite::getEntityIdFromName:" << _e << endl;
+ //qDebug() << "DataProxy_SQLite::getEntityIdFromName:" << _e << endl;
int id = -1;
QString queryString;
@@ -5968,12 +5757,12 @@ int DataProxy_SQLite::getEntityIdFromName(const QString &_e)
return -1;
}
}
-
+ //return -1;
}
QString DataProxy_SQLite::getEntityMainPrefix(const int _entityN)
{
- //qDebug() << "DataProxy_SQLite::getEntityMainPrefix:" << QString::number(_entityN) << endl;
+ //qDebug() << "DataProxy_SQLite::getEntityMainPrefix:" << QString::number(_entityN) << endl;
if (_entityN <= 0 )
{
@@ -6013,43 +5802,9 @@ QString DataProxy_SQLite::getEntityMainPrefix(const int _entityN)
//return QString();
}
-int DataProxy_SQLite::getEntityIdFromMainPrefix(const QString &_e)
-{
-
- //qDebug() << "DataProxy_SQLite::getEntityIdFromMainPrefix:" << _e << endl;
-
- int id = -1;
- QString queryString;
- QSqlQuery query;
- queryString = QString("SELECT dxcc FROM entity WHERE mainprefix='%1'").arg(_e);
- bool sqlOK = query.exec(queryString);
-
- if (!sqlOK)
- {
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- query.finish();
- return id;
- }
- else
- {
- query.next();
- if (query.isValid())
- {
- id = (query.value(0)).toInt();
- query.finish();
- return id;
- }
- else
- {
- query.finish();
- return -1;
- }
- }
-}
-
int DataProxy_SQLite::getDXCCFromPrefix(const QString &_p)
{
- //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix - " << Q_FUNC_INFO << "-" << _p << "-" << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix - " << Q_FUNC_INFO << "-" << _p << "-" << endl;
QSqlQuery query;
QString queryString = QString("SELECT dxcc FROM prefixesofentity WHERE prefix='%1'").arg(_p);
@@ -6057,36 +5812,36 @@ int DataProxy_SQLite::getDXCCFromPrefix(const QString &_p)
if (sqlOK)
{
- //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: query OK: query: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: query OK: query: " << queryString << endl;
if (query.next())
{
if (query.isValid())
{
int v = (query.value(0)).toInt();
query.finish();
- //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: return 0: " << QString::number(v) << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: return 0: " << QString::number(v) << endl;
return v;
}
else
{
query.finish();
- //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: return -1: " << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: return -1: " << endl;
return -1;
}
}
else
{
query.finish();
- //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: return -2: " << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: return -2: " << endl;
return -2;
}
}
else
{
- //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: query NOK: query: " << queryString << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: query NOK: query: " << queryString << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
query.finish();
- //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: return -3: " << endl;
+ //qDebug() << "DataProxy_SQLite::getDXCCFromPrefix: return -3: " << endl;
return -3;
}
//return -4;
@@ -6278,7 +6033,7 @@ QString DataProxy_SQLite::getEntityPrefixes(const int _enti)
QStringList DataProxy_SQLite::getEntitiesNames()
{
- //qDebug() << "DataProxy_SQLite::getEntitiesNames" << endl;
+ //qDebug() << "DataProxy_SQLite::getEntitiesNames" << endl;
QString aux = QString();
QStringList qs;
qs.clear();
@@ -6354,7 +6109,7 @@ QStringList DataProxy_SQLite::getEntitiesIds()
* The following code was showing in the Entities prefixes and entities like Sicily, African Italy... and they are not officially an entity in the DXCC
QStringList DataProxy_SQLite::getEntitiesNames()
{
- //qDebug() << "DataProxy_SQLite::getEntitiesNames" << endl;
+ //qDebug() << "DataProxy_SQLite::getEntitiesNames" << endl;
QString aux = QString();
QStringList qs;
qs.clear();
@@ -6369,14 +6124,14 @@ QStringList DataProxy_SQLite::getEntitiesNames()
if (query.isValid())
{
dxcc = query.value(2).toInt();
- //qDebug() << "DataProxy_SQLite::getEntitiesNames - DXCC: " << QString::number(dxcc) << endl;
+ //qDebug() << "DataProxy_SQLite::getEntitiesNames - DXCC: " << QString::number(dxcc) << endl;
if (dxcc > 1000)
{
- //qDebug() << "DataProxy_SQLite::getEntitiesNames - DXCC>1000 going in details: " << endl;
+ //qDebug() << "DataProxy_SQLite::getEntitiesNames - DXCC>1000 going in details: " << endl;
aux2 = QString::number(dxcc);
aux2 = aux2.right(3);
- //qDebug() << "DataProxy_SQLite::getEntitiesNames - aux2: " << aux2 << endl;
+ //qDebug() << "DataProxy_SQLite::getEntitiesNames - aux2: " << aux2 << endl;
queryString = QString("SELECT mainprefix, name FROM entity WHERE dxcc ='%1'").arg(aux2);
if (query2.exec(queryString))
@@ -6402,13 +6157,13 @@ QStringList DataProxy_SQLite::getEntitiesNames()
}
else
{
- //qDebug() << "DataProxy_SQLite::getEntitiesNames - DXCC<1000 quick! " << endl;
+ //qDebug() << "DataProxy_SQLite::getEntitiesNames - DXCC<1000 quick! " << endl;
aux.clear();
aux = (query.value(0)).toString() + "-" + (query.value(1)).toString()+" ("+QString::number(dxcc)+")";
}
- //qDebug() << "DataProxy_SQLite::getEntitiesNames - AUX: " << aux << endl;
+ //qDebug() << "DataProxy_SQLite::getEntitiesNames - AUX: " << aux << endl;
//result = result + ", " + (query.value(0)).toString();
qs << aux;
}
@@ -6499,7 +6254,7 @@ int DataProxy_SQLite::getMaxEntityID(bool limit)
bool DataProxy_SQLite::updateISONames()
{
- //qDebug() << "DataProxy_SQLite::updateISONames" << endl;
+ //qDebug() << "DataProxy_SQLite::updateISONames" << endl;
bool result;
result = db->updateTheEntityTableISONames();
@@ -6508,10 +6263,10 @@ bool DataProxy_SQLite::updateISONames()
QString DataProxy_SQLite::getISOName(const int _n)
{
- //qDebug() << "DataProxy_SQLite::getISONames: " << QString::number(_n) << endl;
+ //qDebug() << "DataProxy_SQLite::getISONames: " << QString::number(_n) << endl;
if (_n <= 0 )
{
- //qDebug() << "DataProxy_SQLite::getISONames: NOT KNOWN - UN" << endl;
+ //qDebug() << "DataProxy_SQLite::getISONames: NOT KNOWN - UN" << endl;
return "un"; // When no flag is known, we return the UN flag
}
@@ -6525,7 +6280,7 @@ QString DataProxy_SQLite::getISOName(const int _n)
if (!sqlOK)
{
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- //qDebug() << "DataProxy_SQLite::getISOName: Query error - UN" << endl;
+ //qDebug() << "DataProxy_SQLite::getISOName: Query error - UN" << endl;
query.finish();
return "nu"; // When no flag is known, we return the UN flag
}
@@ -6534,7 +6289,7 @@ QString DataProxy_SQLite::getISOName(const int _n)
query.next();
if (query.isValid()){
- //qDebug() << "DataProxy_SQLite::getISOName: ISO Name: " << (query.value(0)).toString() << endl;
+ //qDebug() << "DataProxy_SQLite::getISOName: ISO Name: " << (query.value(0)).toString() << endl;
aux = (query.value(0)).toString();
query.finish();
if (aux.length()>1)
@@ -6549,18 +6304,18 @@ QString DataProxy_SQLite::getISOName(const int _n)
}
else
{
- //qDebug() << "DataProxy_SQLite::getISOName: NO ISO Name: " << endl;
+ //qDebug() << "DataProxy_SQLite::getISOName: NO ISO Name: " << endl;
query.finish();
return "un"; // When no flag is known, we return the UN flag
}
}
- //qDebug() << "DataProxy_SQLite::getISOName: NO ISO Name: default" << endl;
+ //qDebug() << "DataProxy_SQLite::getISOName: NO ISO Name: default" << endl;
//return "un"; // When no flag is known, we return the UN flag
}
void DataProxy_SQLite::getFoundInLog(const QString &_txt, const int _log)
{
- //qDebug() << "DataProxy_SQLite::getFoundInLog: " << _txt << "/" << QString::number(_log) << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: " << _txt << "/" << QString::number(_log) << endl;
/*
searching = true;
executionN++;
@@ -6572,12 +6327,12 @@ void DataProxy_SQLite::getFoundInLog(const QString &_txt, const int _log)
qsoDataFound.clear();
if (_txt.length()<2)
{
- //qDebug() << "DataProxy_SQLite::getFoundInLog: lengh shorter than 2" << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: lengh shorter than 2" << endl;
searching = false;
return;
}
- //qDebug() << "DataProxy_SQLite::getFoundInLog: let's go searching!" << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: let's go searching!" << endl;
if (_log <= 0)
{
queryString = QString("SELECT call, qso_date, time_on, bandid, modeid, qsl_rcvd, qsl_sent, station_callsign, id FROM log WHERE call LIKE '%%1%'").arg(_txt);
@@ -6590,7 +6345,7 @@ void DataProxy_SQLite::getFoundInLog(const QString &_txt, const int _log)
bool sqlOk = query.exec(queryString);
if (sqlOk)
{
- //qDebug() << "DataProxy_SQLite::getFoundInLog: Query OK" << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: Query OK" << endl;
QSqlRecord rec = query.record();
int nameCol = -1;
int counter = 0;
@@ -6599,12 +6354,12 @@ void DataProxy_SQLite::getFoundInLog(const QString &_txt, const int _log)
if (query.isValid())
{
counter++;
- //qDebug() << "DataProxy_SQLite::getFoundInLog: Data found: - " << QString::number(counter) << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: Data found: - " << QString::number(counter) << endl;
qsoDataFound.clear();
nameCol = rec.indexOf("call");
qsoDataFound << "call:" + (query.value(nameCol)).toString();
- //qDebug() << "DataProxy_SQLite::getFoundInLog: Data found: " << (query.value(nameCol)).toString() << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: Data found: " << (query.value(nameCol)).toString() << endl;
nameCol = rec.indexOf("qso_date");
qsoDataFound << "qso_date:" + (query.value(nameCol)).toString();
@@ -6642,26 +6397,26 @@ void DataProxy_SQLite::getFoundInLog(const QString &_txt, const int _log)
if (qsoDataFound.length()>1)
{
emit qsoFound(qsoDataFound);
- //qDebug() << "DataProxy_SQLite::getFoundInLog: Emitting qsoDataFound... (exec: "<< QString::number(executionN) << ") Call-id: " << qsoDataFound.at(0) << "-" << qsoDataFound.at(8) << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: Emitting qsoDataFound... (exec: "<< QString::number(executionN) << ") Call-id: " << qsoDataFound.at(0) << "-" << qsoDataFound.at(8) << endl;
}
else
{
- //qDebug() << "DataProxy_SQLite::getFoundInLog: NOT emitting qsoDataFound... (exec: "<< QString::number(executionN) << ")" << endl;
- //qDebug() << "DataProxy_SQLite::getFoundInLog: NOT Emitting qsoDataFound..." << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: NOT emitting qsoDataFound... (exec: "<< QString::number(executionN) << ")" << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: NOT Emitting qsoDataFound..." << endl;
}
} // Closes if next.isValid
} // Closes While
- //qDebug() << "DataProxy_SQLite::getFoundInLog: No more data!" << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: No more data!" << endl;
return;
}
else
{
- //qDebug() << "DataProxy_SQLite::getFoundInLog: Error 1: Query NOK" << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: Error 1: Query NOK" << endl;
searching = false;
return;
}
- //qDebug() << "DataProxy_SQLite::getFoundInLog: Error 2" << endl;
+ //qDebug() << "DataProxy_SQLite::getFoundInLog: Error 2" << endl;
searching = false;
return;
*/
@@ -6670,7 +6425,7 @@ void DataProxy_SQLite::getFoundInLog(const QString &_txt, const int _log)
/*
bool DataProxy_SQLite::queryPrepare(const QString &_query)
{
- //qDebug() << "DataProxy_SQLite::queryPrepare: " << _query << endl;
+ //qDebug() << "DataProxy_SQLite::queryPrepare: " << _query << endl;
//return preparedQuery.prepare( _query );
//return preparedQuery.prepare("INSERT INTO log (call, qso_date, bandid, modeid, time_on, time_off, srx, stx, srx_string, stx_string, qso_date_off, band_rx, rst_sent, rst_rcvd, cqz, ituz, dxcc, address, age, cnty, comment, a_index, ant_az, ant_el, ant_path, arrl_sect, checkcontest, class, contacted_op, contest_id, country, credit_submitted, credit_granted, distance, eq_call, email, eqsl_qslrdate, eqsl_qslsdate, eqsl_qsl_rcvd, eqsl_qsl_sent, force_init, freq, freq_rx, gridsquare, my_gridsquare, iota, iota_island_id, my_iota, my_iota_island_id, k_index, lat, lon, my_lat, my_lon, lotw_qslrdate, lotw_qslsdate, lotw_qsl_rcvd, lotw_qsl_sent, clublog_qso_upload_date, clublog_qso_upload_status, max_bursts, ms_shower, my_city, my_cnty, my_country, my_cq_zone, my_name, name, operator, station_callsign, owner_callsign, my_rig, my_sig, my_sig_info, my_state, state, my_street, notes, nr_bursts, nr_pings, pfx, precedence, prop_mode, public_key, qslmsg, qslrdate, qslsdate, qsl_rcvd, qsl_sent, qsl_rcvd_via, qsl_sent_via, qsl_via, qso_complete, qso_random, qth, rx_pwr, tx_pwr, sat_mode, sat_name, sfi, sig, swl, ten_ten, web, points, multiplier, lognumber) VALUES (:call, :qso_date, :bandid, :modeid, :time_on, :time_off, :srx, :stx, :srx_string, :stx_string, :qso_date_off, :band_rx, :rst_sent, :rst_rcvd, :cqz, :ituz, :dxcc, :address, :age, :cnty, :comment, :a_index, :ant_az, :ant_el, :ant_path, :arrl_sect, :checkcontest, :class, :contacted_op, :contest_id, :country, :credit_submitted, :credit_granted, :distance, :eq_call, :email, :eqsl_qslrdate, :eqsl_qslsdate, :eqsl_qsl_rcvd, :eqsl_qsl_sent, :force_init, :freq, :freq_rx, :gridsquare, :my_gridsquare, :iota, :iota_island_id, :my_iota, :my_iota_island_id, :k_index, :lat, :lon, :my_lat, :my_lon, :lotw_qslrdate, :lotw_qslsdate, :lotw_qsl_rcvd, :lotw_qsl_sent, :clublog_qso_upload_date, :clublog_qso_upload_status, :max_bursts, :ms_shower, :my_city, :my_cnty, :my_country, :my_cq_zone, :my_name, :name, :operator, :station_callsign, :owner_callsign, :my_rig, :my_sig, :my_sig_info, :my_state, :state, :my_street, :notes, :nr_bursts, :nr_pings, :pfx, :precedence, :prop_mode, :public_key, :qslmsg, :qslrdate, :qslsdate, :qsl_rcvd, :qsl_sent, :qsl_rcvd_via, :qsl_sent_via, :qsl_via, :qso_complete, :qso_random, :qth, :rx_pwr, :tx_pwr, :sat_mode, :sat_name, :sfi, :sig, :swl, :ten_ten, :web, :points, :multiplier, :lognumber)");
@@ -6680,7 +6435,7 @@ bool DataProxy_SQLite::queryPrepare(const QString &_query)
bool DataProxy_SQLite::queryBind(const QString &_field, const QString &value)
{
- //qDebug() << "DataProxy_SQLite::queryBind: " << _field << "/" << value << endl;
+ //qDebug() << "DataProxy_SQLite::queryBind: " << _field << "/" << value << endl;
//preparedQuery.bindValue( _field, value );
//db->queryBind(_field, value);
@@ -6691,18 +6446,18 @@ bool DataProxy_SQLite::queryBind(const QString &_field, const QString &value)
bool DataProxy_SQLite::queryExec()
{
- //qDebug() << "DataProxy_SQLite::queryExec " << endl;
+ //qDebug() << "DataProxy_SQLite::queryExec " << endl;
bool sqlOK = db->queryExec();
if (!sqlOK)
{
//emit queryError(Q_FUNC_INFO, preparedQuery.lastError().databaseText(), preparedQuery.lastError().number(), preparedQuery.lastQuery());
- //qDebug() << "DataProxy_SQLite::queryExec - FAILED execution " << endl;
+ //qDebug() << "DataProxy_SQLite::queryExec - FAILED execution " << endl;
}
else
{
- //qDebug() << "DataProxy_SQLite::queryExec - executed " << endl;
+ //qDebug() << "DataProxy_SQLite::queryExec - executed " << endl;
}
return sqlOK;
}
@@ -6710,7 +6465,7 @@ bool DataProxy_SQLite::queryExec()
int DataProxy_SQLite::getPrefixId(const QString &_qrz)
{
- //qDebug() << "DataProxy_SQLite::getPrefixId: -" << _qrz <<"-" << endl;
+ //qDebug() << "DataProxy_SQLite::getPrefixId: -" << _qrz <<"-" << endl;
//TODO: Instead of going from long to short, identify prefixes from the begining:
// character(may be number) + number
@@ -6726,20 +6481,20 @@ int DataProxy_SQLite::getPrefixId(const QString &_qrz)
{
entityID = getDXCCFromPrefix(aux);
- //qDebug() << "DataProxy_SQLite::getPrefixId: in the while" << aux << " = " << QString::number(entityID) << endl;
+ //qDebug() << "DataProxy_SQLite::getPrefixId: in the while" << aux << " = " << QString::number(entityID) << endl;
if (entityID<=0)
{
aux.chop(1);
}
}
- //qDebug() << "DataProxy_SQLite::getPrefixId: " << _qrz << QString::number(entityID) << endl;
+ //qDebug() << "DataProxy_SQLite::getPrefixId: " << _qrz << QString::number(entityID) << endl;
return entityID;
}
QString DataProxy_SQLite::changeSlashAndFindPrefix(const QString &_qrz)
{
- //qDebug() << "DataProxy_SQLite::changeSlashAndFindPrefix: -" << _qrz <<"-" << endl;
+ //qDebug() << "DataProxy_SQLite::changeSlashAndFindPrefix: -" << _qrz <<"-" << endl;
int iaux1, iaux2;
QString aux = _qrz.toUpper();
@@ -6761,7 +6516,7 @@ QString DataProxy_SQLite::changeSlashAndFindPrefix(const QString &_qrz)
aux.remove(aux.length()-1,1);
}
iaux1 = aux.indexOf('/');
- //qDebug() << "DataProxy_SQLite::changeSlashAndFindPrefix: Slash found at: " << QString::number(iaux1) << endl;
+ //qDebug() << "DataProxy_SQLite::changeSlashAndFindPrefix: Slash found at: " << QString::number(iaux1) << endl;
iaux2 = (aux.length())- iaux1; // iaux2 is the length of the second part
if (iaux2 < 0){
diff --git a/dataproxy_sqlite.h b/dataproxy_sqlite.h
index e7835081..3c8e5062 100644
--- a/dataproxy_sqlite.h
+++ b/dataproxy_sqlite.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
#include
@@ -30,6 +30,7 @@
#include
//#include
+#include "dataproxy_sqlite.h"
#include "database.h"
@@ -85,9 +86,6 @@ public:
bool isThisFreqInBand(const QString &_band, const QString &_fr);
int getLastQSOid();
- QDate getFirstQSODateFromCall (const QString &_call); // If the callsign provided is not valid it provides the date of the first QSO
- QDate getLastQSODateFromCall (const QString &_call); // If the callsign provided is not valid it provides the date of the last QSO
-
bool addQSOFromWSJTX(const QString &_dxcall, const double _freq, const QString &_mode,
const QString &_dx_grid, const QString &_time_off, const QString &_report_sent, const QString &_report_rec,
const QString &_tx_power, const QString &_comments, const QString &_name, const QString &_time_on,
@@ -135,19 +133,12 @@ public:
//LOTW
- bool lotwSentQueue(const QString &_updateDate, const int _currentLog); // Mark LOTW QSL SENT as Q (Queued)
- bool lotwSentYes(const QString &_updateDate, const int _currentLog, const QString &_station); // Update LOTW QSL SENT marked as Q as Y (Queued)
- bool lotwSentQSOs(const QList &_qsos);
- int lotwUpdateQSLReception (const QString &_call, const QString &_qso_date, const QString &_time_on, const QString &_band, const QString &_mode, const QString &_qslrdate);
- QList getQSOsListLoTWNotSent(const QString &_stationCallsign, const QDate &_startDate, const QDate &_endDate, bool _justQueued=true);
- QStringList getQSODetailsForLoTWDownload(const int _id);
int getContinentIdFromContinentShortName(const QString &_n);
QString getContinentShortNameFromEntity(const int _n);
int getContinentIdFromEntity(const int _n);
QStringList getContinentShortNames();
bool isValidContinentShortName(const QString &_n);
- bool isValidDXCC(const int _e);
int getCQzFromPrefix(const QString &_p);
int getCQzFromEntity(const int _n);
@@ -156,7 +147,6 @@ public:
QString getEntityNameFromId(const int _n);
int getEntityIdFromName(const QString &_e);
QString getEntityMainPrefix(const int _entityN);
- int getEntityIdFromMainPrefix(const QString &_e);
bool isNewCQz(int _c);
bool isNewEntity(int _e);
double getLongitudeFromEntity(const int _e);
@@ -171,6 +161,8 @@ public:
QStringList getOperatingYears(const int _currentLog);
void compressDB();
bool unMarkAllQSO(); // Unmarks all the marked QSO
+ bool lotwSentQueue(const QString &_updateDate, const int _currentLog); // Mark LOTW QSL SENT as Q (Queued)
+ bool lotwSentYes(const QString &_updateDate, const int _currentLog, const QString &_station); // Update LOTW QSL SENT marked as Q as Y (Queued)
bool clearLog();
@@ -201,11 +193,11 @@ public:
QStringList getContestNames();
QStringList getContestCat(const int _catn);
QStringList getContestOverlays();
- //int getContestTypeN(const int _co, const int _catop, const int _catas, const int _catpo, const int _catba, const int _catov, const int _catmo);
- //QStringList getDataFromContestType(const int _n);
- //int getLogTypeNumber(const QString &_logType);
- //QString getLogTypeName(const int _logType);
- //QString getLogTypeOfUserLog(const int _logN);
+ int getContestTypeN(const int _co, const int _catop, const int _catas, const int _catpo, const int _catba, const int _catov, const int _catmo);
+ QStringList getDataFromContestType(const int _n);
+ int getLogTypeNumber(const QString &_logType);
+ QString getLogTypeName(const int _logType);
+ QString getLogTypeOfUserLog(const int _logN);
int getLogNumberFromQSOId(const int _qsoId);
QStringList getBandNames();
@@ -240,7 +232,7 @@ public:
QString getOperatorsFromLog(const int _log);
QString getCommentsFromLog(const int _log);
QString getLogDateFromLog(const int _log);
- //QString getLogTypeNFromLog(const int _log);
+ QString getLogTypeNFromLog(const int _log);
bool addNewLog (const QStringList _qs);
bool doesThisLogExist(const int _log);
@@ -278,4 +270,5 @@ signals:
void queryError(QString functionFailed, QString errorCodeS, int errorCodeN, QString failedQuery); // To alert about any failed query execution
};
+
#endif // DATAPROXY_SQLITE_H
diff --git a/downloadcty.cpp b/downloadcty.cpp
index b2f9cb1e..d0425629 100644
--- a/downloadcty.cpp
+++ b/downloadcty.cpp
@@ -15,13 +15,15 @@ DownLoadCTY::DownLoadCTY(const QString _klogDir, const QString _klogVersion) : Q
manager = new QNetworkAccessManager;
request = new QNetworkRequest;
- //request->setUrl(QUrl("https://www.country-files.com/cty/cty.csv"));
- request->setUrl(QUrl("https://www.country-files.com/bigcty/cty.csv"));
+ //request->setUrl(QUrl("http://www.country-files.com/cty/cty.csv"));
+ request->setUrl(QUrl("http://www.country-files.com/bigcty/cty.csv"));
QString ver = "KLog"+_klogVersion;
QByteArray str;
str.clear();
str.append(util->getAgent(_klogVersion));
+ //str.append(_klogVersion);
+ //request.setUrl(QUrl("http://qt.nokia.com"));
request->setRawHeader("User-Agent", str);
//request->setHeader(QNetworkRequest::UserAgentHeader, str);
@@ -41,7 +43,7 @@ DownLoadCTY::~DownLoadCTY()
void DownLoadCTY::slotDownloadFinished(QNetworkReply *reply)
{
//qDebug() << "DownLoadCTY::slotDownloadFinished" << endl;
- emit downloadStopped();
+
QUrl url = reply->url();
//qDebug() << "DownLoadCTY::slotDownloadFinished - URL: " << url.toString() << endl;
@@ -84,7 +86,7 @@ DownLoadCTY::~DownLoadCTY()
reply->deleteLater();
- emit done(true);
+ emit done();
}
@@ -124,7 +126,7 @@ void DownLoadCTY::slotErrorManagement(QNetworkReply::NetworkError networkError)
//qDebug() << "DownLoadCTY::downloadFinished: ERROR: " << QString::number(result) << endl;
}
- emit actionError(result);
+ actionError(result);
}
QString DownLoadCTY::saveFileName(const QUrl &url)
@@ -149,6 +151,7 @@ QString DownLoadCTY::saveFileName(const QUrl &url)
msgBox.exec();
+
// already exists, don't overwrite
//int i = 0;
//basename += '.';
diff --git a/downloadcty.h b/downloadcty.h
index 1b2dca74..f79c7f0a 100644
--- a/downloadcty.h
+++ b/downloadcty.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
#include
@@ -74,10 +74,9 @@ private slots:
signals:
void actionReturnDownload(const int _i);
- void done(bool _success);
+ void done();
void actionShowProgres(qint64 received, qint64 total);
void actionError(const int _i);
- void downloadStopped();
};
diff --git a/dxccstatuswidget.cpp b/dxccstatuswidget.cpp
index eaca8bfd..8dde3a76 100644
--- a/dxccstatuswidget.cpp
+++ b/dxccstatuswidget.cpp
@@ -11,16 +11,16 @@ TODO: Call the creation of this depending on the bands that the user is using
DXCCStatusWidget::DXCCStatusWidget(DataProxy_SQLite *dp, const QString &_parentFunction, QWidget *parent) : QWidget(parent)
{
- //qDebug() << "DXCCStatusWidget::DXCCStatusWidget from: " << _parentFunction << endl;
+ //qDebug() << "DXCCStatusWidget::DXCCStatusWidget from: " << _parentFunction << endl;
dataProxy = dp;
locator = new Locator();
awards = new Awards(dataProxy, Q_FUNC_INFO);
- //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-1" << endl;
+ //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-1" << endl;
world = new World(dataProxy,Q_FUNC_INFO);
- //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-2" << endl;
+ //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-2" << endl;
dxccView = new QTableWidget;
- //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-3" << endl;
+ //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-3" << endl;
dxccView->setMouseTracking(true);
dxccView->setSortingEnabled(true);
numberOfColumns = 0;
@@ -31,39 +31,39 @@ DXCCStatusWidget::DXCCStatusWidget(DataProxy_SQLite *dp, const QString &_parentF
bandNames.clear();
validBands.clear();
- //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-4" << endl;
+ //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-4" << endl;
setDefaultBands();
- //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-5" << endl;
+ //qDebug() << "DXCCStatusWidget::DXCCStatusWidget-5" << endl;
createUI();
- //qDebug() << "DXCCStatusWidget::DXCCStatusWidget - END" << endl;
+ //qDebug() << "DXCCStatusWidget::DXCCStatusWidget - END" << endl;
}
DXCCStatusWidget::~DXCCStatusWidget(){}
void DXCCStatusWidget::createUI()
{
- //qDebug() << "DXCCStatusWidget::createUI " << endl;
+ //qDebug() << "DXCCStatusWidget::createUI " << endl;
// We remove the vertical header
hv = dxccView->verticalHeader();
hv->hide();
hv->setStretchLastSection(true);
hh = dxccView->horizontalHeader();
- //qDebug() << "DXCCStatusWidget::createUI-10" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-10" << endl;
refreshButton->setText(tr("Update"));
//showAllLogsButton->setText("All logs");
- //qDebug() << "DXCCStatusWidget::createUI-11" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-11" << endl;
dxccView->setContextMenuPolicy(Qt::CustomContextMenu);
- //qDebug() << "DXCCStatusWidget::createUI-12" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-12" << endl;
dxccView->setColumnCount(numberOfColumns);
- //qDebug() << "DXCCStatusWidget::createUI-13" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-13" << endl;
dxccView->horizontalHeader()->setStretchLastSection(true);
- //qDebug() << "DXCCStatusWidget::createUI-14" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-14" << endl;
- //qDebug() << "DXCCStatusWidget::createUI-15" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-15" << endl;
dxccView->setRowCount(0);
- //qDebug() << "DXCCStatusWidget::createUI-20" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-20" << endl;
QHBoxLayout *bottonLineLayout = new QHBoxLayout;
bottonLineLayout->addSpacerItem(new QSpacerItem(10,0,QSizePolicy::Expanding,QSizePolicy::Maximum));
bottonLineLayout->addWidget(refreshButton);
@@ -72,84 +72,76 @@ void DXCCStatusWidget::createUI()
tabLayout->addWidget(dxccView);
tabLayout->addLayout(bottonLineLayout);
setLayout(tabLayout);
- //qDebug() << "DXCCStatusWidget::createUI-30" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-30" << endl;
dxccView->resizeColumnsToContents();
dxccView->resizeRowsToContents();
- //qDebug() << "DXCCStatusWidget::createUI-90" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-90" << endl;
connect(refreshButton, SIGNAL(clicked()), this, SLOT(slotRefreshButtonClicked() ) );
- //qDebug() << "DXCCStatusWidget::createUI-91" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-91" << endl;
connect(dxccView, SIGNAL(itemDoubleClicked(QTableWidgetItem *)), this, SLOT(slotItemDoubleClicked(QTableWidgetItem *) ) );
- //qDebug() << "DXCCStatusWidget::createUI-92" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-92" << endl;
connect(dxccView, SIGNAL(itemEntered(QTableWidgetItem *)), this, SLOT(slotItemEntered(QTableWidgetItem *) ) );
- //connect(dxccView, SIGNAL(customContextMenuRequested( const QPoint& ) ), this, SLOT(slotRightButton( const QPoint& ) ) );
- //qDebug() << "DXCCStatusWidget::createUI-93" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-93" << endl;
//dxccView->setSortingEnabled(false);
- //qDebug() << "DXCCStatusWidget::createUI-END" << endl;
+ //qDebug() << "DXCCStatusWidget::createUI-END" << endl;
}
void DXCCStatusWidget::update()
{
- //qDebug() << "DXCCStatusWidget::update " << endl;
+ //qDebug() << "DXCCStatusWidget::update " << endl;
//int entities = world->getHowManyEntities();
int entities = dataProxy->getMaxEntityID(false);
- //qDebug() << "DXCCStatusWidget::update: " << QString::number(entities) << " entities to update" << endl;
+ //qDebug() << "DXCCStatusWidget::update: " << QString::number(entities) << " entities to update" << endl;
QStringList list;
- //qDebug() << "DXCCStatusWidget::update: -1" << endl;
+ //qDebug() << "DXCCStatusWidget::update: -1" << endl;
list.clear();
- //qDebug() << "DXCCStatusWidget::update: -2" << endl;
+ //qDebug() << "DXCCStatusWidget::update: -2" << endl;
- QString aux, prefix;
- //qDebug() << "DXCCStatusWidget::update: -3" << endl;
- if (dxccView->columnCount()>0)
+ QString aux;
+ //qDebug() << "DXCCStatusWidget::update: -3" << endl;
+ if (dxccView->columnCount()>1)
{
//dxccView->sortByColumn(1, Qt::AscendingOrder);
dxccView->clearContents();
tempLog = -1;
- //qDebug() << "DXCCStatusWidget::update pre FOR" << endl;
+ //qDebug() << "DXCCStatusWidget::update pre FOR" << endl;
for (int i=1; i<=entities; i++)
{
- //qDebug() << "DXCCStatusWidget::update in FOR " << QString::number(i) << endl;
+ //qDebug() << "DXCCStatusWidget::update in FOR " << QString::number(i) << endl;
aux = world->getEntityName(i);
- prefix = world->getEntityMainPrefix(i);
- if (prefix.startsWith("*"))
- {
- QString a = prefix.right(prefix.length()-1);
- prefix = a;
- }
- //qDebug() << "DXCCStatusWidget::update in FOR aux: " << aux << endl;
+ //qDebug() << "DXCCStatusWidget::update in FOR aux: " << aux << endl;
list.clear();
if (aux.length()>2) // Not all integers refers to an entity.
{
- list << prefix << aux << bandNames;
+ list << QString::number(i) << aux << bandNames;
addEntity(list);
}
}
}
- //qDebug() << "DXCCStatusWidget::update END" << endl;
+ //qDebug() << "DXCCStatusWidget::update END" << endl;
}
void DXCCStatusWidget::addEntity(const QStringList &_ent)
{
- //qDebug() << "DXCCStatusWidget::addEntity: " << _ent.at(1) << " / " << QString::number(_ent.length()) << endl;
+ //qDebug() << "DXCCStatusWidget::addEntity: " << _ent.at(1) << " / " << QString::number(_ent.length()) << endl;
// DXCC id, Entity Name, bandName1, bandName2, ...
if (_ent.length() != numberOfColumns)
{
- //qDebug() << "DXCCStatusWidget::addEntity: ERROR: in number of columns" << QString::number(_ent.length()) << "/" << QString::number(numberOfColumns) << endl;
+ //qDebug() << "DXCCStatusWidget::addEntity: ERROR: in number of columns" << QString::number(_ent.length()) << "/" << QString::number(numberOfColumns) << endl;
return;
}
int status = -1;
- int ent = dataProxy->getEntityIdFromMainPrefix(_ent.at(0));
- //(_ent.at(0)).toInt();
+
+ int ent = (_ent.at(0)).toInt();
int bandid = 0;
- //qDebug() << "DXCCStatusWidget::addEntity: ent = " << QString::number(ent) << endl;
QString entName = _ent.at(1);
if (entName.length()<2)
{
- //qDebug() << "DXCCStatusWidget::addEntity: ERROR: entname too short!" << endl;
+ //qDebug() << "DXCCStatusWidget::addEntity: ERROR: entname too short!" << endl;
return;
}
@@ -170,13 +162,12 @@ void DXCCStatusWidget::addEntity(const QStringList &_ent)
flagSt = ":/flags/" + aux + ".png";
QIcon flagIcon(flagSt);
- //qDebug() << "DXCCStatusWidget::addEntity: Flag: " << flagSt << endl;
+ //qDebug() << "DXCCStatusWidget::addEntity: Flag: " << flagSt << endl;
dxccView->insertRow(dxccView->rowCount());
- //qDebug() << "DXCCStatusWidget::addEntity: rowCount: " << QString::number(dxccView->rowCount()) << endl;
+ //qDebug() << "DXCCStatusWidget::addEntity: rowCount: " << QString::number(dxccView->rowCount()) << endl;
QTableWidgetItem *newItemID = new QTableWidgetItem(_ent.at(0));
-
newItemID->setTextAlignment(Qt::AlignCenter);
newItemID->setFlags(Qt::NoItemFlags);
dxccView->setItem(dxccView->rowCount()-1, 0, newItemID);
@@ -185,8 +176,10 @@ void DXCCStatusWidget::addEntity(const QStringList &_ent)
{
bandid = dataProxy->getIdFromBandName(_ent.at(i));
QTableWidgetItem *newItem = new QTableWidgetItem(awards->getDXCCStatusBand(ent, bandid, tempLog));
- newItem->setTextAlignment(Qt::AlignCenter);
+ newItem->setTextAlignment(Qt::AlignCenter);
+ //newItem->setFlags(Qt::NoItemFlags);
newItem->setFlags(Qt::ItemIsEnabled);
+ //newItem->setFont(font);
if (newItem->text()=="C")
{
@@ -205,16 +198,13 @@ void DXCCStatusWidget::addEntity(const QStringList &_ent)
}
else
{
+
}
dxccView->setItem(dxccView->rowCount()-1, i, newItem);
- //qDebug() << "DXCCStatusWidget::addEntity: rowCount-2: " << QString::number(dxccView->rowCount()) << "/" << QString::number(i) << " / " << newItem->text() << endl;
+ //qDebug() << "DXCCStatusWidget::addEntity: rowCount-2: " << QString::number(dxccView->rowCount()) << "/" << QString::number(i) << " / " << newItem->text() << endl;
}
- QTableWidgetItem *newItemPref = new QTableWidgetItem(_ent.at(0));
- newItemPref->setTextAlignment(Qt::AlignLeft|Qt::AlignVCenter);
- newItemPref->setFlags(Qt::ItemIsEnabled);
-
QTableWidgetItem *newItemName = new QTableWidgetItem(entName);
newItemName->setTextAlignment(Qt::AlignLeft|Qt::AlignVCenter);
@@ -225,38 +215,44 @@ void DXCCStatusWidget::addEntity(const QStringList &_ent)
if (status == 1)
{
newItemName->setTextColor(Qt::blue);
- newItemPref->setTextColor(Qt::blue);
//newItemName->setTextColor(Qt::blue);
//newItemName->setBackgroundColor(Qt::green);
}
else if (status == 0)
{
newItemName->setTextColor(Qt::darkRed);
- newItemPref->setTextColor(Qt::darkRed);
}
else
{
newItemName->setTextColor(Qt::red);
- newItemPref->setTextColor(Qt::red);
}
- dxccView->setItem(dxccView->rowCount()-1, 0, newItemPref);
+
dxccView->setItem(dxccView->rowCount()-1, 1, newItemName);
- //qDebug() << "DXCCStatusWidget::addEntity: END" << endl;
+ //qDebug() << "DXCCStatusWidget::addEntity: END" << endl;
}
void DXCCStatusWidget::setBands(QStringList const &_ent, const bool _creating)
{// Receives the list of band names
- //qDebug() << "DXCCStatusWidget::setBands: " << endl;
+ //qDebug() << "DXCCStatusWidget::setBands: " << endl;
+ //qDebug() << "DXCCStatusWidget::setBands: " << QString::number(_ent.length()) << endl;
+ //if (_creating)
+ //{
+ //qDebug() << "DXCCStatusWidget::setBands (creating true) " << QString::number(_ent.length()) << endl;
+ //}
+ //else
+ //{
+ //qDebug() << "DXCCStatusWidget::setBands (creating false) " << QString::number(_ent.length()) << endl;
+ //}
QStringList qs;
qs.clear();
- //qDebug() << "DXCCStatusWidget::setBands - 01" << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 01" << endl;
qs << dataProxy->sortBandNamesBottonUp(_ent);
- //qDebug() << "DXCCStatusWidget::setBands - 02: Lenght qs: " << QString::number(qs.size()) << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 02: Lenght qs: " << QString::number(qs.size()) << endl;
if (qs.length()<0)
{
- //qDebug() << "DXCCStatusWidget::setBands no bands received here " << endl;
+ //qDebug() << "DXCCStatusWidget::setBands no bands received here " << endl;
return;
}
@@ -265,76 +261,88 @@ void DXCCStatusWidget::setBands(QStringList const &_ent, const bool _creating)
bandNames.clear();
//bandNames << "Id" << "Entity";
- //qDebug() << "DXCCStatusWidget::setBands - 03 " << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 03 " << endl;
validBands.clear();
//validBands << dataProxy->getBands();
- validBands = dataProxy->getBandNames();
- //qDebug() << "DXCCStatusWidget::setBands - 04 " << endl;
+ validBands << dataProxy->getBandNames();
+ //qDebug() << "DXCCStatusWidget::setBands - 04 " << endl;
//dxccView->clearContents();
dxccView->clearSelection();
dxccView->clear();
+ // for (int x = 0; x < dxccView->columnCount(); x++)
+ // {
+ // dxccView->removeColumn(x);
+ // }
+ //bands.clear();
for (int i = 0; isetColumnCount(0);
numberOfColumns = dxccView->columnCount();
+ //qDebug() << "DXCCStatusWidget::setBands 5 to Remove: " << QString::number(dxccView->columnCount()) << endl;
+ //for (int i=0; icolumnCount(); i++)
+ //{
+ // dxccView->removeColumn(i);
+// //qDebug() << "DXCCStatusWidget::setBands: Still pending: " << QString::number(i) << endl;
+ //}
+ //dxccView->clear();
while(dxccView->columnCount()>0)
{
- //qDebug() << "DXCCStatusWidget::setBands: Still pending: " << QString::number(dxccView->columnCount()) << endl;
+ //qDebug() << "DXCCStatusWidget::setBands: Still pending: " << QString::number(dxccView->columnCount()) << endl;
dxccView->removeColumn(0);
}
numberOfColumns = dxccView->columnCount();
- //qDebug() << "DXCCStatusWidget::setBands: -6 All removed: " << QString::number(numberOfColumns) << endl;
+ //qDebug() << "DXCCStatusWidget::setBands: -6 All removed: " << QString::number(numberOfColumns) << endl;
- //qDebug() << "DXCCStatusWidget::setBands - 7 " << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 7 " << endl;
- numberOfColumns = 2 + bandNames.length(); //Prefix, Entity Name
- //qDebug() << "DXCCStatusWidget::setBands - 7.1 - columnCount: " << QString::number(dxccView->columnCount()) << endl;
- //qDebug() << "DXCCStatusWidget::setBands - 7.1 - numberOfColumns: " << QString::number(numberOfColumns) << endl;
+ numberOfColumns = 2 + bandNames.length();
+ //qDebug() << "DXCCStatusWidget::setBands - 7.1 - columnCount: " << QString::number(dxccView->columnCount()) << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 7.1 - numberOfColumns: " << QString::number(numberOfColumns) << endl;
dxccView->setColumnCount(numberOfColumns);
- //qDebug() << "DXCCStatusWidget::setBands - 7.2 " << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 7.2 " << endl;
dxccView->setRowCount(0);
- //qDebug() << "DXCCStatusWidget::setBands - 7.3 " << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 7.3 " << endl;
QStringList headerqs;
- //qDebug() << "DXCCStatusWidget::setBands - 7.4 " << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 7.4 " << endl;
headerqs.clear();
- //qDebug() << "DXCCStatusWidget::setBands - 7.5 " << endl;
- headerqs << tr("Prefix") << tr("Entity") << bandNames;
- //qDebug() << "DXCCStatusWidget::setBands - 8 " << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 7.5 " << endl;
+ headerqs << tr("ID") << tr("Entity") << bandNames;
+ //qDebug() << "DXCCStatusWidget::setBands - 8 " << endl;
dxccView->setHorizontalHeaderLabels(headerqs);
- //qDebug() << "DXCCStatusWidget::setBands - 9 PRE-END" << endl;
+ //qDebug() << "DXCCStatusWidget::setBands - 9 PRE-END" << endl;
if (!_creating)
{
- //qDebug() << "DXCCStatusWidget::setBands: 9.1 !_creating" << endl;
+ //qDebug() << "DXCCStatusWidget::setBands: 9.1 !_creating" << endl;
update();
}
- //qDebug() << "DXCCStatusWidget::setBands: END" << endl;
+ //qDebug() << "DXCCStatusWidget::setBands: END" << endl;
}
void DXCCStatusWidget::setDefaultBands()
{
- //qDebug() << "DXCCStatusWidget::setDefaultBands" << endl;
+ //qDebug() << "DXCCStatusWidget::setDefaultBands" << endl;
/*
Default bands:
160M 80M 40M 30M 20M 17M 15M 12M 10M 6M 4M 2M 70CM
@@ -345,17 +353,16 @@ void DXCCStatusWidget::setDefaultBands()
bandNames << "160M" << "80M" << "40M" << "30M" << "20M" << "17M" << "15M" << "12M" << "10M" << "6M" << "4M" << "2M" << "70CM";
setBands(bandNames, true);
- //qDebug() << "DXCCStatusWidget::setDefaultBands - END" << endl;
+ //qDebug() << "DXCCStatusWidget::setDefaultBands - END" << endl;
}
void DXCCStatusWidget::slotRefreshButtonClicked()
{
- //qDebug() << "DXCCStatusWidget::slotRefreshButtonClicked" << endl;
+ //qDebug() << "DXCCStatusWidget::slotRefreshButtonClicked" << endl;
//TODO: Define a way to show the status of the selected log or all the logs in the DB
if (dxccView->rowCount()<1)
{
- //qDebug() << "DXCCStatusWidget::slotRefreshButtonClicked - rowcount <1" << endl;
return;
}
QStringList _bands = bandNames;
@@ -367,7 +374,7 @@ void DXCCStatusWidget::slotRefreshButtonClicked()
void DXCCStatusWidget::refresh()
{
- //qDebug() << "DXCCStatusWidget::refresh" << endl;
+ //qDebug() << "DXCCStatusWidget::refresh" << endl;
//update();
slotRefreshButtonClicked();
@@ -375,7 +382,7 @@ void DXCCStatusWidget::refresh()
void DXCCStatusWidget::setCurrentLog(const int _logN)
{
- //qDebug() << "DXCCStatusWidget::setCurrentLog: " << QString::number(_logN) << endl;
+ //qDebug() << "DXCCStatusWidget::setCurrentLog: " << QString::number(_logN) << endl;
if (dataProxy->doesThisLogExist(_logN))
{
logNumber = _logN;
@@ -388,15 +395,13 @@ void DXCCStatusWidget::refresh()
void DXCCStatusWidget::slotItemEntered(QTableWidgetItem * item )
{
- //qDebug() << "DXCCStatusWidget::slotItemEntered: " << ((item->data(0)).toString()).simplified() << endl;
- //qDebug() << "DXCCStatusWidget::slotItemEntered: " << item->text() << endl;
- //qDebug() << "DXCCStatusWidget::slotItemEntered: " << endl;
-
- if (dxccView->rowCount()<1)
- {
- return;
- }
-
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: " << ((item->data(0)).toString()).simplified() << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: " << item->text() << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: " << endl;
+ if (dxccView->rowCount()<1)
+ {
+ return;
+ }
QString tip;
tip.clear();
int row = -1;
@@ -404,32 +409,30 @@ void DXCCStatusWidget::refresh()
int bandi = -1;
QString band = QString();
-
if (item)
{
- // row = dxccView->row(item);
+ row = dxccView->row(item);
column = dxccView->column(item);
- //qDebug() << "DXCCStatusWidget::slotItemEntered: row: " << QString::number(row) << endl;
- //qDebug() << "DXCCStatusWidget::slotItemEntered: hrow: " << dxccView->verticalHeaderItem(row)->text() << endl;
- // row = (dxccView->item(row,0)->text()).toInt();
- int entiID = dataProxy->getEntityIdFromMainPrefix(dxccView->item(dxccView->row(item),0)->text());
- if (entiID<0)
- { // Some prefix are shown with a * in the begining that is removed to show the real prefix
- entiID = dataProxy->getEntityIdFromMainPrefix("*" + dxccView->item(dxccView->row(item),0)->text());
- }
- //qDebug() << "DXCCStatusWidget::slotItemEntered: entiID: " << QString::number(entiID) << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: row: " << QString::number(row) << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: hrow: " << dxccView->verticalHeaderItem(row)->text() << endl;
+ row = (dxccView->item(row,0)->text()).toInt();
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: column: " << QString::number(column) << endl;
- if ((column == 0) || (column == 1))
+ if (column == 1)
{
+ int _enti = dataProxy->getEntityIdFromName(item->text()) ;
+ tip = tr("Pref: ") + dataProxy->getEntityMainPrefix(_enti) + " - ";
+ tip = tip + tr("CQ: ") + QString::number(dataProxy->getCQzFromEntity(_enti)) + " - ";
+ tip = tip + tr("ITU: ") + QString::number(dataProxy->getITUzFromEntity(_enti)) + " - ";
- //tip = tr("Pref: ") + (dxccView->item(row, 1))->text() + " - ";
- tip = tr("Pref: ") + dataProxy->getEntityMainPrefix(entiID) + " - ";
- tip = tip + tr("CQ: ") + QString::number(dataProxy->getCQzFromEntity(entiID)) + " - ";
- tip = tip + tr("ITU: ") + QString::number(dataProxy->getITUzFromEntity(entiID)) + " - ";
- QString dxLoc = locator->getLocator(dataProxy->getLongitudeFromEntity(entiID), dataProxy->getLatitudeFromEntity(entiID)) ;
+
+ QString dxLoc = locator->getLocator(dataProxy->getLongitudeFromEntity(_enti), dataProxy->getLatitudeFromEntity(_enti)) ;
tip = tip + tr("Beam: ") + QString::number(locator->getBeamBetweenLocators(loc, dxLoc));
+
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: myLoc: " << loc << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: DXLoc: " << dxLoc << endl;
}
else if (column >= 2)
@@ -441,12 +444,11 @@ void DXCCStatusWidget::refresh()
else
{
band = dxccView->horizontalHeaderItem(column)->text();
- //qDebug() << "DXCCStatusWidget::slotItemEntered: band: " << band << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: band: " << band << endl;
bandi = dataProxy->getIdFromBandName(band);
- //qDebug() << "DXCCStatusWidget::slotItemEntered: band: " << QString::number(bandi) << endl;
- //tip = awards->getQSOofAward(row, bandi);
- tip = awards->getQSOofAward(entiID, bandi);
- //qDebug() << "DXCCStatusWidget::slotItemEntered: tip: " << tip << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: band: " << QString::number(bandi) << endl;
+ tip = awards->getQSOofAward(row, bandi);
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: tip: " << tip << endl;
if (tip.length()>3)
{
tip = "QSO: " + tip;
@@ -457,29 +459,32 @@ void DXCCStatusWidget::refresh()
tip = tr("");
}
}
+
}
else
{
//tip = tr("ADD: Pref: Bearing, CQ & ITU.");
- tip = ""; // TODO define a text to be shown when no band column is selected (maybe Continent and bearing or a link to wikipedia or whatever!)
+ tip = ""; // TODO define a text to be shown when no band column is selected (maybe Continent & bearing or a link to wikipedia or whatever!)
}
item->setToolTip(tip);
- //qDebug() << "DXCCStatusWidget::slotItemEntered: tip: " << tip << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: tip: " << tip << endl;
+
+
}
else
{}
- //qDebug() << "DXCCStatusWidget::slotItemEntered: END " << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemEntered: END " << endl;
}
void DXCCStatusWidget::slotItemDoubleClicked(QTableWidgetItem * item )
{
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: " << ((item->data(0)).toString()).simplified() << endl;
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: " << item->text() << endl;
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked - start" << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: " << ((item->data(0)).toString()).simplified() << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: " << item->text() << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked - start" << endl;
if (dxccView->rowCount()<1)
{
return;
@@ -489,70 +494,78 @@ void DXCCStatusWidget::slotItemDoubleClicked(QTableWidgetItem * item )
int qsoId = -1;
int bandi = -1;
int columns = dxccView->columnCount();
- int _entiNumb = -1; //Read the Entity number that the user is selecting.
+ int _entiNumb = -1; //Read the ENtity number that the user is selecting.
QString band = QString();
-
+ //QString entityName = QString();
QList qsos;
qsos.clear();
QTableWidgetItem * it = new QTableWidgetItem(0);
+ //it->setText(item->data(Qt::DisplayRole));
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - 01" << endl;
-
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - 01" << endl;
if (item)
{
-
row = dxccView->row(item);
+ //column = dxccView->column(item);
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column = 1" << endl;
- _entiNumb= dataProxy->getEntityIdFromMainPrefix(dxccView->item(dxccView->row(item),0)->text());
- if (_entiNumb<0)
- { // Some prefix are shown with a * in the begining that is removed to show the real prefix
- _entiNumb= dataProxy->getEntityIdFromMainPrefix("*" + dxccView->item(dxccView->row(item),0)->text());
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: row: " << QString::number(row) << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: column: " << QString::number(column) << endl;
+
+ //if (column == 1)
+ if (true)
+ {
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column = 1" << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column header: " << dxccView->horizontalHeaderItem(column)->text() << endl;
+ _entiNumb = ((dxccView->item(row,0))->text()).toInt();
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - EntityNumber: " << QString::number(_entiNumb) << endl;
+
+ for (int i = 2; i < columns; ++i)
+ {
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column: " << QString::number(i) << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column header: " << (dxccView->horizontalHeaderItem(i))->text() << endl;
+ //entityName = (dxccView->item(row,i))->text() ;
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - item: " << endl;
+
+
+ it->setText(dxccView->item(row,i)->text());
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column-txt: " << it->text() << endl;
+
+ band = dxccView->horizontalHeaderItem(i)->text();
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: band: " << band << endl;
+ bandi = dataProxy->getIdFromBandName(band);
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: band: " << QString::number(bandi) << endl;
+ qsoId = awards->getQSOIdofAward(_entiNumb, bandi);
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: QSOid: " << QString::number(qsoId) << endl;
+ if (qsoId>0)
+ {
+ qsos.append(qsoId);
+ }
+
+ }
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - END of for" << endl;
+ if (qsos.length()>0)
+ {
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - qsos.length = " << QString::number(qsos.length()) << endl;
+ emit showQsos(qsos);
+ }
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - END of column == 1" << endl;
+ }
+ else
+ {
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column != 1" << endl;
+ //tip = ""; // TODO define a text to be shown when no band column is selected (maybe Continent & bearing or a link to wikipedia or whatever!)
}
- //_entiNumb = ((dxccView->item(row,0))->text()).toInt();
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - EntityNumber: " << QString::number(_entiNumb) << endl;
-
- for (int i = 2; i < columns; ++i)
- {
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column: " << QString::number(i) << endl;
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column header: " << (dxccView->horizontalHeaderItem(i))->text() << endl;
- //entityName = (dxccView->item(row,i))->text() ;
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - item: " << endl;
-
- it->setText(dxccView->item(row,i)->text());
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - column-txt: " << it->text() << endl;
-
- band = dxccView->horizontalHeaderItem(i)->text();
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: band: " << band << endl;
- bandi = dataProxy->getIdFromBandName(band);
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: band: " << QString::number(bandi) << endl;
- qsoId = awards->getQSOIdofAward(_entiNumb, bandi);
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: QSOid: " << QString::number(qsoId) << endl;
- if (qsoId>0)
- {
- qsos.append(qsoId);
- }
-
- }
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - END of for" << endl;
- if (qsos.length()>0)
- {
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - qsos.length = " << QString::number(qsos.length()) << endl;
- emit showQsos(qsos);
- }
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: - END of column == 1" << endl;
-
}
- //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: END " << endl;
+ //qDebug() << "DXCCStatusWidget::slotItemDoubleClicked: END " << endl;
}
void DXCCStatusWidget::setMyLocator(const QString &_loc)
{
- //qDebug() << "DXCCStatusWidget::setMyLocator: " << _loc << endl;
+ //qDebug() << "DXCCStatusWidget::setMyLocator: " << _loc << endl;
QString l = _loc;
if ( locator->isValidLocator(l.toUpper()) )
{
@@ -560,44 +573,3 @@ void DXCCStatusWidget::setMyLocator(const QString &_loc)
}
}
-/*
-void DXCCStatusWidget::slotRightButton(const QPoint& pos)
-{
- //qDebug() << "DXCCStatusWidget::slotRighButton" << endl;
- int row = (dxccView->indexAt(pos)).row();
-
- showDXCCWikipediaAct = new QAction(tr("&Wikipedia"), this);
- showDXCCWikipediaAct->setShortcut(Qt::CTRL + Qt::Key_W);
- showDXCCWikipediaAct->setStatusTip(tr("Show this DXCC in Wikipedia"));
- connect(showDXCCWikipediaAct, SIGNAL(triggered()), this, SLOT(slotWikipedia()));
-
- righButtonFromLogMenu(row);
-
-}
-
-void DXCCStatusWidget::slotWikipedia()
-{
- //qDebug() << "DXCCStatusWidget::slotWikipedia: " << (showDXCCWikipediaAct->data()).toString() << endl;
- //TODO: To be added to the DXCCStatusWidget and create an action that emist the QSO id
- //int QSOid = ((logModel->index((showDXCCWikipediaAct->data()).toInt(), 0)).data(0)).toInt();
-
- //qDebug() << "DXCCStatusWidget::slotQsoDeleteFromLog (id): " << QString::number(QSOid) << endl;
-
-}
-
-void DXCCStatusWidget::righButtonFromLogMenu(const int trow)
-{
- //qDebug() << "DXCCStatusWidget::slotshowRighButtonFromLogMenu: " << QString::number(trow) << endl;
-
- //int _qsoID = ((logModel->index(trow, 0)).data(0)).toInt();
- //qDebug() << "DXCCStatusWidget::slotshowRighButtonFromLogMenu: QSOid: " << QString::number(_qsoID) << endl;
-
- QMenu menu(this);
-
- menu.addAction(showDXCCWikipediaAct);
- showDXCCWikipediaAct->setData(trow);
-
-
- menu.exec(QCursor::pos());
-}
-*/
diff --git a/dxccstatuswidget.h b/dxccstatuswidget.h
index 6d19b044..32d22d23 100644
--- a/dxccstatuswidget.h
+++ b/dxccstatuswidget.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
#include
@@ -60,21 +60,14 @@ signals:
public slots:
//void slotSearchLineEditTextChanged();
void slotRefreshButtonClicked();
-
-private slots:
- //void slotRightButton(const QPoint& pos);
- //void slotWikipedia();
void slotItemEntered(QTableWidgetItem * item );
void slotItemDoubleClicked(QTableWidgetItem * item );
-
private:
void createUI();
void setDefaultBands();
void addEntity(const QStringList &_ent); // DXCC id, bandid, bandid, ...
-// void showMenuRightButtonFromLogCreateActions();
-// void righButtonFromLogMenu(const int trow);
-
+ //QStringList sortBandNamesBottonUp(const QStringList _qs);
QTableWidget *dxccView;
Awards *awards;
@@ -93,8 +86,6 @@ private:
int logNumber, tempLog; // log in use in the log / log to be used in the widget
QString loc; // The locator of the user.
- QAction *showDXCCWikipediaAct;
-
};
#endif // DXCCSTATUSWIDGET_H
diff --git a/dxcluster.cpp b/dxcluster.cpp
index 8676517a..744cea32 100644
--- a/dxcluster.cpp
+++ b/dxcluster.cpp
@@ -20,7 +20,7 @@ email : jaime@robles.es
* 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 . *
+* along with KLog. If not, see . *
* *
*****************************************************************************/
#include "dxcluster.h"
@@ -28,29 +28,25 @@ email : jaime@robles.es
DXClusterWidget::DXClusterWidget(DataProxy_SQLite *dp, QWidget *parent)
: QWidget(parent)
{
- //qDebug() << "DXClusterWidget::DXClusterWidget" << endl;
+ //qDebug() << "DXClusterWidget::DXClusterWidget" << endl;
dataProxy = dp;
constrid = 1;
awards = new Awards(dataProxy, Q_FUNC_INFO);
- util = new Utilities;
- saveSpotsFile = new QFile();
initClass();
- //qDebug() << "DXClusterWidget::DXClusterWidget - END" << endl;
+ //qDebug() << "DXClusterWidget::DXClusterWidget - END" << endl;
}
DXClusterWidget::DXClusterWidget(DataProxy_SQLite *dp, const QString &clusterToConnect, const int portToConnect, QWidget *parent)
: QWidget(parent)
{
- //qDebug() << "DXClusterWidget::DXClusterWidget2" << clusterToConnect << QString::number(portToConnect) << endl;
+ //qDebug() << "DXClusterWidget::DXClusterWidget2" << clusterToConnect << QString::number(portToConnect) << endl;
constrid = 2;
- util = new Utilities;
- saveSpotsFile = new QFile();
initClass();
server = clusterToConnect;
- port = quint16(portToConnect);
+ port = portToConnect;
dxSpotColor.setNamedColor("slategrey");
//defaultColor.setNamedColor("slategrey");
@@ -103,7 +99,7 @@ DXClusterWidget::DXClusterWidget(DataProxy_SQLite *dp, const QString &clusterToC
addData();
//TESTADDSPOT();
- //qDebug() << "DXClusterWidget::DXClusterWidget2 - END" << endl;
+ //qDebug() << "DXClusterWidget::DXClusterWidget2 - END" << endl;
}
@@ -121,10 +117,8 @@ void DXClusterWidget::initClass()
showann = true;
showwwv = true;
showwcy = true;
- saveSpots = false;
myQrz = QString();
currentLog = 0;
- saveSpotsFile->setFileName(util->getSaveSpotsLogFile());
}
void DXClusterWidget::setMyQRZ(const QString &_qrz)
@@ -138,7 +132,7 @@ void DXClusterWidget::setMyQRZ(const QString &_qrz)
void DXClusterWidget::addData()
{
- //qDebug() << "DXClusterWidget::addData " << endl;
+ //qDebug() << "DXClusterWidget::addData " << endl;
/*
QTreeWidgetItem *item = new QTreeWidgetItem(searchResultsTreeWidget);
@@ -153,21 +147,21 @@ void DXClusterWidget::addData()
item->setToolTip(6, aux);
*/
- dxClusterSpotItem * item = new dxClusterSpotItem(dxClusterListWidget, tr("Click on connect to connect to the DX-Cluster"), awards->getDefaultColor());
+ dxClusterSpotItem * item = new dxClusterSpotItem(dxClusterListWidget, tr("Click on connect to connect to the DX-Cluster"), awards->getDefaultColor());
}
DXClusterWidget::~DXClusterWidget()
{
- //qDebug() << "DXClusterWidget::~DXClusterWidget" << endl;
+ //qDebug() << "DXClusterWidget::~DXClusterWidget" << endl;
}
void DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked( QListWidgetItem * item )
{
- //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: " << item->text() << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: " << item->text() << endl;
QStringList ql;
ql.clear();
@@ -175,31 +169,31 @@ void DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked( QListWidgetIt
if (item)
{
ql = readItem(item);
- //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: Length: " << QString::number(ql.length()) << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: Length: " << QString::number(ql.length()) << endl;
if (ql.length()==2)
{
ql << "double";
- //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: EMMITED" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: EMMITED" << endl;
emit dxspotclicked(ql);
}
else
{
- //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: NOT EMMITED-1" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: NOT EMMITED-1" << endl;
}
}
else
{
- //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: NOT EMMITED-2 (no item)" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: NOT EMMITED-2 (no item)" << endl;
}
}
void DXClusterWidget::connectToDXCluster()
{
- //qDebug() << "DXClusterWidget::connectToDXCluster" << endl;
+ //qDebug() << "DXClusterWidget::connectToDXCluster" << endl;
if (dxClusterConnected)
{
- //qDebug() << "DXClusterWidget::connectToDXCluster: - Already connected!!" << endl;
+ //qDebug() << "DXClusterWidget::connectToDXCluster: - Already connected!!" << endl;
return; // If we are connected we don't want to start another connection
}
@@ -209,18 +203,17 @@ void DXClusterWidget::connectToDXCluster()
connect(tcpSocket, SIGNAL(disconnected()), SLOT(slotClusterSocketConnectionClosed()) );
connect(inputCommand, SIGNAL(returnPressed()), this, SLOT(slotClusterSendToServer()) );
connect(clearButton, SIGNAL(clicked()), this, SLOT(slotClusterClearLineInput()) );
- //openFile(); // This functions opens the file to save the DX-Cluster activity. The file will be closed when the DX is disconnected.
+
tcpSocket->connectToHost( server, port );
dxClusterListWidget->setSortingEnabled (false);
dxClusterSpotItem * item = new dxClusterSpotItem(dxClusterListWidget, tr("Trying to connect to the server") + "\n", awards->getDefaultColor());
-
}
void DXClusterWidget::slotClusterDisplayError(QAbstractSocket::SocketError socketError)
{
- //qDebug() << "DXClusterWidget:displayError:" << endl;
+ //qDebug() << "DXClusterWidget:displayError:" << endl;
switch (socketError) {
case QAbstractSocket::RemoteHostClosedError:
break;
@@ -247,74 +240,74 @@ void DXClusterWidget::slotClusterDisplayError(QAbstractSocket::SocketError socke
bool DXClusterWidget::checkIfNeedsToBePrinted(const QString &_DXEntity, int const _band, const int _mode)
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: " << _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: " << _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
QStringList qs;
qs.clear();
qs << _DXEntity << QString::number(_band) << QString::number(_mode) << QString::number(currentLog);
//bool isConfirmed = false;
bool status = awards->isThisSpotConfirmed (qs);
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Status: " << _DXEntity << "/" << QString::number(status);
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Status: " << _DXEntity << "/" << QString::number(status);
if (!showconfirmed)
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is confirmed? ("<< QString::number(status)<< ")" << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is confirmed? ("<< QString::number(status)<< ")" << endl;
if (status)
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: It is confirmed: DON'T' print: " << _DXEntity <<"/" << dataProxy->getNameFromBandId(_band) << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: It is confirmed: DON'T' print: " << _DXEntity <<"/" << dataProxy->getNameFromBandId(_band) << endl;
return false;
}
}
if (!showhf)
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is HF?" << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is HF?" << endl;
if (dataProxy->isHF(_band))
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Not showing HF but... is it WARC?" << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Not showing HF but... is it WARC?" << endl;
if ( (showwarc) && dataProxy->isWARC(_band) )
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Not showing HF but... is WARC, print!" << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: Not showing HF but... is WARC, print!" << endl;
return true;
}
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is HF: DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is HF: DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
return false;
}
else
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT HF" << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT HF" << endl;
}
}
if (!showwarc)
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is WARC?" << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is WARC?" << endl;
if (dataProxy->isWARC(_band))
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is WARC, DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is WARC, DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
return false;
}
else
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT WARC" << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT WARC" << endl;
}
}
if (!showvhf)
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is VHF?" << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is VHF?" << endl;
if (dataProxy->isVHF(_band))
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is VHF, DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is VHF, DON'T print: "<< _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
return false;
}
else
{
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT VHF " << endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: is NOT VHF " << endl;
}
}
- //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: returns TRUE and will be printed: " << _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
+ //qDebug() << "DXClusterWidget::checkIfNeedsToBePrinted: returns TRUE and will be printed: " << _DXEntity << "/" << dataProxy->getNameFromBandId(_band) << QString::number(_mode)<< endl;
return true;
}
@@ -333,7 +326,7 @@ void DXClusterWidget::setCurrentLog(const int _log)
void DXClusterWidget::slotClusterDataArrived()
{
- //qDebug() << "DXClusterWidget::slotClusterDataArrived" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived" << endl;
QStringList qs;
QString dxClusterString;
QString dxCall;
@@ -343,11 +336,9 @@ void DXClusterWidget::slotClusterDataArrived()
//bool isADXSpot = false;
int dxEntity = -1;
- while ( tcpSocket->canReadLine() )
- {
+ while ( tcpSocket->canReadLine() ) {
dxClusterString = tcpSocket->readLine();
dxClusterString = dxClusterString.trimmed();
- saveSpot(dxClusterString);
QStringList tokens = dxClusterString.split(" ", QString::SkipEmptyParts);
if (tokens.size()<2){
@@ -355,18 +346,18 @@ void DXClusterWidget::slotClusterDataArrived()
}
// It is a "DX de SP0TTER FREC DXCALL"
//0 = DX, 1 = de, 2 = spotter, 3 = Freq, 4 = dxcall, 5 = comment
- //qDebug() << "DXClusterWidget::slotClusterDataArrived: " << "DXCLUSTER->" << dxClusterString << "\nTOKENS: " << tokens << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived: " << "DXCLUSTER->" << dxClusterString << "\nTOKENS: " << tokens << endl;
if ((tokens[0] == "DX") && (tokens[1] == "de"))
{
- //qDebug() << "******************** DXClusterWidget::slotClusterDataArrived: DX DE" << endl;
+ //qDebug() << "******************** DXClusterWidget::slotClusterDataArrived: DX DE" << endl;
//isADXSpot = true;
QString spotter = tokens[2];
spotter.truncate(spotter.size() - 1);
dxFrequency = tokens[3];
// Convert KHz to MHz...
//dxFrequency = QString::number(abs (dxFrequency.toFloat())/1000);
- dxFrequency = QString::number( (dxFrequency.toDouble())/1000);
+ dxFrequency = QString::number( (dxFrequency.toFloat())/1000);
dxCall = tokens[4];
dxEntity = world->getQRZARRLId(dxCall);
//
@@ -376,7 +367,7 @@ void DXClusterWidget::slotClusterDataArrived()
qs.clear();
//spotBand = QString::number(world->getBandIdFromFreq( dxFrequency ) );
qs << QString::number(dxEntity) << spotBand << "-1" << QString::number(currentLog) ;
- //qDebug() << "DXClusterWidget::slotClusterDataArrived: Calling-2: " << QString::number(dxEntity) << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived: Calling-2: " << QString::number(dxEntity) << endl;
dxSpotColor = awards->getQRZDXStatusColor(qs);
if (showDxMarathon)
{
@@ -387,29 +378,29 @@ void DXClusterWidget::slotClusterDataArrived()
}
- //qDebug() << "DX de ->" << "Spotter: " << spotter << "Freq: "<< dxFrequency << "DX: " << dxCall << endl;
+ //qDebug() << "DX de ->" << "Spotter: " << spotter << "Freq: "<< dxFrequency << "DX: " << dxCall << endl;
}
else if ((tokens[0] == "To") && (tokens[1] == "ALL"))
{
- //qDebug() << "DXClusterWidget::slotClusterDataArrived: TO ALL" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived: TO ALL" << endl;
dxSpotColor = awards->getDefaultColor();
}
else if ( (dxClusterString.length()>=5) && (world->checkQRZValidFormat(tokens[1])) && (tokens[0]!="login:"))
{ // Freq / DXCall / Date // time
//_qs << QRZ << Freq in MHz << lognumber;
- //qDebug() << "DXClusterWidget::slotClusterDataArrived: LENGTH >= 5" << endl;
- //qDebug() << "DXClusterWidget::slotClusterDataArrived: token0=" << tokens[0] << " / token1=" << tokens[1] << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived: LENGTH >= 5" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived: token0=" << tokens[0] << " / token1=" << tokens[1] << endl;
//isADXSpot = true;
dxCall = tokens[1];
dxFrequency = tokens[0];
- dxFrequency = QString::number( (dxFrequency.toDouble())/1000);
+ dxFrequency = QString::number( (dxFrequency.toFloat())/1000);
qs.clear();
spotBand = QString::number(dataProxy->getBandIdFromFreq( dxFrequency.toDouble() ) );
dxEntity = world->getQRZARRLId(dxCall);
- //qDebug() << "DXClusterWidget::slotClusterDataArrived: Calling-1: " << QString::number(dxEntity) << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived: Calling-1: " << QString::number(dxEntity) << endl;
qs << QString::number(dxEntity) << spotBand << "-1" << QString::number(currentLog) ;
dxSpotColor = awards->getQRZDXStatusColor(qs);
if (showDxMarathon)
@@ -424,7 +415,7 @@ void DXClusterWidget::slotClusterDataArrived()
}
else
{
- //qDebug() << "DXClusterWidget::slotClusterDataArrived: DEFAULT" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived: DEFAULT" << endl;
dxSpotColor = awards->getDefaultColor();
}
@@ -433,12 +424,12 @@ void DXClusterWidget::slotClusterDataArrived()
//qs << dxCall << spotBand << "0";
//dxSpotColor = awards->getQRZDXStatusColor(qs);
- //qDebug() << "DXClusterWidget::slotClusterDataArrived: Call/dxSpotColor: " << dxCall <<"/"<< dxSpotColor.name() << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived: Call/dxSpotColor: " << dxCall <<"/"<< dxSpotColor.name() << endl;
//dxClusterSpotItem * item = new dxClusterSpotItem(dxClusterListWidget, dxClusterString, dxSpotColor);
//TODO: Change the "-1" by the mode
if (!checkIfNeedsToBePrinted(QString::number(dxEntity), spotBand.toInt(), -1))
{
- //qDebug() << "DXClusterWidget::slotClusterDataArrived - Not to be printed!: " << dxCall << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived - Not to be printed!: " << dxCall << endl;
return;
}
@@ -479,15 +470,15 @@ void DXClusterWidget::slotClusterDataArrived()
//dxClusterListWidget->insertItem(0,item);
}
- //qDebug() << "--------------------- DXClusterWidget::slotClusterDataArrived: " << dxClusterString << endl;
+ //qDebug() << "--------------------- DXClusterWidget::slotClusterDataArrived: " << dxClusterString << endl;
- //qDebug() << "DXClusterWidget::slotClusterDataArrived: " << dxClusterString << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDataArrived: " << dxClusterString << endl;
}
void DXClusterWidget::slotClusterSocketConnected()
{
- //qDebug() << "DXClusterWidget::slotClusterSocketConnected" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterSocketConnected" << endl;
QListWidgetItem *item = new QListWidgetItem();
item->setForeground(QBrush(awards->getDefaultColor()));
@@ -532,7 +523,7 @@ void DXClusterWidget::slotClusterSocketConnected()
void DXClusterWidget::slotClusterSocketConnectionClosed()
{
- //qDebug() << "DXClusterWidget::slotClusterSocketConnectionClosed" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterSocketConnectionClosed" << endl;
QListWidgetItem *item = new QListWidgetItem();
item->setForeground(QBrush(awards->getDefaultColor()));
item->setText(tr("Connection closed by the server"));
@@ -548,7 +539,7 @@ void DXClusterWidget::slotClusterSocketConnectionClosed()
void DXClusterWidget::slotClusterSendToServer()
{
- //qDebug() << "DXClusterWidget::slotClusterSendToServer()" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterSendToServer()" << endl;
if (!dxClusterConnected)
{
@@ -557,7 +548,7 @@ void DXClusterWidget::slotClusterSendToServer()
}
if ( inputCommand ->text().length() < 1 )
{
- //qDebug() << "DXClusterWidget::slotClusterSendToServer() - Vacio..." << endl;
+ //qDebug() << "DXClusterWidget::slotClusterSendToServer() - Vacio..." << endl;
QTextStream os(tcpSocket);
os << "bye\n";
return;
@@ -570,7 +561,7 @@ void DXClusterWidget::slotClusterSendToServer()
void DXClusterWidget::slotClusterClearLineInput()
{
- //qDebug() << "DXClusterWidget::slotClusterClearLineInput" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterClearLineInput" << endl;
if ( ((inputCommand->text()).length()) <= 0 )
{
@@ -592,7 +583,7 @@ void DXClusterWidget::slotClusterClearLineInput()
void DXClusterWidget::slotClusterInputTextChanged()
{
- //qDebug() << "DXClusterWidget::slotClusterInputTextChanged" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterInputTextChanged" << endl;
if ( ((inputCommand->text()).length()) <= 0 )
{
@@ -610,7 +601,7 @@ void DXClusterWidget::slotClusterInputTextChanged()
void DXClusterWidget::setColors (const QString &_newOne, const QString &_needed, const QString &_worked, const QString &_confirmed, const QString &_default)
{
- //qDebug() << "DXClusterWidget::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default << endl;
+ //qDebug() << "DXClusterWidget::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default << endl;
// Just to pass the colors to the awards class
awards->setColors(_newOne, _needed, _worked, _confirmed, _default);
@@ -618,7 +609,7 @@ void DXClusterWidget::setColors (const QString &_newOne, const QString &_needed,
void DXClusterWidget::setDXClusterSpotConfig(bool _showhf, bool _showvhf, bool _showwarc, bool _showworked, bool _showconfirmed, bool _showann, bool _showwwv, bool _showwcy )
{
- //qDebug() << "DXClusterWidget::setDXClusterSpotConfig " << endl;
+ //qDebug() << "DXClusterWidget::setDXClusterSpotConfig " << endl;
showhf = _showhf;
showvhf = _showvhf;
@@ -632,7 +623,7 @@ void DXClusterWidget::setDXClusterSpotConfig(bool _showhf, bool _showvhf, bool _
void DXClusterWidget::slotClusterDXClusterWidgetItemSelected()
{
- //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemSelected " << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemSelected " << endl;
QListWidgetItem * item = dxClusterListWidget->currentItem();
QStringList ql;
@@ -652,7 +643,7 @@ void DXClusterWidget::slotClusterDXClusterWidgetItemSelected()
void DXClusterWidget::slotClusterDXClusterWidgetItemEntered( QListWidgetItem * item )
{
- //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemEntered" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemEntered" << endl;
/*
This code comes from slotClusterDXClusterWidgetItemDoubleClicked
*/
@@ -687,7 +678,7 @@ bool DXClusterWidget::isConnected()
QStringList DXClusterWidget::readItem(QListWidgetItem * item)
{
- //qDebug() << "DXClusterWidget::readItem" << endl;
+ //qDebug() << "DXClusterWidget::readItem" << endl;
QStringList fields;
QString dxClusterString;
@@ -698,7 +689,7 @@ QStringList DXClusterWidget::readItem(QListWidgetItem * item)
if (item) {
fields.clear();
- dxClusterString = ((item->data(0)).toString()).simplified();
+ dxClusterString = ((item->data(0)).toString()).simplified();
fields << dxClusterString.split(" ");
(fields.at(0)).toFloat(&FirstFrecOK); // Just to see if the first string is a frecuency
@@ -708,7 +699,7 @@ QStringList DXClusterWidget::readItem(QListWidgetItem * item)
if ( world->getQRZARRLId(fields.at(4))> 0 )
{
- //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: ARRLid: " << QString::number(world->getQRZARRLId(fields.at(4))) << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: ARRLid: " << QString::number(world->getQRZARRLId(fields.at(4))) << endl;
dxCallsign = (fields.at(4)).toUpper();
(fields.at(3)).toFloat(&FirstFrecOK);
if (FirstFrecOK)
@@ -730,14 +721,14 @@ QStringList DXClusterWidget::readItem(QListWidgetItem * item)
else
{ // The call is not from a valid country
// TODO: if it is from a new entity/prefix it would not work.
- //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: Entity not valid" << endl;
+ //qDebug() << "DXClusterWidget::slotClusterDXClusterWidgetItemDoubleClicked: Entity not valid" << endl;
dxCallsign.clear();
dxFreq.clear();
fields.clear();
}
}
//else if (( isAFrecuency(fields.at(0) ) ) && ( isACall(fields.at(1)) ) )
- else if ( (((fields.at(0)).toDouble()) > 0.0 )&& ( world->getQRZARRLId(fields.at(1))> 0 ) )
+ else if ( (((fields.at(0)).toFloat()) > 0.0 )&& ( world->getQRZARRLId(fields.at(1))> 0 ) )
{ // 14205.0 EA0JC 5-Mar-2012 1500Z
dxCallsign = (fields.at(1)).toUpper();
@@ -764,8 +755,8 @@ QStringList DXClusterWidget::readItem(QListWidgetItem * item)
void DXClusterWidget::setDXClusterServer(const QString &clusterToConnect, const int portToConnect)
{
server = clusterToConnect;
- port = quint16(portToConnect);
- //qDebug() << "DXClusterWidget::setDXClusterServer: " << server << ":"<< QString::number(port) << endl;
+ port = portToConnect;
+ //qDebug() << "DXClusterWidget::setDXClusterServer: " << server << ":"<< QString::number(port) << endl;
}
void DXClusterWidget::setDXMarathon (const bool _enable)
@@ -773,64 +764,10 @@ void DXClusterWidget::setDXMarathon (const bool _enable)
showDxMarathon = _enable;
}
-void DXClusterWidget::setSaveSpots (const bool _enable)
-{
- saveSpots = _enable;
-}
-
-bool DXClusterWidget::openFile()
-{
- if (saveSpotsFile->isOpen())
- {
- return true;
- }
- if (!saveSpotsFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append))
- {
- QMessageBox msgBox;
- msgBox.setIcon(QMessageBox::Warning);
- QString aux = tr("It was not possible to open the file to save the DX-Spots for writing. DX-Cluster activity will not be saved!");
- msgBox.setText(aux);
- msgBox.setStandardButtons(QMessageBox::Ok);
- msgBox.setDefaultButton(QMessageBox::Ok);
- msgBox.exec();
- return false;
- }
- else
- {
- return true;
- }
-}
-
-void DXClusterWidget::saveSpot(const QString &_spot)
-{
- //qDebug() << "DXClusterWidget::saveSpot: " << _spot << endl;
- if (!saveSpots)
- {
- //qDebug() << "DXClusterWidget::saveSpot: Not saving" << endl;
- return;
- }
- else
- {
- if (openFile())
- {
- //qDebug() << "DXClusterWidget::saveSpot: File Open" << endl;
- QTextStream out(saveSpotsFile);
- //out << _spot << endl;
- out << (QDateTime::currentDateTime()).toString("yyyy/MM/dd-hh:mm:ss") << " - " << _spot << endl;
- saveSpotsFile->close();
- }
- else {
- {
- //qDebug() << "DXClusterWidget::saveSpot: File NOT Open" << endl;
- }
- }
- }
-}
-
/*
void DXClusterWidget::TESTADDSPOT()
{
- //qDebug() << "DXClusterWidget::TESTADDSPOT " << endl;
+ //qDebug() << "DXClusterWidget::TESTADDSPOT " << endl;
; // Just a test spot
QListWidgetItem *item = new QListWidgetItem();
item->setForeground(QBrush(dxSpotColor));
@@ -838,17 +775,13 @@ void DXClusterWidget::TESTADDSPOT()
dxClusterListWidget->insertItem(0,item);
}
*/
-
-
-
-
/***************************************************************************
** This is an auxiliary class intended to provide color to the DX-Cluster **
** spots. **
** It may be moved to a self .h & .cpp archives **
****************************************************************************/
dxClusterSpotItem::dxClusterSpotItem( QListWidget *parent, const QString& spot, const QColor& color ) : QListWidgetItem( parent ){
- //qDebug() << "dxClusterSpotItem::dxClusterSpotItem - Constructor" << endl;
+ //qDebug() << "dxClusterSpotItem::dxClusterSpotItem - Constructor" << endl;
spotColor = color;
setText(spot);
// Experimenting with fonts for the cluster
@@ -859,6 +792,6 @@ dxClusterSpotItem::dxClusterSpotItem( QListWidget *parent, const QString& spot,
dxClusterSpotItem::~dxClusterSpotItem()
{
- //qDebug() << "dxClusterSpotItem::dxClusterSpotItem - Destructor" << endl;
+ //qDebug() << "dxClusterSpotItem::dxClusterSpotItem - Destructor" << endl;
}
diff --git a/dxcluster.h b/dxcluster.h
index 713bcafa..8ffe7132 100644
--- a/dxcluster.h
+++ b/dxcluster.h
@@ -22,7 +22,7 @@ email : jaime@robles.es
* 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 . *
+* along with KLog. If not, see . *
* *
*****************************************************************************/
@@ -33,7 +33,6 @@ email : jaime@robles.es
#include
#include "awards.h"
#include "world.h"
-#include "utilities.h"
#include "dataproxy_sqlite.h"
class QWidget;
@@ -54,7 +53,6 @@ class DXClusterWidget : public QWidget
bool isConnected();
void setMyQRZ(const QString &_qrz);
void setDXMarathon (const bool _enable);
- void setSaveSpots (const bool _enable);
//void sendSpotToCluster(const QString &_dx, const QString &_freq);
@@ -76,7 +74,6 @@ private slots:
signals:
void dxspotclicked(const QStringList &_qs); // DXSpotCall, DX-Freq, doubleClicked
- //void dxspot(const QString &_spot); // The text string to be saved
private:
@@ -86,10 +83,8 @@ private:
void connectToDXCluster();
QStringList readItem(QListWidgetItem * item);
bool checkIfNeedsToBePrinted(const QString &_DXEntity, const int _band, const int _mode);
- void saveSpot (const QString &_spot);
- bool openFile();
- void addData(); //TO BE DELETED, JUST FOR TESTING PURPOSES
+ void addData(); //TO BE DELETED, JUST FOR TESTING PURPOSES
QTcpSocket *tcpSocket;
QListWidget *dxClusterListWidget;
@@ -108,19 +103,14 @@ private:
World *world;
Awards *awards;
DataProxy_SQLite *dataProxy;
- Utilities *util;
bool showhf, showvhf, showwarc, showworked, showconfirmed, showann, showwwv, showwcy;
bool dxClusterShowHF, dxClusterShowVHF, dxClusterShowWARC, dxClusterShowWorked, dxClusterShowConfirmed, dxClusterShowAnn, dxClusterShowWWV, dxClusterShowWCY;
bool showDxMarathon;
-
QString myQrz;
int currentLog;
+
int constrid; // Just an id for the constructor to check who is being executed at one specific time
-
- QFile *saveSpotsFile;
- bool saveSpots; // write/save the spots to a file
-
};
class dxClusterSpotItem : public QListWidgetItem {
diff --git a/elogclublog.cpp b/elogclublog.cpp
index 2b99c17a..4c8d2a8b 100644
--- a/elogclublog.cpp
+++ b/elogclublog.cpp
@@ -9,7 +9,7 @@
eLogClubLog::eLogClubLog() : QObject(nullptr)
{
- //qDebug() << "eLogClubLog::eLogClubLog" << endl;
+ //qDebug() << "eLogClubLog::eLogClubLog" << endl;
call= QString();
email = QString();
pass = QString();
@@ -17,21 +17,21 @@ eLogClubLog::eLogClubLog() : QObject(nullptr)
currentQSO = -1;
useQSOStationCallsign = false;
stationCallsign = QString();
- //qDebug() << "eLogClubLog::eLogClubLog - END" << endl;
+ //qDebug() << "eLogClubLog::eLogClubLog - END" << endl;
}
eLogClubLog::~eLogClubLog()
{
- //qDebug() << "eLogClubLog::~eLogClubLog" << endl;
+ //qDebug() << "eLogClubLog::~eLogClubLog" << endl;
}
void eLogClubLog::slotQsoUploadFinished(QNetworkReply *data)
{
- //qDebug() << "eLogClubLog::slotQsoUploadFinished" << endl;
+ //qDebug() << "eLogClubLog::slotQsoUploadFinished" << endl;
result = data->error();
- //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = " << QString::number(result) << endl;
const QByteArray sdata = data->readAll();
@@ -48,28 +48,28 @@ eLogClubLog::~eLogClubLog()
{
text = "ClubLog: " + prepareToTranslate(sdata);
- //qDebug() << sdata;
+ //qDebug() << sdata;
}
else if (result == QNetworkReply::HostNotFoundError)
{
- //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Host Not found! = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Host Not found! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Host not found!");
//TODO: Mark the previous QSO as not sent to clublog
}
else if (result == QNetworkReply::TimeoutError)
{
- //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Time out error! = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Time out error! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Timeout error!");
//TODO: Mark the previous QSO as not sent to clublog
}
else if (result == 202)
{
- //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Password Error! = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = Password Error! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("It seems to be a PASSWORD ERROR; check your password.");
- QMessageBox::warning(nullptr, tr("KLog - ClubLog"),
+ QMessageBox::warning(0, tr("KLog - ClubLog"),
tr("It seems that your ClubLog password is not correct.") + "\n" +
tr("Please check your password in the setup. ClubLog uploads will be disabled."),
QMessageBox::Ok);
@@ -80,12 +80,12 @@ eLogClubLog::~eLogClubLog()
}
else
{
- //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = UNDEFINED = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = UNDEFINED = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Undefined error...");
//TODO: Mark the previous QSO as not sent to clublog
}
- //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotQsoUploadFinished - Result = " << QString::number(result) << endl;
//emit done();
emit showMessage(text);
@@ -93,10 +93,10 @@ eLogClubLog::~eLogClubLog()
void eLogClubLog::slotFileUploadFinished(QNetworkReply *data)
{
- //qDebug() << "eLogClubLog::slotFileUploadFinished" << endl;
+ //qDebug() << "eLogClubLog::slotFileUploadFinished" << endl;
result = data->error();
- //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = " << QString::number(result) << endl;
const QByteArray sdata = data->readAll();
@@ -107,42 +107,42 @@ void eLogClubLog::slotFileUploadFinished(QNetworkReply *data)
{
text = "ClubLog: " + prepareToTranslate(sdata);
- //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = NoError = " << QString::number(result) << endl;
- //qDebug() << sdata;
+ //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = NoError = " << QString::number(result) << endl;
+ //qDebug() << sdata;
}
else if (result == QNetworkReply::HostNotFoundError)
{
- //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = Host Not found! = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = Host Not found! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Host not found!");
}
else if (result == QNetworkReply::TimeoutError)
{
- //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = Time out error! = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = Time out error! = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Timeout error!");
}
else
{
- //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = UNDEFINED = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = UNDEFINED = " << QString::number(result) << endl;
text = "ClubLog: " + tr("Undefined error...");
}
- //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = " << QString::number(result) << endl;
+ //qDebug() << "eLogClubLog::slotFileUploadFinished - Result = " << QString::number(result) << endl;
//emit done();
emit showMessage(text);
}
void eLogClubLog::downloadProgress(qint64 received, qint64 total) {
- //qDebug() << "eLogClubLog::downloadProgress: " << QString::number(received) << "/" << QString::number(total) << endl;
+ //qDebug() << "eLogClubLog::downloadProgress: " << QString::number(received) << "/" << QString::number(total) << endl;
- //qDebug() << received << total;
+ //qDebug() << received << total;
emit actionShowProgres(received, total);
}
void eLogClubLog::slotErrorManagement(QNetworkReply::NetworkError networkError)
{
- //qDebug() << "eLogClubLog::slotErrorManagement: " << QString::number(networkError) << endl;
+ //qDebug() << "eLogClubLog::slotErrorManagement: " << QString::number(networkError) << endl;
result = networkError;
if (result == QNetworkReply::NoError)
@@ -150,11 +150,11 @@ void eLogClubLog::slotErrorManagement(QNetworkReply::NetworkError networkError)
}
else if (result == QNetworkReply::HostNotFoundError)
{
- //qDebug() << "eLogClubLog::slotErrorManagement: Host not found" << endl;
+ //qDebug() << "eLogClubLog::slotErrorManagement: Host not found" << endl;
}
else
{
- //qDebug() << "eLogClubLog::slotErrorManagement: ERROR!" << endl;
+ //qDebug() << "eLogClubLog::slotErrorManagement: ERROR!" << endl;
}
//actionError(result);
@@ -163,8 +163,8 @@ void eLogClubLog::slotErrorManagement(QNetworkReply::NetworkError networkError)
int eLogClubLog::sendQSO(QStringList _qso)
{
- //qDebug() << "eLogClubLog::sendQSO: " << call <<"/"<< email << "/" << pass << "/" << api << endl;
- //qDebug() << "eLogClubLog::sendQSO:: length = " << QString::number(_qso.length()) << endl;
+ //qDebug() << "eLogClubLog::sendQSO: " << call <<"/"<< email << "/" << pass << "/" << api << endl;
+ //qDebug() << "eLogClubLog::sendQSO:: length = " << QString::number(_qso.length()) << endl;
// First Data in the QStringList is the QSO id, not to be sent to clublog but used in the signal actionReturnDownload(const int _i, const int _qsoId);
if (_qso.length()!=18)
@@ -180,19 +180,19 @@ int eLogClubLog::sendQSO(QStringList _qso)
{
stationCallsign = _qso.last();
}
- //qDebug() << "eLogClubLog::sendQSO (stationCallsign = " << _qso.last() << ")" << endl;
+ //qDebug() << "eLogClubLog::sendQSO (stationCallsign = " << _qso.last() << ")" << endl;
_qso.removeLast();
QString qso = getClubLogAdif(_qso);
- //qDebug() << "eLogClubLog::sendQSO: " << qso << endl;
+ //qDebug() << "eLogClubLog::sendQSO: " << qso << endl;
return sendData(qso);
}
-int eLogClubLog::sendData(const QString &_q)
+int eLogClubLog::sendData(const QString _q)
{
- //qDebug() << "eLogClubLog::sendData: " << _q << endl;
+ //qDebug() << "eLogClubLog::sendData: " << _q << endl;
//Posiblemente tenga que usar una de estas: void QUrlQuery::addQueryItem(const QString & key, const QString & value)
@@ -208,12 +208,12 @@ int eLogClubLog::sendData(const QString &_q)
if ((useQSOStationCallsign) && (stationCallsign.length()>2))
{
params.addQueryItem("callsign",stationCallsign);
- //qDebug() << "eLogClubLog::sendData - callsign 1: " << stationCallsign << endl;
+ //qDebug() << "eLogClubLog::sendData - callsign 1: " << stationCallsign << endl;
}
else
{
params.addQueryItem("callsign",call);
- //qDebug() << "eLogClubLog::sendData - callsign 2: " << call << endl;
+ //qDebug() << "eLogClubLog::sendData - callsign 2: " << call << endl;
}
params.addQueryItem("api",api);
@@ -227,12 +227,12 @@ int eLogClubLog::sendData(const QString &_q)
if ((useQSOStationCallsign) && (stationCallsign.length()>2))
{
params.addQueryItem("callsign",stationCallsign);
- //qDebug() << "eLogClubLog::sendData - callsign 1: " << stationCallsign << endl;
+ //qDebug() << "eLogClubLog::sendData - callsign 1: " << stationCallsign << endl;
}
else
{
params.addQueryItem("callsign",call);
- //qDebug() << "eLogClubLog::sendData - callsign 2: " << call << endl;
+ //qDebug() << "eLogClubLog::sendData - callsign 2: " << call << endl;
}
params.addQueryItem("api",api);
@@ -259,7 +259,7 @@ int eLogClubLog::sendData(const QString &_q)
QString eLogClubLog::getClubLogAdif(const QStringList _q)
{
- //qDebug() << "eLogClubLog::getClubLogAdif: " << QString::number(_q.length()) << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: " << QString::number(_q.length()) << endl;
// _qso must include 16 ordered fields than can be empty or contain data. This function builds the ADIF QSO
/* http://clublog.freshdesk.com/support/solutions/articles/53202-which-adif-fields-does-club-log-use-
ClubLog only accepts the following ADIF fields:
@@ -297,19 +297,19 @@ ClubLog only accepts the following ADIF fields:
//qso = "" + _q.at(0) + " ";
qso = qso + "" + _q.at(1) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 10" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 10" << endl;
qso = qso + "" + _q.at(2) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 20" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 20" << endl;
qso = qso + "" + _q.at(3) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 30" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 30" << endl;
qso = qso + "" + _q.at(4) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 40" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 40" << endl;
qso = qso + "" + _q.at(5) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 50" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 50" << endl;
qso = qso + "" + _q.at(6) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 60" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 60" << endl;
qso = qso + "" + _q.at(7) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 70" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 70" << endl;
if ((_q.at(8)).length()> 2)
{
qso = qso + "" + _q.at(8) + " ";
@@ -321,35 +321,35 @@ ClubLog only accepts the following ADIF fields:
}
- //qDebug() << "eLogClubLog::getClubLogAdif: 90" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 90" << endl;
qso = qso + "" + _q.at(10) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 100" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 100" << endl;
qso = qso + "" + _q.at(11) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 110" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 110" << endl;
qso = qso + "" + _q.at(12) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 120" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 120" << endl;
if ((_q.at(13)).toInt()> 0)
{
qso = qso + "" + _q.at(13) + " ";
}
- //qDebug() << "eLogClubLog::getClubLogAdif: 130'" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 130'" << endl;
qso = qso + "" + _q.at(14) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 140" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 140" << endl;
qso = qso + "" + _q.at(15) + " ";
- //qDebug() << "eLogClubLog::getClubLogAdif: 150" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 150" << endl;
qso = qso + "";
- //qDebug() << "eLogClubLog:: - QSO: " << qso << endl;
+ // //qDebug() << "eLogClubLog:: - QSO: " << qso << endl;
- //qDebug() << "eLogClubLog::getClubLogAdif: 100" << endl;
+ //qDebug() << "eLogClubLog::getClubLogAdif: 100" << endl;
return qso;
}
-void eLogClubLog::setCredentials(const QString &_call, const QString &_email, const QString &_pass, const bool _useQSOStationCall)
+void eLogClubLog::setCredentials(const QString _call, const QString _email, const QString _pass, const bool _useQSOStationCall)
{
- //qDebug() << "eLogClubLog::setCredentials" << endl;
+ //qDebug() << "eLogClubLog::setCredentials" << endl;
call = _call;
email = _email;
pass = _pass;
@@ -360,7 +360,7 @@ void eLogClubLog::setCredentials(const QString &_call, const QString &_email, co
int eLogClubLog::deleteQSO(QStringList _qso)
{
- //qDebug() << "eLogClubLog::deleteQSO: length = " << QString::number(_qso.length()) << endl;
+ //qDebug() << "eLogClubLog::deleteQSO: length = " << QString::number(_qso.length()) << endl;
if (_qso.length()!=17)
{
return -1;
@@ -376,16 +376,16 @@ int eLogClubLog::deleteQSO(QStringList _qso)
QString qso = getClubLogAdif(_qso);
qso.replace("", replaceCall);
- //qDebug() << "eLogClubLog::deleteQSO: ready to send = " << qso << endl;
+ //qDebug() << "eLogClubLog::deleteQSO: ready to send = " << qso << endl;
return sendData(qso);
}
-QString eLogClubLog::prepareToTranslate(const QString &_m)
+QString eLogClubLog::prepareToTranslate(const QString _m)
{
- //qDebug() << "eLogClubLog:: = prepareToTranslate" << _m << endl;
+ //qDebug() << "eLogClubLog:: = prepareToTranslate" << _m << endl;
if (_m == "Callsign missing")
{
return tr("Callsign missing");
diff --git a/elogclublog.h b/elogclublog.h
index c85a56b5..9733d97f 100644
--- a/elogclublog.h
+++ b/elogclublog.h
@@ -22,7 +22,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
#include
@@ -42,7 +42,7 @@ public:
explicit eLogClubLog();
~eLogClubLog();
- void setCredentials(const QString &_call, const QString &_email, const QString &_pass, const bool _useQSOStationCall);
+ void setCredentials(const QString _call, const QString _email, const QString _pass, const bool _useQSOStationCall);
int sendQSO(QStringList _qso);
int deleteQSO(QStringList _qso);
int modifyQSO (QStringList _oldQSO, QStringList _newQSO);
@@ -50,8 +50,8 @@ public:
private:
QString getClubLogAdif(const QStringList _q);
- int sendData(const QString &_q); // Sends the data (http post) to ClubLog
- QString prepareToTranslate(const QString &_m); // Get the message and put it in a tr to be able to translate it
+ int sendData(const QString _q); // Sends the data (http post) to ClubLog
+ QString prepareToTranslate(const QString _m); // Get the message and put it in a tr to be able to translate it
QString call, email, pass, api, stationCallsign;
diff --git a/filemanager.cpp b/filemanager.cpp
index 721cc235..9fd31968 100644
--- a/filemanager.cpp
+++ b/filemanager.cpp
@@ -20,7 +20,7 @@
* 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 . *
+ * along with KLog. If not, see . *
* *
*****************************************************************************/
@@ -30,32 +30,34 @@
FileManager::FileManager(DataProxy_SQLite *dp)
{
- //qDebug() << "FileManager::FileManager()-1" << endl;
+ //qDebug() << "FileManager::FileManager()-1" << endl;
constrid = 1;
dataProxy = dp;
- dbCreated = false;
- rstTXDefault = false;
- rstRXDefault = false;
- ignoreUnknownAlways = false;
- noMoreQso = false;
- defaultStationCallsign = QString();
util = new Utilities;
klogVersion = util->getVersion();
db = new DataBase(Q_FUNC_INFO, klogVersion, util->getKLogDBFile());
- usePreviousStationCallsignAnswerAlways = false;
+ ignoreUnknownAlways = false;
world = new World(dataProxy, Q_FUNC_INFO);
awards = new Awards(dataProxy, Q_FUNC_INFO);
+
+
+
+ //dataProxyPrepared = new DataProxy_SQLite(klogVersion);
+
+ noMoreQso = false;
+
+
hashLogs.clear();
- //qDebug() << "FileManager::FileManager()-1 - END" << endl;
+ //qDebug() << "FileManager::FileManager()-1 - END" << endl;
}
/*
FileManager::FileManager(DataProxy_SQLite *dp, const QString _klogDir)
{
- //qDebug() << "FileManager::FileManager()-2: Dir" << _klogDir << endl;
+ //qDebug() << "FileManager::FileManager()-2: Dir" << _klogDir << endl;
dataProxy = dp;
db = new DataBase(0);
@@ -73,18 +75,15 @@ FileManager::FileManager(DataProxy_SQLite *dp, const QString _klogDir)
}
*/
-FileManager::FileManager(DataProxy_SQLite *dp, const QString &_klogDir, const QString &_softVersion)
+FileManager::FileManager(DataProxy_SQLite *dp, const QString _klogDir, const QString _softVersion)
//FileManager::FileManager(const QString _klogDir, const QString _softVersion, DataBase _db)
{
- //qDebug() << "FileManager::FileManager()-3: Dir(2)" << _klogDir << endl;
+ //qDebug() << "FileManager::FileManager()-3: Dir(2)" << _klogDir << endl;
constrid = 2;
dataProxy = dp;
util = new Utilities;
util->setVersion(klogVersion);
- defaultStationCallsign = QString();
- dbCreated = false;
- rstTXDefault = false;
- rstRXDefault = false;
+
db = new DataBase(Q_FUNC_INFO, klogVersion, util->getKLogDBFile());
klogVersion = _softVersion;
@@ -92,13 +91,12 @@ FileManager::FileManager(DataProxy_SQLite *dp, const QString &_klogDir, const QS
klogDir = _klogDir;
ignoreUnknownAlways = false;
- usePreviousStationCallsignAnswerAlways = false;
world = new World(dataProxy, klogDir, Q_FUNC_INFO);
awards = new Awards(dataProxy, Q_FUNC_INFO);
noMoreQso = false;
hashLogs.clear();
- //qDebug() << "FileManager::FileManager()-3: Dir(2) - END" << endl;
+ //qDebug() << "FileManager::FileManager()-3: Dir(2) - END" << endl;
}
FileManager::~FileManager()
@@ -106,22 +104,22 @@ FileManager::~FileManager()
}
-bool FileManager::checkADIFValidFormat(const QStringList &_qs)
+bool FileManager::checkADIFValidFormat(const QStringList _qs)
{
QStringList qs = _qs;
if (qs.size()!= 2)
{
- //qDebug() << "FileManager::checkADIFValidFormat-0 (not two) " << endl;
+ //qDebug() << "FileManager::checkADIFValidFormat-0 (not two) " << endl;
return false;
}
QString q0 = qs.at(0);
QString q1 = qs.at(1);
- //qDebug() << "FileManager::checkADIFValidFormat: " << qs.at(0) << endl;
- //qDebug() << "FileManager::checkADIFValidFormat: " << qs.at(1) << endl;
+ //qDebug() << "FileManager::checkADIFValidFormat: " << qs.at(0) << endl;
+ //qDebug() << "FileManager::checkADIFValidFormat: " << qs.at(1) << endl;
int len = 0;
int i = (qs.at(0)).count(":");
@@ -136,115 +134,112 @@ bool FileManager::checkADIFValidFormat(const QStringList &_qs)
}
else
{
- //qDebug() << "FileManager::checkADIFValidFormat-1 " << endl;
+ //qDebug() << "FileManager::checkADIFValidFormat-1 " << endl;
return false;
}
//i = (qs.at(0)).indexOf(":");
//i = (qs.at(0)).length() - i -1;
- //qDebug() << "i = " << QString::number(i) << "/" << qs.at(0) << endl;
+ //qDebug() << "i = " << QString::number(i) << "/" << qs.at(0) << endl;
//len = ( (qs.at(0)).right(i)).toInt();
- //qDebug() << "len = " << QString::number(len) << endl;
+ //qDebug() << "len = " << QString::number(len) << endl;
if ( (q1).length() != len )
{
- //qDebug() << "FileManager::checkADIFValidFormat-2: " << (qs.at(1)) << " - " << QString::number((qs.at(1)).length()) << "/" << QString::number(len) << endl;
+ //qDebug() << "FileManager::checkADIFValidFormat-2: " << (qs.at(1)) << " - " << QString::number((qs.at(1)).length()) << "/" << QString::number(len) << endl;
return false;
}
if (len <= 0)
{
- //qDebug() << "FileManager::checkADIFValidFormat-3 " << endl;
+ //qDebug() << "FileManager::checkADIFValidFormat-3 " << endl;
return false;
}
- //qDebug() << "FileManager::checkADIFValidFormat-4 (true)" << endl;
+ //qDebug() << "FileManager::checkADIFValidFormat-4 (true)" << endl;
return true;
}
bool FileManager::adifLogExport(const QString& _fileName, const int _logN)
{
- //qDebug() << "FileManager::adifLogExport" << _fileName << endl;
+ //qDebug() << "FileManager::adifLogExport" << endl;
return adifLogExportToFile(_fileName, _logN, false, false, false);
}
-void FileManager::showError (const QString &_txt)
+int FileManager::adifLoTWLogExport(const QString& _fileName, const int _logN)
{
- QMessageBox msgBox;
- msgBox.setWindowTitle(tr("KLog - Error"));
- msgBox.setIcon(QMessageBox::Warning);
-
- QString aux = QString(_txt );
- msgBox.setText(aux);
- msgBox.setStandardButtons(QMessageBox::Ok);
- int ret = msgBox.exec();
- switch (ret) {
- case QMessageBox::Ok:
- // Ok was clicked
- default:
- // should never be reached
- break;
- }
-}
-
-QList FileManager::adifLoTWLogExport(const QString& _fileName, const QString &_callsign, const QDate &_startDate, const QDate &_endDate, const int _logN)
-{
- //qDebug() << "FileManager::adifLoTWLogExport: " << _fileName << "/" << _callsign << endl;
- QList qsos;
- qsos.clear();
+ //qDebug() << "FileManager::adifLoTWLogExport: " << _fileName << endl;
if (!dataProxy->doesThisLogExist(_logN))
{
- //qDebug() << "FileManager::adifLoTWLogExport - The log does not exist" << endl;
-
- showError(tr("The selected log does not exist, please check it again."));
- return qsos;
- }
-
- QString queryStringCount;
- QString queryString;
- QString _queryStation;
-
- if (util->isValidCall(_callsign))
- {
- _queryStation = QString("station_callsign ='%1'").arg(_callsign);
- }
- else
- {
- _queryStation = QString("station_callsign =''");
- }
- /*
- QString _queryDateFrom;
- if (_startDate.isValid())
- {
- _queryDateFrom = QString("qso_date >= '%1'").arg(_startDate.toString("yyyyMMdd"));
- }
- else
- {
- //TODO
- }
- */
-
- if ((!util->isValidCall(_callsign)) || (_callsign == !"ALL"))
- {
- showError(tr("The selected callsign (%1) is not valid, please check it again.").arg(_callsign));
- return qsos;
+ //qDebug() << "FileManager::adifLoTWLogExport - The log does not exist" << endl;
+ return -1;
}
QFile file(_fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
+ return -2;
+
+ QString stationCallToUse = QString();
+ QStringList stationCallSigns;
+ stationCallSigns.clear();
+ stationCallSigns << "NONE";
+ stationCallSigns << dataProxy->getStationCallSignsFromLog(_logN);
+ //bool callsignTyped = false;
+
+ if (stationCallSigns.length()>1)
{
- showError(tr("The file %1 can't be opened.").arg(_fileName));
- return qsos;
+ QString msg = QString(tr("The log that you have selected contains more than just one station callsign.") + "\n\n" + tr("Please select the station callsign you want to export the log from:"));
+
+ bool ok;
+ stationCallToUse = QInputDialog::getItem(this, tr("Station Callsign:"),
+ msg, stationCallSigns, 0, false, &ok);
+
+ if (ok && !stationCallToUse.isEmpty())
+ {
+ //qDebug() << "FileManager::adifLoTWLogExport: StatioNCallsign: " << stationCallToUse << endl;
+ }
+ else
+ {
+ stationCallToUse = (QInputDialog::getText(this, tr("Define Station Callsign"),
+ tr("You have selected no callsign. KLog will export QSOs without a station callsign defined and those with the call you are entering here.") + "\n\n" + tr("Enter the station callsign to use for this log or leave it empty for QSO without station callsign defined:"), QLineEdit::Normal,
+ "", &ok)).toUpper();
+ if (ok)
+ {
+ //callsignTyped = true;
+
+ }
+ else
+ {
+ QMessageBox msgBox;
+ msgBox.setIcon(QMessageBox::Warning);
+
+ QString aux = QString(tr("No station callsign has been selected and therefore no log will be exported") );
+ msgBox.setText(aux);
+ msgBox.setStandardButtons(QMessageBox::Ok);
+ int ret = msgBox.exec();
+ switch (ret) {
+ case QMessageBox::Ok:
+ // Ok was clicked
+ return -3;
+ default:
+ // should never be reached
+ break;
+ }
+
+ }
+ }
}
+
+
QTextStream out(&file);
int numberOfQsos = dataProxy->getHowManyQSOInLog(_logN);
int step = util->getProgresStepForDialog(numberOfQsos);
@@ -254,1695 +249,218 @@ QList FileManager::adifLoTWLogExport(const QString& _fileName, const QStrin
progress.setMaximum(numberOfQsos);
progress.setWindowModality(Qt::ApplicationModal);
+ out << "ADIF v3.0.7 Export from KLog\nhttp://www.klog.xyz/klog\n" << klogVersion << "\nKLOG" << endl;
+ out << "" << QString::number(numberOfQsos) << endl;
- //QString queryString;
+ QDateTime dateTime = (QDateTime::currentDateTime()).toUTC();
+
+ out << "" << dateTime.toString("yyyyMMdd-hhmm") << endl;
+
+ out << "" << endl;
+
+ QString queryString = QString("SELECT call, freq, bandid, band_rx, freq_rx, modeid, qso_date, time_on, prop_mode, sat_name, lotw_qsl_sent, station_callsign FROM log WHERE lognumber='%1'").arg(_logN);
QSqlQuery query;
- if (_callsign == "ALL")
- {
- queryString = QString("SELECT COUNT (id) FROM log");
- }
- else
- {
- queryString = QString("SELECT COUNT (id) FROM log WHERE lognumber='%1' AND station_callsign ='%2' AND lotw_qsl_sent='Q'").arg(_logN).arg(_callsign);
- }
bool sqlOK = query.exec(queryString);
//qDebug() << "FileManager::adifLoTWLogExport: " << query.lastQuery() << endl;
if (!sqlOK)
{
- //qDebug() << "FileManager::adifLoTWLogExport: Query Error" << endl;
+ //qDebug() << "FileManager::adifLoTWLogExport: Query Error" << endl;
emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- return qsos;
+ return -4;
}
- else
- {
- query.next();
- if (query.isValid())
- {
- i = (query.value(0)).toInt();
- if (i>0)
- {
- numberOfQsos = i;
- }
- else if (i == 0)
- {
- showError(tr("There are no QSOs pending to be uploaded with that station callsign."));
- return qsos;
- }
- }
- }
- out << "ADIF v3.0.7 Export from KLog\nhttps://www.klog.xyz/klog\n" << klogVersion << "\nKLOG" << endl;
- //qDebug() << "FileManager::adifLoTWLogExport: Number: " << QString::number(numberOfQsos) << endl;
- out << "" << QString::number(numberOfQsos) << endl;
-
-
-
- QDateTime dateTime = (QDateTime::currentDateTime()).toUTC();
-
- out << "" << dateTime.toString("yyyyMMdd-hhmm") << endl;
-
- out << "" << endl;
-
- // Required fields: call sign, UTC Date, UTC time, Mode, Band
- // Optional fields: RX band, Frecuency TX, frecuency RX, Propagation mode, Satellite
-
- i = 0;
-
- if (_callsign == "ALL")
- {
- queryString = QString("SELECT id, call, freq, bandid, band_rx, freq_rx, modeid, qso_date, time_on, prop_mode, sat_name, lotw_qsl_sent, station_callsign FROM log ");
- }
- else
- {
- queryString = QString("SELECT id, call, freq, bandid, band_rx, freq_rx, modeid, qso_date, time_on, prop_mode, sat_name, lotw_qsl_sent, station_callsign FROM log WHERE lognumber='%1' AND station_callsign ='%2' AND lotw_qsl_sent='Q'").arg(_logN).arg(_callsign);
- }
-
-
-
-
- sqlOK = query.exec(queryString);
- //qDebug() << "FileManager::adifLoTWLogExport: " << query.lastQuery() << endl;
- if (!sqlOK)
- {
- //qDebug() << "FileManager::adifLoTWLogExport: Query Error" << endl;
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- return qsos;
- }
-
QSqlRecord rec = query.record();
int nameCol;
QString aux, aux2;
QString bandst, bandrxst;
-
- //bool finishExport = false;
bool propsat;
- //while ( (query.next()) && (!finishExport))
- while ( query.next() )
+ while ( (query.next()))
{
- double freqTX, freqRX;
- freqTX = 0.0;
- freqRX = 0.0;
- bandrxst.clear();
- bandst.clear();
- aux.clear();
-
- //qDebug() << "FileManager::adifLoTWLogExport: Start of While" << endl;
+ //qDebug() << "FileManager::adifLoTWLogExport: Start of While" << endl;
if (query.isValid())
{
-
- //qDebug() << "FileManager::adifLoTWLogExport: Start of isValid" << endl;
- propsat = false; // Reset the QSO in case it is a Satellite QSO
- nameCol = rec.indexOf("id");
- qsos.append((query.value(nameCol)).toInt());
- nameCol = rec.indexOf("call");
-
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
-
- if (util->isValidCall(aux))
- {
- out << "" << aux << " ";
- }
- else
- {
- QMessageBox msgBox;
- msgBox.setIcon(QMessageBox::Warning);
- msgBox.setWindowTitle(tr("KLog - Invalid call detected"));
- QString aux = QString(tr("An invalid callsign has been detected %1. Do you want to export this callsign anyway (click on Yes) or remove the call from the exported log file?").arg(aux));
- msgBox.setText(aux);
- msgBox.setInformativeText(tr("Exporting wrong calls may create problems in the applications you are potentially importing this logfile to. It may, however, be a good callsign that is wrongly identified by KLog as not valid. You can, however, edit the ADIF file once the export process is finished."));
- msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- msgBox.setDefaultButton(QMessageBox::No);
- int ret = msgBox.exec();
- switch (ret) {
- case QMessageBox::Yes:
- // Yes was clicked
- out << "" << aux << " ";
- break;
- case QMessageBox::No:
- // No Save was clicked
- break;
- default:
- // should never be reached
- break;
- }
- }
- //qDebug() << "FileManager::adifLoTWLogExport: CALL" << endl;
-
- nameCol = rec.indexOf("qso_date");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10){
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
- if (util->isValidDate(date))
- {
- out << "" << aux << " ";
- }
- }
-
- nameCol = rec.indexOf("time_on");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((QTime::fromString(aux,"hh:mm:ss")).isValid())
- {
- aux.remove(QChar(':'), Qt::CaseInsensitive);
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("bandid");
- aux = (query.value(nameCol)).toString();
- //qDebug() << "FileManager::adifLoTWLogExportToFile-Band-1: " << aux << endl;
- aux = util->checkAndFixASCIIinADIF(aux);
- //qDebug() << "FileManager::adifLoTWLogExportToFile-Band-2: " << aux << endl;
- aux = dataProxy->getNameFromBandId(aux.toInt());
- if (dataProxy->getIdFromBandName(aux)>=0)
- {
- //out << "" << aux << " ";
- bandst = aux;
- }
-
- nameCol = rec.indexOf("freq");
- aux = (query.value(nameCol)).toString();
- //qDebug() << "FileManager::adifLoTWLogExportToFile FREQ1: " << aux << endl;
- aux = util->checkAndFixASCIIinADIF(aux);
- freqTX = aux.toDouble();
- if (freqTX > 0.0)
- {
- //TODO: Check if the Band is correctly defined. BAND Wins and freq is lost if not correct
- if (dataProxy->getBandIdFromFreq(freqTX) != dataProxy->getIdFromBandName(bandst))
- {
- bandst = dataProxy->getBandNameFromFreq(freqTX);
- }
- out << "" << aux << " ";
- }
- if (dataProxy->getIdFromBandName(bandst)>0)
- {
- out << "" << bandst << " ";
- }
- // Now the BAND RX
- nameCol = rec.indexOf("band_rx");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- aux = dataProxy->getNameFromBandId(aux.toInt());
- if (dataProxy->getIdFromBandName(aux)>=0)
- {
- bandrxst = aux;
- }
-
- nameCol = rec.indexOf("freq_rx");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- freqRX = aux.toDouble();
- if (freqRX > 0.0)
- {
- //TODO: Check if the Band is correctly defined. BAND Wins and freq is lost if not correct
- if (dataProxy->getBandIdFromFreq(freqRX) != dataProxy->getIdFromBandName(bandrxst))
- {
- bandrxst = dataProxy->getBandNameFromFreq(freqRX);
- }
- out << "" << aux << " ";
- }
- if (dataProxy->getIdFromBandName(bandrxst)>0)
- {
- out << "" << bandrxst << " ";
- }
- // END of Band RX
-
- nameCol = rec.indexOf("modeid");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- // get SubModeId to check if it is the same or not from modeid
- aux2 = dataProxy->getSubModeFromId(aux.toInt());
- //aux = db->getModeNameFromID2(aux.toInt());
- aux = dataProxy->getNameFromSubMode(aux2);
-
- if ((aux.length()>1) && (dataProxy->getIdFromModeName(aux)>=0))
- {
- out << "" << aux << " ";
- }
- if ((aux != aux2) && (aux.length()>1) && (dataProxy->getSubModeIdFromSubMode(aux2)>=0) )
- {
- out << "" << aux2 << " ";
- }
-
- nameCol = rec.indexOf("prop_mode");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>1)
- {
- out << "" << aux << " ";
- if (aux == "SAT")
- {
- propsat = true;
- }
- }
- //qDebug() << "FileManager::adifLoTWLogExport: PROP_MODE" << endl;
-
- nameCol = rec.indexOf("sat_name");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- if (!propsat)
- {
- out << "SAT ";
- }
- }
- //qDebug() << "FileManager::adifLoTWLogExport: SAT_NAME" << endl;
-
nameCol = rec.indexOf("station_callsign");
aux = (query.value(nameCol)).toString();
- //qDebug() << "FileManager::adifLoTWLogExport: StationCallSign: " << aux << endl;
-
- if ((util->isValidCall(aux)))
- { // User selected one station callsign from the log
- out << "" << aux << " ";
- }
- else
- { // Other cases
-
- }
-
- out << " " << endl;
- i++;
-
- if (( (i % step ) == 0) )
- { // To update the speed I will only show the progress once each X QSOs
- //qDebug() << "FileManager::adifLoTWLogExport: MOD 0 - i = " << QString::number(i) << endl;
- aux = tr("Exporting LoTW ADIF file...") + "\n" + tr(" QSO: ") + QString::number(i) + "/" + QString::number(numberOfQsos);
- progress.setLabelText(aux);
- progress.setValue(i);
- }
- else
- {
- //qDebug() << "FileManager::adifLoTWLogExport: Mod: "<< QString::number(i) << " mod " << QString::number(step) << " = " << QString::number(i % step) << endl;
- }
- }
- //qDebug() << "FileManager::adifLoTWLogExport: End Of Valid" << endl;
- if ( progress.wasCanceled() )
- {
- QMessageBox msgBox;
- msgBox.setWindowTitle(tr("KLog - User cancelled"));
- QString aux = QString(tr("You have canceled the file export. The file will be removed and no data will be exported.") + "\n" + tr("Do you still want to cancel?"));
- msgBox.setText(aux);
- msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- msgBox.setDefaultButton(QMessageBox::No);
- int ret = msgBox.exec();
- switch (ret) {
- case QMessageBox::Yes:
- // Yes was clicked
- // finishExport = true;
- qsos.clear();
- return qsos;
- case QMessageBox::No:
- // No Save was clicked
- break;
- default:
- // should never be reached
- break;
- }
- }
- }
-
- //qDebug() << "FileManager::adifLoTWLogExport: End : " << QString::number(qsos.count()) << endl;
-
- return qsos;
-}
-
-
-QList FileManager::adifLogExport(const QString& _fileName, const QString &_callsign, const QDate &_startDate, const QDate &_endDate, const int _logN, const ExportMode _em)
-//QList FileManager::adifLogExport(const QString& _fileName, const QString &_callsign, const QDate &_startDate, const QDate &_endDate, const int _logN, const bool LoTWOnly)
-{
-
- //qDebug() << "FileManager::adifLogExport: Start)" << _fileName << "/" << _callsign << endl;
- QList qsos;
- qsos.clear();
-
- if (_logN != -1)
- { // We will export data from ALL logs.
- if (!dataProxy->doesThisLogExist(_logN))
- {
- //qDebug() << "FileManager::adifLogExport - The log does not exist" << endl;
- showError(tr("The selected log does not exist, please check it again."));
- return qsos;
- }
- }
-
- QString queryStringCount;
- QString queryString;
- QString _queryStation;
-
- if (util->isValidCall(_callsign))
- {
- _queryStation = QString(" station_callsign ='%1'").arg(_callsign);
- }
- else if (_callsign == "ALL")
- {
- _queryStation = QString(" station_callsign !='ALL'");
- }
- else
- {
- _queryStation = QString(" station_callsign =''");
- }
-
- QString _queryDateFrom;
- if (_startDate.isValid())
- {
- _queryDateFrom = QString(" AND qso_date >= '%1'").arg(_startDate.toString("yyyy/MM/dd"));
- }
- else
- {
- _queryDateFrom = QString(" AND qso_date != '1'");
- }
-
- QString _queryDateTo;
- if (_startDate.isValid())
- {
- _queryDateTo = QString(" AND qso_date <= '%1'").arg(_endDate.toString("yyyy/MM/dd"));
- }
- else
- {
- _queryDateTo = QString();
- }
-
- QString _queryLog;
- if (_logN == -1)
- {
- _queryLog = QString(" AND logNumber = '%1'").arg(_logN);
- }
- else
- {
- _queryLog = QString();
- }
-
- if ((!util->isValidCall(_callsign)) && (_callsign != "ALL"))
- {
- showError(tr("The selected callsign (%1) is not valid, please check it again to export the log.").arg(_callsign));
- return qsos;
- }
-
-
- QFile file(_fileName);
- if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
- {
- showError(tr("The file %1 can't be opened.").arg(_fileName));
- return qsos;
- }
-
- QSqlQuery query;
-
- if (_em == ModeLotW)
- {
- //qDebug() << "FileManager::adifLogExport: Exporting for LoTW" << endl;
- // LoTW Required fields: call sign, UTC Date, UTC time, Mode, Band
- // LoTW Optional fields: RX band, Frecuency TX, frecuency RX, Propagation mode, Satellite
-
- queryStringCount = QString("SELECT COUNT (id) FROM log WHERE") + _queryStation + QString(" AND lotw_qsl_sent='Q'") + _queryDateFrom + _queryDateTo;
- queryString = QString("SELECT id, call, freq, bandid, band_rx, freq_rx, modeid, qso_date, time_on, prop_mode, sat_name, station_callsign FROM log WHERE") + _queryStation + QString(" AND lotw_qsl_sent='Q'") + _queryDateFrom + _queryDateTo;
- }
- else
- {
- //qDebug() << "FileManager::adifLogExport: Exporting normal ADIF" << endl;
- if (_callsign == "ALL")
- {
- queryStringCount = QString("SELECT COUNT (id) FROM log");
- queryString = QString("SELECT * FROM log");
- }
- else
- {
- queryStringCount = QString("SELECT COUNT (id) FROM log WHERE") + _queryStation + _queryDateFrom + _queryDateTo + _queryLog;
- queryString = QString("SELECT * FROM log WHERE") + _queryStation + _queryDateFrom + _queryDateTo + _queryLog;
- }
-
-
- }
-
- int numberOfQsos = dataProxy->getHowManyQSOInLog(_logN);
- int i = 0;
-
- bool sqlOK = query.exec(queryStringCount);
- //qDebug() << "FileManager::adifLogExport: " << query.lastQuery() << endl;
- if (!sqlOK)
- {
- //qDebug() << "FileManager::adifLogExport: Query Error" << endl;
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- return qsos;
- }
- else
- {
- query.next();
- if (query.isValid())
- {
- i = (query.value(0)).toInt();
- if (i>0)
- {
- numberOfQsos = i;
- query.finish();
- }
- else if (i == 0)
- {
- showError(tr("There are no QSOs pending to be uploaded with that station callsign."));
- query.finish();
- return qsos;
- }
- }
- }
-
- QTextStream out(&file);
-
- int step = util->getProgresStepForDialog(numberOfQsos);
-
- QProgressDialog progress(tr("Writing ADIF file..."), tr("Abort writing"), 0, numberOfQsos, this);
- progress.setMaximum(numberOfQsos);
- progress.setWindowModality(Qt::NonModal);
- //progress.setWindowModality(Qt::ApplicationModal);
-
- out << "ADIF v3.0.7 Export from KLog\nhttps://www.klog.xyz/klog\n" << klogVersion << "\nKLOG" << endl;
- //qDebug() << "FileManager::adifLogExport: Number: " << QString::number(numberOfQsos) << endl;
- out << "" << QString::number(numberOfQsos) << endl;
-
- QDateTime dateTime = (QDateTime::currentDateTime()).toUTC();
- out << "" << dateTime.toString("yyyyMMdd-hhmm") << endl;
- out << "" << endl;
-
- i = 0;
-
- sqlOK = query.exec(queryString);
- //qDebug() << "FileManager::adifLogExport: " << query.lastQuery() << endl;
- if (!sqlOK)
- {
- //qDebug() << "FileManager::adifLogExport: Query Error" << endl;
- emit queryError(Q_FUNC_INFO, query.lastError().databaseText(), query.lastError().number(), query.lastQuery());
- return qsos;
- }
-
-
- QSqlRecord rec = query.record();
- int nameCol;
- QString aux, aux2;
- QString bandst, bandrxst;
-
- //bool finishExport = false;
- bool propsat;
- //while ( (query.next()) && (!finishExport))
- //qDebug() << "FileManager::adifLogExport: Entering the While..." << endl;
- while ( query.next() )
- {
- double freqTX, freqRX;
- freqTX = 0.0;
- freqRX = 0.0;
- bandrxst.clear();
- bandst.clear();
- aux.clear();
-
- //qDebug() << "FileManager::adifLogExport: Start of While" << endl;
- if (query.isValid())
- {
- //qDebug() << "FileManager::adifLogExport: Start of isValid" << endl;
- propsat = false; // Reset the QSO in case it is a Satellite QSO
-
- nameCol = rec.indexOf("id");
- qsos.append((query.value(nameCol)).toInt());
-
- nameCol = rec.indexOf("call");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- //qDebug() << "FileManager::adifLogExport: Call: " << aux << endl;
- if (util->isValidCall(aux))
- {
- //qDebug() << "FileManager::adifLogExport: Valid Call: " << aux << endl;
- out << "" << aux << " ";
- }
- else
- {
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: " << aux << endl;
- QMessageBox msgBox;
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: 00" << endl;
- msgBox.setIcon(QMessageBox::Warning);
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: 01" << endl;
- msgBox.setWindowTitle(tr("KLog - Invalid call detected"));
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: 02" << endl;
- QString msgText = QString(tr("An invalid callsign has been detected %1. Do you want to export this callsign anyway (click on Yes) or remove the call from the exported log file?").arg(aux));
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: 03" << endl;
- msgBox.setText(msgText);
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: 04" << endl;
- msgBox.setInformativeText(tr("Exporting wrong calls may create problems in the applications you are potentially importing this logfile to. It may, however, be a good callsign that is wrongly identified by KLog as not valid. You can, however, edit the ADIF file once the export process is finished."));
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: 05" << endl;
- msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- msgBox.setDefaultButton(QMessageBox::No);
- int ret = msgBox.exec();
- int tempValue = progress.value();
- progress.cancel();
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: ret = " << QString::number(ret) << endl;
- switch (ret)
- {
- case QMessageBox::Yes:
- // Yes was clicked
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: YES clicked" << endl;
- out << "" << aux << " ";
-
- break;
- case QMessageBox::No:
- // No Save was clicked
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: NO Clicked" << endl;
- break;
- default:
- //qDebug() << "FileManager::adifLogExport: NOT Valid Call: DEFAULT" << endl;
- // should never be reached
- break;
- }
- progress.reset();
- progress.setMaximum(numberOfQsos);
- progress.setValue(tempValue);
-
- //qDebug() << "FileManager::adifLogExport: End of NOT Valid Call: " << aux << endl;
- }
- //qDebug() << "FileManager::adifLogExport: QSO_DATE" << endl;
-
- nameCol = rec.indexOf("qso_date");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10)
- {
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
- if (util->isValidDate(date))
- {
- out << "" << aux << " ";
- }
- }
-
- nameCol = rec.indexOf("time_on");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((QTime::fromString(aux,"hh:mm:ss")).isValid())
- {
- aux.remove(QChar(':'), Qt::CaseInsensitive);
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("bandid");
- aux = (query.value(nameCol)).toString();
- //qDebug() << "FileManager::adifLogExportToFile-Band-1: " << aux << endl;
- aux = util->checkAndFixASCIIinADIF(aux);
- //qDebug() << "FileManager::adifLogExportToFile-Band-2: " << aux << endl;
- aux = dataProxy->getNameFromBandId(aux.toInt());
- if (dataProxy->getIdFromBandName(aux)>=0)
- {
- //out << "" << aux << " ";
- bandst = aux;
- }
-
- nameCol = rec.indexOf("freq");
- aux = (query.value(nameCol)).toString();
- //qDebug() << "FileManager::adifLogExport FREQ1: " << aux << endl;
- aux = util->checkAndFixASCIIinADIF(aux);
- freqTX = aux.toDouble();
- if (freqTX > 0.0)
- {
- //TODO: Check if the Band is correctly defined. BAND Wins and freq is lost if not correct
- if (dataProxy->getBandIdFromFreq(freqTX) != dataProxy->getIdFromBandName(bandst))
- {
- bandst = dataProxy->getBandNameFromFreq(freqTX);
- }
- out << "" << aux << " ";
- }
- if (dataProxy->getIdFromBandName(bandst)>0)
- {
- out << "" << bandst << " ";
- }
-
- // Now the BAND RX
- nameCol = rec.indexOf("band_rx");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- aux = dataProxy->getNameFromBandId(aux.toInt());
- if (dataProxy->getIdFromBandName(aux)>=0)
- {
- bandrxst = aux;
- }
-
- nameCol = rec.indexOf("freq_rx");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- freqRX = aux.toDouble();
- if (freqRX > 0.0)
- {
- //TODO: Check if the Band is correctly defined. BAND Wins and freq is lost if not correct
- if (dataProxy->getBandIdFromFreq(freqRX) != dataProxy->getIdFromBandName(bandrxst))
- {
- bandrxst = dataProxy->getBandNameFromFreq(freqRX);
- }
- out << "" << aux << " ";
- }
- if (dataProxy->getIdFromBandName(bandrxst)>0)
- {
- out << "" << bandrxst << " ";
- }
- // END of Band RX
-
- nameCol = rec.indexOf("modeid");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- // get SubModeId to check if it is the same or not from modeid
- aux2 = dataProxy->getSubModeFromId(aux.toInt());
- //aux = db->getModeNameFromID2(aux.toInt());
- aux = dataProxy->getNameFromSubMode(aux2);
-
- if ((aux.length()>1) && (dataProxy->getIdFromModeName(aux)>=0))
- {
- out << "" << aux << " ";
- }
- if ((aux != aux2) && (aux.length()>1) && (dataProxy->getSubModeIdFromSubMode(aux2)>=0) )
- {
- out << "" << aux2 << " ";
- }
-
- nameCol = rec.indexOf("prop_mode");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>1)
- {
- out << "" << aux << " ";
- if (aux == "SAT")
- {
- propsat = true;
- }
- }
- //qDebug() << "FileManager::adifLogExport: PROP_MODE" << endl;
-
- nameCol = rec.indexOf("sat_name");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- if (!propsat && (_em == ModeLotW))
- {
- out << "SAT ";
- propsat = false;
- }
- }
- //qDebug() << "FileManager::adifLogExport: SAT_NAME" << endl;
-
- nameCol = rec.indexOf("station_callsign");
- aux = (query.value(nameCol)).toString();
- //qDebug() << "FileManager::adifLogExport: StationCallSign: " << aux << endl;
-
- if ((util->isValidCall(aux)))
- { // User selected one station callsign from the log
- out << "" << aux << " ";
- }
-
-
- if (_em == ModeADIF)
- { // START OF EXPORT OF GENERAL ADIF
-
- nameCol = rec.indexOf("qso_date_off");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if (util->isValidDate(QDate::fromString("yyyy/MM/dd")))
- {
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("time_off");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- //qDebug() << "FileManager::adifLogExport: time_off-682" << QString::number(nameCol) << "/" << aux << endl;
- if ( ((aux.length()) == 5) || ((aux.length()) == 8) )
- {
- aux.remove(QChar(':'), Qt::CaseInsensitive);
- out << "" << aux << " ";
- //qDebug() << "FileManager::adifLogExport: time_off exported-682" << endl;
- }
-
- nameCol = rec.indexOf("srx");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("srx_string");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
- nameCol = rec.indexOf("stx");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("stx_string");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
- //qDebug() << "FileManager::adifLogExport - 100" << endl;
- nameCol = rec.indexOf("cqz");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())>0) && (0 < aux.toInt()) && (aux.toInt() < CQZones+1) )
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("ituz");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())>0) && (0 < aux.toInt()) && (aux.toInt() < ITUZones+1) )
- {
- out << "" << aux << " ";
- }
-
- //qDebug() << "FileManager::adifLogExport: DXCC - Now..." << endl;
-
- nameCol = rec.indexOf("dxcc");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- //qDebug() << "FileManager::adifLogExport: DXCC " << aux << endl;
- }
- //qDebug() << "FileManager::adifLogExport: DXCC - Exported!" << endl;
-
- nameCol = rec.indexOf("address");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("age");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("cnty");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("comment");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
- //qDebug() << "FileManager::adifLogExport - 200" << endl;
- nameCol = rec.indexOf("a_index");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("ant_az");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("ant_el");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("ant_path");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("arrl_sect");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("checkcontest");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- //qDebug() << "FileManager::adifLogExport - 30" << endl;
- nameCol = rec.indexOf("class");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("cont");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("contacted_op");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if (util->isValidCall(aux))
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("contest_id");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("points");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("multiplier");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
- //qDebug() << "FileManager::adifLogExport - 40" << endl;
- nameCol = rec.indexOf("transmiterid");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("country");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("credit_submitted");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("credit_granted");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("distance");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("darc_dok");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("eq_call");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if (util->isValidCall(aux))
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("email");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- if (aux.contains("@") && (aux.contains(".")))
- {
- out << "" << aux << " ";
- }
- }
-
- nameCol = rec.indexOf("eqsl_qslrdate");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10)
- {
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
-
- if (util->isValidDate(date))
- {
- out << "" << aux << " ";
- }
- }
-
- nameCol = rec.indexOf("eqsl_qslsdate");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10)
- {
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
- if (util->isValidDate(date))
- {
- out << "" << aux << " ";
- }
- }
-
- nameCol = rec.indexOf("eqsl_qsl_rcvd");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())==1) && (aux!="N") )
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("eqsl_qsl_sent");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())==1) && (aux!="N") )
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("fists");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("fists_cc");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("force_init");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
-
- nameCol = rec.indexOf("guest_op");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("hrdlog_qso_upload_date");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10)
- {
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
-
- if (util->isValidDate(date))
- {
- out << "" << aux << " ";
- }
- }
-
- nameCol = rec.indexOf("hrdlog_qso_upload_status");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())==1) && ((aux!="Y") || (aux!="N") || (aux!="M")) )
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("gridsquare");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_gridsquare");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_antenna");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_dxcc");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_fists");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("iota");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- //qDebug() << "FileManager::adifLogExportToFile (IOTA): " << aux << endl;
- if (((aux.length())>=4) && ((aux.length())<=6))
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("iota_island_id");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- //qDebug() << "FileManager::adifLogExportToFile (IOTA_ID): " << aux << endl;
-
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_iota");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if (((aux.length())>=4) && ((aux.length())<=6))
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_iota_island_id");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("k_index");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_itu_zone");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("lat");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("lon");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_lat");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_lon");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("lotw_qslrdate");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10)
- {
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
- if (util->isValidDate(date))
- {
- out << "" << aux << " ";
- }
- }
-
- nameCol = rec.indexOf("lotw_qslsdate");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10)
- {
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
- if (util->isValidDate(date))
- {
- out << "" << aux << " ";
- }
- }
-
-
- nameCol = rec.indexOf("lotw_qsl_rcvd");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())==1) && (aux!="N") )
- {
- out << "" << aux << " ";
- }
+ if ( ( (stationCallToUse == "NONE") && util->isValidCall(aux) ) || (aux == stationCallToUse) )
+ { // We are only exporting the QSO from the appropriate station callsign or with empty stationcallsigns but we will add the one entered by the user.
nameCol = rec.indexOf("lotw_qsl_sent");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())==1) && (aux!="N") )
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("clublog_qso_upload_date");
aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10)
+ if (aux == "Q")
{
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
- if (util->isValidDate(date))
+ //qDebug() << "FileManager::adifLoTWLogExport: Start of isValid" << endl;
+ propsat = false; // Reset the QSO in case it is a Satellite QSO
+
+ nameCol = rec.indexOf("call");
+ aux = (query.value(nameCol)).toString();
+ aux = util->checkAndFixASCIIinADIF(aux);
+ //qDebug() << "FileManager::adifLoTWLogExport: " << QString::number(nameCol) << "/" << aux << endl;
+ if (aux.length()>0)
{
- out << "" << aux << " ";
+ out << "" << aux<< " ";
}
- }
+ //qDebug() << "FileManager::adifLoTWLogExport: CALL" << endl;
- nameCol = rec.indexOf("clublog_qso_upload_status");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())==1) && ((aux!="Y") || (aux!="N") || (aux!="M")) )
- {
- out << "" << aux << " ";
- }
+ nameCol = rec.indexOf("qso_date");
+ aux = (query.value(nameCol)).toString();
+ aux = util->checkAndFixASCIIinADIF(aux);
+ if ((aux.length()) == 10){
+ aux.remove(QChar('-'), Qt::CaseInsensitive);
+ aux.remove(QChar('/'), Qt::CaseInsensitive);
+ QDate date = QDate::fromString(aux, "yyyyMMdd");
- nameCol = rec.indexOf("qrzcom_qso_upload_date");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10)
- {
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
- if (util->isValidDate(date))
+ if (util->isValidDate(date))
+ {
+ out << "" << aux << " ";
+ }
+ }
+
+ nameCol = rec.indexOf("time_on");
+ aux = (query.value(nameCol)).toString();
+ aux = util->checkAndFixASCIIinADIF(aux);
+ //qDebug() << "FileManager::adifLoTWLogExportToFile-time_on: " << aux << endl;
+ if ( ((aux.length()) == 5) || ((aux.length()) == 8) ){
+ aux.remove(QChar(':'), Qt::CaseInsensitive);
+
+ out << "" << aux << " ";
+ }
+
+ nameCol = rec.indexOf("bandid");
+ aux = (query.value(nameCol)).toString();
+ //qDebug() << "FileManager::adifLoTWLogExportToFile-Band-1: " << aux << endl;
+ aux = util->checkAndFixASCIIinADIF(aux);
+ //qDebug() << "FileManager::adifLoTWLogExportToFile-Band-2: " << aux << endl;
+ //aux = db->getBandNameFromID2(aux.toInt());
+ aux = dataProxy->getNameFromBandId(aux.toInt());
+ //qDebug() << "FileManager::adifLoTWLogExportToFile-Band-3: " << aux << endl;
+
+
+ if (dataProxy->getIdFromBandName(aux)>=0)
{
- out << "" << aux << " ";
+ out << "" << aux << " ";
+ bandst = aux;
}
- }
- nameCol = rec.indexOf("qrzcom_qso_upload_status");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())==1) && ((aux!="Y") || (aux!="N") || (aux!="M")) )
- {
- out << "" << aux << " ";
- }
+ nameCol = rec.indexOf("band_rx");
+ aux = (query.value(nameCol)).toString();
+ aux = util->checkAndFixASCIIinADIF(aux);
+ aux = dataProxy->getNameFromBandId(aux.toInt());
- nameCol = rec.indexOf("max_bursts");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("ms_shower");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_city");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_cnty");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_country");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_cq_zone");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_name");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("name");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("operator");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if (util->isValidCall(aux))
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("owner_callsign");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if (util->isValidCall(aux))
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_postal_code");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_rig");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_sig");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_sota_ref");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_postal_code");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_state");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_street");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("notes");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- aux.replace("\n", "---");
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("nr_bursts");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("nr_pings");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("pfx");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("precedence");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
- {
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("public_key");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("qslmsg");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("qslrdate");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10){
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
-
- if (util->isValidDate(date))
+ if ( dataProxy->getIdFromBandName(aux)>=0)
{
- out << "" << aux << " ";
+ out << "" << aux << " ";
+ QString bandrxst = aux;
}
- }
+ //qDebug() << "FileManager::adifLoTWLogExport: BAND_RX" << endl;
- nameCol = rec.indexOf("qslsdate");
- aux = (query.value(nameCol)).toString();
- aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length()) == 10){
- aux.remove(QChar('-'), Qt::CaseInsensitive);
- aux.remove(QChar('/'), Qt::CaseInsensitive);
- QDate date = QDate::fromString(aux, "yyyyMMdd");
+ nameCol = rec.indexOf("modeid");
+ aux = (query.value(nameCol)).toString();
+ aux = util->checkAndFixASCIIinADIF(aux);
+ // get SubModeId to check if it is the same or not from modeid
+ aux2 = dataProxy->getSubModeFromId(aux.toInt());
+ //aux = db->getModeNameFromID2(aux.toInt());
+ aux = dataProxy->getNameFromSubMode(aux2);
- if (util->isValidDate(date))
+ //qDebug() << "FileManager::adifLoTWLogExportToFile - MODE aux2: " << aux2 << endl;
+ //qDebug() << "FileManager::adifLoTWLogExportToFile - MODE aux: " << aux << endl;
+
+ if ((aux.length()>1) && (dataProxy->getIdFromModeName(aux)>=0))
{
- out << "" << aux << " ";
+ //haveMode = true;
+ out << "" << aux << " ";
}
- }
- nameCol = rec.indexOf("qsl_rcvd");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if (((aux.length())==1) && (aux!="N") ){
- out << "" << aux << " ";
+ if ((aux != aux2) && (aux.length()>1) && (dataProxy->getSubModeIdFromSubMode(aux2)>=0) )
+ {
+ //haveMode = true;
+ out << "" << aux2 << " ";
+ }
- nameCol = rec.indexOf("qsl_rcvd_via");
+ //qDebug() << "FileManager::adifLoTWLogExport: SUBMODE: " << aux2 << endl;
+
+ nameCol = rec.indexOf("freq");
+ aux = (query.value(nameCol)).toString();
+ //qDebug() << "FileManager::adifLoTWLogExportToFile FREQ1: " << aux << endl;
+ aux = util->checkAndFixASCIIinADIF(aux);
+
+ if ((aux.length())>0){
+ //TODO: Check if the Band is correctly defined. BAND Wins and freq is lost if not correct
+ if (dataProxy->getBandIdFromFreq(aux.toDouble()) == dataProxy->getIdFromBandName(bandst))
+ //if (db->isThisFreqInBand(bandst, aux))
+ {
+ out << "" << aux << " ";
+ }
+
+ }
+ //qDebug() << "FileManager::adifLoTWLogExport: FREQ" << endl;
+ nameCol = rec.indexOf("freq_rx");
aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())==1){
- out << "" << aux << " ";
+ if ((aux.length())>0){
+ //TODO: Check if the Band is correctly defined. BAND Wins and freq is lost if not correct
+ if (dataProxy->getBandIdFromFreq(aux.toDouble()) == dataProxy->getIdFromBandName(bandrxst))
+ //if (db->isThisFreqInBand(bandrxst, aux))
+ {
+ out << "" << aux << " ";
+ }
}
- }
+ //qDebug() << "FileManager::adifLoTWLogExport: FREQ_RX" << endl;
- nameCol = rec.indexOf("qsl_sent");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if (((aux.length())==1) && (aux!="N") ){
- out << "" << aux << " ";
- nameCol = rec.indexOf("qsl_sent_via");
+ nameCol = rec.indexOf("prop_mode");
aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())==1) {
- out << "" << aux << " ";
+ if ((aux.length())>1){
+ out << "" << aux << " ";
+ if (aux == "SAT")
+ {
+ propsat = true;
+ }
+
}
+ //qDebug() << "FileManager::adifLoTWLogExport: PROP_MODE" << endl;
- }
-
- nameCol = rec.indexOf("qsl_via");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("qso_complete");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("qso_random");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("qth");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("rst_sent");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("rst_rcvd");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("region");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("rig");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("rx_pwr");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if (((aux.length())>0) && (aux.toDouble()>0) ){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("tx_pwr");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ( ((aux.length())>0) && (aux.toDouble()>0)) {
- out << "" << aux << " ";
- }
-
-
- nameCol = rec.indexOf("sat_mode");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
-
- nameCol = rec.indexOf("sfi");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("sig");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("sig_info");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("silent_key");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("skcc");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("sota_ref");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("state");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("swl");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("ten_ten");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("ten_ten");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("uksmg");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("ve_prov");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_usaca_counties");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("usaca_counties");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("vucc_grids");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("my_vucc_grids");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- nameCol = rec.indexOf("web");
- aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0){
- out << "" << aux << " ";
- }
-
- if (_logN == -1)
- {
- nameCol = rec.indexOf("lognumber");
+ nameCol = rec.indexOf("sat_name");
aux = (query.value(nameCol)).toString(); aux = util->checkAndFixASCIIinADIF(aux);
- if ((aux.length())>0)
+ if ((aux.length())>0){
+ out << "" << aux << " ";
+
+ if (!propsat)
+ {
+ out << "SAT ";
+ }
+ }
+ //qDebug() << "FileManager::adifLoTWLogExport: SAT_NAME" << endl;
+
+ out << " " << endl;
+
+ i++;
+ if (( (i % step ) == 0) )
+ { // To update the speed I will only show the progress once each X QSOs
+ //qDebug() << "FileManager::adifLoTWLogExport: MOD 0 - i = " << QString::number(i) << endl;
+
+ aux = tr("Exporting LoTW ADIF file...") + "\n" + tr(" QSO: ") + QString::number(i) + "/" + QString::number(numberOfQsos);
+
+ progress.setLabelText(aux);
+ progress.setValue(i);
+
+ }
+ else
{
- out << "" << aux << " ";
+ //qDebug() << "FileManager::adifLoTWLogExport: Mod: "<< QString::number(i) << " mod " << QString::number(step) << " = " << QString::number(i % step) << endl;
+
}
}
-
-
-
-
-
- } // END OF EXPORT OF GENERAL ADIF
-
-
- out << " " << endl;
- i++;
-
- if (( (i % step ) == 0) )
- { // To update the speed I will only show the progress once each X QSOs
- //qDebug() << "FileManager::adifLogExport: MOD 0 - i = " << QString::number(i) << endl;
-
- aux = tr("Exporting ADIF file...") + "\n" + tr(" QSO: ") + QString::number(i) + "/" + QString::number(numberOfQsos);
- progress.setLabelText(aux);
- progress.setValue(i);
- }
- } // END of if (query.isValid())
- //qDebug() << "FileManager::adifLogExport: End Of Valid" << endl;
- if ( progress.wasCanceled() )
- {
- QMessageBox msgBox;
- msgBox.setWindowTitle(tr("KLog - User cancelled"));
- QString aux = QString(tr("You have canceled the file export. The file will be removed and no data will be exported.") + "\n" + tr("Do you still want to cancel?"));
- msgBox.setText(aux);
- msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- msgBox.setDefaultButton(QMessageBox::No);
- int ret = msgBox.exec();
- switch (ret)
- {
- case QMessageBox::Yes:
- // Yes was clicked
- // finishExport = true;
- qsos.clear();
- return qsos;
- case QMessageBox::No:
- // No Save was clicked
- break;
- default:
- // should never be reached
- break;
}
}
- } // END OF WHOLE
+ //qDebug() << "FileManager::adifLoTWLogExport: End Of Valid" << endl;
+ }
- //qDebug() << "FileManager::adifLogExport: End: " << QString::number(qsos.count()) << endl;
+ //qDebug() << "FileManager::adifLoTWLogExport: End of While " << endl;
- return qsos;
+ return i;
}
bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN, bool justMarked, bool _qslRequested , bool _lotw)
{
- //adifLogExportToFile(const QString& _fileName, const int _logN=0, bool justMarked = false, bool _qslRequested = false, bool _lotw=false);
// If _logN = 0, then we will export ALL the logs.
//qDebug() << "FileManager::adifLogExportToFile: " << _fileName << endl;
@@ -2017,7 +535,7 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
{
}
}
- //qDebug() << "FileManager::adifLogExportToFile - numberOfQsos = " << QString::number(numberOfQsos)<< endl;
+ //qDebug() << "FileManager::adifLogExportToFile - numberOfQsos = " << QString::number(numberOfQsos)<< endl;
}
else
{
@@ -2041,10 +559,10 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
{
numberOfQsos = (query1.value(0)).toInt();
}
- //qDebug() << "FileManager::adifLogExportToFile - numberOfQsos = " << QString::number(numberOfQsos)<< endl;
+ //qDebug() << "FileManager::adifLogExportToFile - numberOfQsos = " << QString::number(numberOfQsos)<< endl;
}
- //qDebug() << "FileManager::adifLogExportToFile END - numberOfQsos = " << QString::number(numberOfQsos) << endl;
+ //qDebug() << "FileManager::adifLogExportToFile END - numberOfQsos = " << QString::number(numberOfQsos) << endl;
step = util->getProgresStepForDialog(numberOfQsos);
//step = getProgresStepForDialog(numberOfQsos);
@@ -2052,7 +570,7 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
progress.setMaximum(numberOfQsos);
progress.setWindowModality(Qt::ApplicationModal);
- out << "ADIF v3.0.7 Export from KLog\nhttps://www.klog.xyz/klog\n" << klogVersion << "\nKLOG" << endl;
+ out << "ADIF v3.0.7 Export from KLog\nhttp://www.klog.xyz/klog\n" << klogVersion << "\nKLOG" << endl;
out << "" << QString::number(numberOfQsos) << endl;
QDateTime dateTime = (QDateTime::currentDateTime()).toUTC();
@@ -2082,7 +600,7 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
QSqlRecord rec = query.record();
- //qDebug() << "FileManager::adifLogExportToFile - before the While" << endl;
+ //qDebug() << "FileManager::adifLogExportToFile - before the While" << endl;
while ( (query.next()) && (!noMoreQso) )
{
//marked = false;
@@ -2097,41 +615,18 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
aux1 = (query.value(nameCol)).toString();
if (aux1 == "X")
{
- //qDebug() << "FileManager::adifLogExportToFile: MARKED: " << aux1 << endl;
+ //qDebug() << "FileManager::adifLogExportToFile: MARKED: " << aux1 << endl;
currentQso++;
nameCol = rec.indexOf("call");
- aux1 = (query.value(nameCol)).toString(); aux1 = util->checkAndFixASCIIinADIF(aux1);
- //qDebug() << "FileManager::adifLogExportToFile: " << QString::number(nameCol) << "/" << aux1 << endl;
- if (util->isValidCall(aux1))
- //if (aux1.length()>0)
+ aux1 = (query.value(nameCol)).toString();
+
+ aux1 = util->checkAndFixASCIIinADIF(aux1);
+ //qDebug() << "FileManager::adifLogExportToFile: " << QString::number(nameCol) << "/" << aux1 << endl;
+ if (aux1.length()>0)
{
- out << "" << aux1 << " ";
- }
- else
- {
- QMessageBox msgBox;
- msgBox.setIcon(QMessageBox::Warning);
- msgBox.setWindowTitle(tr("KLog - Invalid call detected"));
- QString aux = QString(tr("An invalid callsign has been detected %1. Do you want to export this callsign anyway (click on Yes) or remove the call from the exported log file?").arg(aux1));
- msgBox.setText(aux);
- msgBox.setInformativeText(tr("Exporting wrong calls may create problems in the applications you are potentially importing this logfile to. It may, however, be a good callsign that is wrongly identified by KLog as not valid. You can, however, edit the ADIF file once the export process is finished."));
- msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
- msgBox.setDefaultButton(QMessageBox::No);
- int ret = msgBox.exec();
- switch (ret) {
- case QMessageBox::Yes:
- // Yes was clicked
- out << "" << aux1 << " ";
- break;
- case QMessageBox::No:
- // No Save was clicked
- break;
- default:
- // should never be reached
- break;
- }
+ out << "" << aux1<< " ";
}
nameCol = rec.indexOf("qso_date");
@@ -2164,7 +659,7 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
nameCol = rec.indexOf("time_on");
aux1 = (query.value(nameCol)).toString();
aux1 = util->checkAndFixASCIIinADIF(aux1);
- //qDebug() << "FileManager::adifLogExportToFile-time_on: " << aux1 << endl;
+ //qDebug() << "FileManager::adifLogExportToFile-time_on: " << aux1 << endl;
if ( ((aux1.length()) == 5) || ((aux1.length()) == 8) ){
aux1.remove(QChar(':'), Qt::CaseInsensitive);
@@ -2175,22 +670,22 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
nameCol = rec.indexOf("time_off");
aux1 = (query.value(nameCol)).toString();
aux1 = util->checkAndFixASCIIinADIF(aux1);
- //qDebug() << "FileManager::adifLogExportToFile: time_off-682" << QString::number(nameCol) << "/" << aux1 << endl;
+ //qDebug() << "FileManager::adifLogExportToFile: time_off-682" << QString::number(nameCol) << "/" << aux1 << endl;
if ( ((aux1.length()) == 5) || ((aux1.length()) == 8) ){
aux1.remove(QChar(':'), Qt::CaseInsensitive);
out << "" << aux1 << " ";
- //qDebug() << "FileManager::adifLogExportToFile: time_off exported-682" << endl;
+ //qDebug() << "FileManager::adifLogExportToFile: time_off exported-682" << endl;
}
nameCol = rec.indexOf("bandid");
aux1 = (query.value(nameCol)).toString();
- //qDebug() << "FileManager::adifLogExportToFile: bandid1: " << aux1 << endl;
+ //qDebug() << "FileManager::adifLogExportToFile: bandid1: " << aux1 << endl;
aux1 = util->checkAndFixASCIIinADIF(aux1);
- //qDebug() << "FileManager::adifLogExportToFile: bandid2: " << aux1 << endl;
+ //qDebug() << "FileManager::adifLogExportToFile: bandid2: " << aux1 << endl;
aux1 = dataProxy->getNameFromBandId(aux1.toInt());
//aux1 = db->getBandNameFromID2(aux1.toInt());
- //qDebug() << "FileManager::adifLogExportToFile: bandid3: " << aux1 << endl;
+ //qDebug() << "FileManager::adifLogExportToFile: bandid3: " << aux1 << endl;
if (dataProxy->getIdFromBandName(aux1)>=0)
{
@@ -2219,8 +714,8 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
aux1 = dataProxy->getNameFromModeId(aux1.toInt());
//aux1 = db->getModeNameFromID2(aux1.toInt());
- //qDebug() << "FileManager::adifLogExportToFile - MODE aux2: " << aux2 << endl;
- //qDebug() << "FileManager::adifLogExportToFile - MODE aux1: " << aux1 << endl;
+ //qDebug() << "FileManager::adifLogExportToFile - MODE aux2: " << aux2 << endl;
+ //qDebug() << "FileManager::adifLogExportToFile - MODE aux1: " << aux1 << endl;
if ((aux1.length()>1) && (dataProxy->getIdFromModeName(aux1)>=0))
{
@@ -2258,7 +753,7 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
if ((aux1.length())>0){
out << "" << aux1 << " ";
}
- //qDebug() << "FileManager::adifLogExportToFile - 100" << endl;
+ //qDebug() << "FileManager::adifLogExportToFile - 100" << endl;
nameCol = rec.indexOf("cqz");
aux1 = (query.value(nameCol)).toString(); aux1 = util->checkAndFixASCIIinADIF(aux1);
if ( ((aux1.length())>0) && (0 < aux1.toInt()) && (aux1.toInt() < CQZones+1) ){
@@ -2271,15 +766,15 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
out << "" << aux1 << " ";
}
- //qDebug() << "FileManager::adifLogExportToFile: DXCC - Now..." << endl;
+ //qDebug() << "FileManager::adifLogExportToFile: DXCC - Now..." << endl;
nameCol = rec.indexOf("dxcc");
aux1 = (query.value(nameCol)).toString(); aux1 = util->checkAndFixASCIIinADIF(aux1);
if ((aux1.length())>0){
out << "" << aux1 << " ";
- //qDebug() << "FileManager::adifLogExportToFile: DXCC " << aux1 << endl;
+ //qDebug() << "FileManager::adifLogExportToFile: DXCC " << aux1 << endl;
}
- //qDebug() << "FileManager::adifLogExportToFile: DXCC - Exported!" << endl;
+ //qDebug() << "FileManager::adifLogExportToFile: DXCC - Exported!" << endl;
nameCol = rec.indexOf("address");
aux1 = (query.value(nameCol)).toString(); aux1 = util->checkAndFixASCIIinADIF(aux1);
@@ -2304,7 +799,7 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
if ((aux1.length())>0){
out << "" << aux1 << " ";
}
- //qDebug() << "FileManager::adifLogExportToFile - 200" << endl;
+ //qDebug() << "FileManager::adifLogExportToFile - 200" << endl;
nameCol = rec.indexOf("a_index");
aux1 = (query.value(nameCol)).toString(); aux1 = util->checkAndFixASCIIinADIF(aux1);
if ((aux1.length())>0){
@@ -2340,7 +835,7 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
if ((aux1.length())>0){
out << "" << aux1 << " ";
}
- //qDebug() << "FileManager::adifLogExportToFile - 30" << endl;
+ //qDebug() << "FileManager::adifLogExportToFile - 30" << endl;
nameCol = rec.indexOf("class");
aux1 = (query.value(nameCol)).toString(); aux1 = util->checkAndFixASCIIinADIF(aux1);
if ((aux1.length())>0){
@@ -2355,8 +850,7 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
nameCol = rec.indexOf("contacted_op");
aux1 = (query.value(nameCol)).toString(); aux1 = util->checkAndFixASCIIinADIF(aux1);
- if (util->isValidCall(aux1))
- {
+ if ((aux1.length())>0){
out << "" << aux1 << " ";
}
@@ -2377,7 +871,7 @@ bool FileManager::adifLogExportToFile(const QString& _fileName, const int _logN,
if ((aux1.length())>0){
out << "