Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ea4k/klog
Browse files Browse the repository at this point in the history
  • Loading branch information
d authored and d committed Mar 7, 2024
2 parents c137871 + 2338c1d commit 456f52b
Show file tree
Hide file tree
Showing 31 changed files with 500 additions and 275 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: C/C++ CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: apt update
run: sudo apt-get update
- name: Install dependencies
run: sudo apt install -y --fix-missing make qmake6 qt6-base-dev qt6-declarative-dev libhamlib-dev build-essential libgl1-mesa-dev qt6-serialport-dev qt6-positioning-dev qt6-charts-dev qt6-l10n-tool
- name: qmake
run: qmake6 src.pro
- name: make
run: make
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ src/object_*
.DS_Store
KLog.app
*.qm

.qtc_clangd
*.autosave
*.sh~
*.dmg
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<img src="https://img.shields.io/github/v/release/ea4k/klog?logo=github&logoColor=white" alt="GitHub release"/>
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
<a href="https://twitter.com/_ea4k"><img src="https://img.shields.io/twitter/follow/_ea4k.svg?style=social&label=Follow" alt="Twitter Follow"/></a>
[![](https://tokei.rs/b1/github/ea4k/klog)](https://github.com/ea4k/klog).
[![Total alerts](https://img.shields.io/lgtm/alerts/g/ea4k/klog.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ea4k/klog/alerts/)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/ea4k/klog.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/ea4k/klog/context:cpp)
[![Build status](https://ci.appveyor.com/api/projects/status/4hfa3npj88v2reqs/branch/master?svg=true)](https://ci.appveyor.com/project/ea4k/klog/branch/master)
[![Coverity Scan Build Status](https://scan.coverity.com/projects/23857/badge.svg)](https://scan.coverity.com/projects/ea4k-klog)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5879/badge)](https://bestpractices.coreinfrastructure.org/projects/5879)
Expand Down
39 changes: 14 additions & 25 deletions src/INSTALL-linux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Follow these steps to build KLog.
KLog requires Qt5 to be built.

Currently, many distributions are still distributing Qt4 as a default Qt
version so it may be needed that you install Qt5 to be able to build KLog in
version so it may be needed that you install Qt6 to be able to build KLog in
your system.

install may depend on your distribution, however, check for similar names &
Expand All @@ -18,12 +18,12 @@ details in the AUTHORS file).
There are dependencies to build KLog and dependencies to run KLog.

The dependencies to build KLog are:
- g++, make, qt5-qmake, qtbase5-dev, qttools5-dev, libqt5charts5-dev, libqt5sql5-sqlite, libqt5serialport5-dev, qtdeclarative5-dev, qtpositioning5-dev & libhamlib-dev packages
- make qmake6 qt6-base-dev qt6-declarative-dev libhamlib-dev build-essential libgl1-mesa-dev qt6-serialport-dev qt6-positioning-dev qt6-charts-dev qt6-l10n-tools

In Debian it is done with:
apt-get install g++ make qt5-qmake qtbase5-dev qttools5-dev libqt5charts5-dev libqt5sql5-sqlite libhamlib++-dev libqt5serialport5-dev qtdeclarative5-dev qtpositioning5-dev
apt install -y --fix-missing make qmake6 qt6-base-dev qt6-declarative-dev libhamlib-dev build-essential libgl1-mesa-dev qt6-serialport-dev qt6-positioning-dev qt6-charts-dev qt6-l10n-tools

The dependencies to run KLog once installed are:
*** TO BE UPDATED: The dependencies to run KLog once installed are:
- libqt5sql5-sqlite, qml-module-qtquick-window2, qml-module-qtlocation, qml-module-qtpositioning, qml-module-qtquick2 & qml-module-qtquick-controls2

Again in Debian, it is done with:
Expand All @@ -35,28 +35,17 @@ If your are using the Debian KLog package the dependencies to run KLog will be a
In your distribution, you should know how to install new packages :-)


Make sure you have qt5 available. You can do it with the qtchooser command.
Make sure you have qt6 available. You can do it with the qtchooser command.
The output should be something like:

user@debian:~$ qtchooser -l
4
5
default
qt4-i386-linux-gnu
qt4
qt5-i386-linux-gnu
qt5
user@debian:~$
user@debian:~$ qmake6 -v
QMake version 3.1
Using Qt version 6.4.2 in /usr/lib/x86_64-linux-gnu

If Qt is not at least Qt6, check your instalallation as one of the previous packages may be missing.

It should return the list of qt versions available, qt5 must be one of them.
If qt5 is still not there, check your instalallation as one of the previous packages may be missing.

2.- Select the appropriate Qt version (Qt5)

export QT_SELECT=qt5

3.- Untar klog
2.- Untar klog

tar xvzf klog-version.tar.gz

Expand All @@ -65,18 +54,18 @@ If qt5 is still not there, check your instalallation as one of the previous pack
cd klog-version


4.- Generate the Makefile
3.- Generate the Makefile

cd src
qmake PREFIX=/usr/local src.pro
qmake6 PREFIX=/usr/local src.pro

5. Make everything.
4. Make everything.

make

If everything goes OK, you should have the klog executable in the folder.

6.- To install KLog, execute the following from the root account.
5.- To install KLog, execute the following from the root account.

make install

Expand Down
23 changes: 21 additions & 2 deletions src/TODO
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*========== START Qt6 migration:
**
void tst_MainWindow::test_focusOrder()
Test: //QApplication::setActiveWindow(mainWindow);
I had to replace previews line.

**
void DataBase::compress()
qsqldatabase::exec is deprecated

**
void eLogQrzLog::parseXMLAnswer(QXmlStreamReader &xml)
{ // Next line was commented out as it returns q QStringView instead of a QString
//showDebugLog (Q_FUNC_INFO, QString("Start: " + xml.text()));

=============== END of Qt6 migration



BUG: KLog needs to update the Entity DB is shown on every start

KLog should update ALWAYS when receiving from LoTW the QSL_LOTW_rcvd or add the QSO if not in local log.
Expand Down Expand Up @@ -306,7 +325,7 @@ Mode U
Mode U/V -> B
</SATELLITE SUPPORT>

TODO: Code a way to sort the bands/modes in the "setuppagebandsmodes.cpp
TODO: Code a way to sort the bands/modes in the setuppagebandsmodes.cpp

TODO: Create an "updateKLog" class to manage all the release updates
so there is a way to detect the version of KLog and upgrade the DB to the latest.
Expand Down Expand Up @@ -415,4 +434,4 @@ DONE: TODO: DXCluster: Connect, disconnect and connect again does not work
DONE: TODO: Add a field in Mainwindow to manage RX_PWR
DONE: TODO: slotclearbuttons->Colors to default
DONE: GUI: Add in the input box a combobox to change the DXCC

*/
24 changes: 12 additions & 12 deletions src/awards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ Awards::Awards(DataProxy_SQLite *dp, const QString &_parentFunction)
util = new Utilities(Q_FUNC_INFO);
//world->create();
/*
newOneColor.setNamedColor("#ff0000");
neededColor.setNamedColor("#ff8c00");
workedColor.setNamedColor("#ffd700");
confirmedColor.setNamedColor("#32cd32");
defaultColor.setNamedColor("#00bfff");
newOneColor.fromString("#ff0000");
neededColor.fromString("#ff8c00");
workedColor.fromString("#ffd700");
confirmedColor.fromString("#32cd32");
defaultColor.fromString("#00bfff");
*/
//"Awards::setColors: " << _newOne << "/" << _needed << "/" << _worked << "/" << _confirmed << "/" << _default;
//Awards::setColors: "#ff0000" / "#ff8c00" / "#ffd700" / "#32cd32" / "#00bfff"
Expand Down Expand Up @@ -1146,27 +1146,27 @@ void Awards::setColors (const QString &_newOne, const QString &_needed, const QS

if (defaultColor.isValid())
{
defaultColor.setNamedColor(_default.toUpper());
defaultColor.fromString(_default.toUpper());
}

if (neededColor.isValid())
{
neededColor.setNamedColor(_needed.toUpper());
neededColor.fromString(_needed.toUpper());
}

if (confirmedColor.isValid())
{
confirmedColor.setNamedColor(_confirmed.toUpper());
confirmedColor.fromString(_confirmed.toUpper());
}

if (newOneColor.isValid())
{
newOneColor.setNamedColor(_newOne.toUpper());
newOneColor.fromString(_newOne.toUpper());
}

if (workedColor.isValid())
{
workedColor.setNamedColor(_worked.toUpper());
workedColor.fromString(_worked.toUpper());
}
}

Expand All @@ -1183,11 +1183,11 @@ void Awards::recalculateAwards()
Should go in a transaction
*/

//qDebug() << "Awards::recalculateAwards";
qDebug() << Q_FUNC_INFO;
dataProxy->updateAwardDXCC();
emit awardDXCCUpdated();
dataProxy->updateAwardWAZ();
//qDebug() << "Awards::recalculateAwards - END";
qDebug() << Q_FUNC_INFO << " - END";
}

int Awards::getQSOsInLog(const int _logNumber)
Expand Down
2 changes: 1 addition & 1 deletion src/charts/statsfieldperbandwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void StatsFieldPerBandWidget::createUI()
layout->addWidget(tableWidget);
setLayout(layout);

connect(modeComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(slotModeComboBoxChanged() ) ) ;
connect(modeComboBox, SIGNAL(currentTextChanged(QString)), this, SLOT(slotModeComboBoxChanged() ) ) ;

}

Expand Down
18 changes: 9 additions & 9 deletions src/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ void DataBase::compress()
}
else
{
db.exec("VACUUM;");
QSqlQuery query("VACUUM;");
query.exec("VACUUM;");
}
logEvent(Q_FUNC_INFO, "END", Debug);
}
Expand Down Expand Up @@ -3708,7 +3709,7 @@ bool DataBase::updateModeIdFromSubModeId()
int qsos;
int i = 0;
QString aux;
QSqlQuery query, query2;
QSqlQuery query;
bool sqlOk = query.exec("SELECT COUNT (*) FROM log");

if (sqlOk)
Expand Down Expand Up @@ -3763,6 +3764,7 @@ bool DataBase::updateModeIdFromSubModeId()
//TODO The following query can be executed in: getModeIdFromSubMode()

sq = QString("SELECT id FROM modetemp WHERE submode='%1'").arg(modetxt); // STEP-3
QSqlQuery query2;
sqlOk2 = query2.exec(sq);

if (sqlOk2)
Expand All @@ -3784,7 +3786,7 @@ bool DataBase::updateModeIdFromSubModeId()
else
{
//queryErrorManagement(Q_FUNC_INFO, query3.lastError().databaseText(), query3.lastError().nativeErrorCode(), query3.lastQuery());
//qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-4) ID: " << QString::number(id) << " NOT updated-2" ;
//qDebug() << "DataBase::updateModeIdFromSubModeId: (STEP-4) ID: " << QString::number(id) << " NOT updated-2" ;
}
}
else
Expand Down Expand Up @@ -3845,9 +3847,7 @@ bool DataBase::updateModeIdFromSubModeId()
query.finish();
return false;
}

//qDebug() << "DataBase::updateModeIdFromSubModeId: END" ;

query.finish();
return true;
}
Expand Down Expand Up @@ -3882,7 +3882,7 @@ bool DataBase::updateBandIdTableLogToNewOnes()
int qsos;
int i = 0;
QString aux;
QSqlQuery query, query2;
QSqlQuery query;
bool sqlOk = query.exec("SELECT COUNT (*) FROM log");

if (sqlOk)
Expand Down Expand Up @@ -3931,7 +3931,7 @@ bool DataBase::updateBandIdTableLogToNewOnes()
bandtxt = getBandNameFromNumber(bandFound);

//qDebug() << "DataBase::updateBandIdTableLogToNewOnes: band found: " << bandtxt ;

QSqlQuery query2;
sq = QString("SELECT id FROM bandtemp WHERE name='%1'").arg(bandtxt);
sqlOk2 = query2.exec(sq);

Expand Down Expand Up @@ -6613,7 +6613,7 @@ bool DataBase::updateAwardDXCCTable()
if (!sqlOK)
{
//qDebug() << "DataBase::updateAwardDXCCTable: Error: " << QString::number(query.lastError().nativeErrorCode()) ;
if (query.lastError().nativeErrorCode() == 19)
if ((query.lastError().nativeErrorCode()).toInt() == 19)
{ // DUPLICATED RECORD: Means that there is already a record in the award... so this set is worked. QSL can be Y or N in the award but inthe log may be other options
// We should only take into account if N or Y
if (dxccStatusList.at(j).status!="1")
Expand Down Expand Up @@ -6843,7 +6843,7 @@ bool DataBase::updateAwardWAZTable()
if (!sqlOK)
{
//qDebug() << "DataBase::updateAwardWAZTable: Error: " << QString::number(query.lastError().nativeErrorCode()) ;
if (query.lastError().nativeErrorCode() == 19)
if (query.lastError().nativeErrorCode().toInt() == 19)
{ // DUPLICATED RECORD: Means that there is already a record in the award... so this set is worked. QSL can be Y or N in the award but inthe log may be other options
// We should only take into account if N or Y
if (dxccStatusList.at(j).status!="1")
Expand Down
Loading

0 comments on commit 456f52b

Please sign in to comment.