Skip to content

Commit

Permalink
Still some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ea4k committed Dec 29, 2024
1 parent b6921ab commit 7353352
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 30 deletions.
8 changes: 4 additions & 4 deletions src/callsign.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ class Callsign : public QObject
void clear();

private:
static QString callsignRegExString();
static QRegularExpression callsignRegEx();
static QString prefixRegExString();
static QRegularExpression prefixRegEx();
static QString callsignRegExString();
static QRegularExpression callsignRegEx();
static QString prefixRegExString();
static QRegularExpression prefixRegEx();

QString fullCall; // K1/EA4K/QRP
QString hostFullPrefix; // K1
Expand Down
49 changes: 23 additions & 26 deletions src/qso.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "qso.h"
#include "QtSql/qsqlerror.h"
#include "qsqlrecord.h"
#include "callsign.h"

QSO::QSO()
{
Expand Down Expand Up @@ -716,17 +717,13 @@ bool QSO::isValid()
bool QSO::setCall(const QString &_c)
{
logEvent (Q_FUNC_INFO, QString("Start: %1").arg(_c), Debug);
QString aux;
aux = _c.toUpper();
if ((aux.isNull()) || (aux.length()<3))
{
logEvent(Q_FUNC_INFO, "END - False-1", Debug);
return false;
}
if (util->isValidCall(aux))

Callsign _callsign (_c);
if (_callsign.isValid())
//if (util->isValidCall(aux))
{
logEvent (Q_FUNC_INFO, QString("END - true"), Debug);
callsign = aux;
callsign = _callsign.getCallsign();
haveCall = true;
return true;
}
Expand Down Expand Up @@ -1751,14 +1748,12 @@ bool QSO::setOperatorCallsign(const QString &_c)
{
//qDebug() << Q_FUNC_INFO << "Start: " << _c;
//logEvent(Q_FUNC_INFO, "Start", Debug);
QString aux = _c;
if (aux.length()<3)
return false;


if (util->isValidCall(aux))
Callsign _callsign (_c);
if (_callsign.isValid())
//if (util->isValidCall(aux))
{
operatorCall = aux;
operatorCall = _callsign.getCallsign();
//qDebug() << Q_FUNC_INFO << "END - true";
logEvent(Q_FUNC_INFO, "END-true", Debug);
return true;
Expand All @@ -1779,18 +1774,14 @@ QString QSO::getOperatorCallsign()
bool QSO::setStationCallsign(const QString &_c)
{
//qDebug() << Q_FUNC_INFO << "Start: " << _c;
QString aux = _c;
if ((aux.length()<3) || (aux.isNull()))
{
//qDebug() << Q_FUNC_INFO << " - 009";
return false;
}

Callsign _callsign (_c);
if (_callsign.isValid())
//qDebug() << Q_FUNC_INFO << " - 010";
if (util->isValidCall(aux))
//if (util->isValidCall(aux))
{
//qDebug() << Q_FUNC_INFO << " - True";
stationCallsign = aux;
stationCallsign = _callsign.getCallsign();
return true;
}
else
Expand Down Expand Up @@ -2046,7 +2037,9 @@ double QSO::getDistance()

bool QSO::setOwnerCallsign(const QString &_c)
{
if (util->isValidCall(_c))
Callsign _callsign (_c);
if (_callsign.isValid())
//if (util->isValidCall(_c))
{
ownerCall = _c;
return true;
Expand All @@ -2063,7 +2056,9 @@ QString QSO::getOwnerCallsign()

bool QSO::setEQ_Call(const QString &_c)
{
if (util->isValidCall(_c))
Callsign _callsign (_c);
if (_callsign.isValid())
//if (util->isValidCall(_c))
{
contacted_owner = _c;
return true;
Expand Down Expand Up @@ -2263,7 +2258,9 @@ QString QSO::getCounty()

bool QSO::setContactedOperator(const QString &_c)
{
if (util->isValidCall(_c))
Callsign _callsign (_c);
if (_callsign.isValid())
//if (util->isValidCall(_c))
{
contacted_op = _c;
return true;
Expand Down
1 change: 1 addition & 0 deletions src/qso.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
//#include <QDebug>
#include "global.h"
#include "utilities.h"
#include "callsign.h"
#include "klogdefinitions.h"
#include "adif.h"
//#include "database.h"
Expand Down
1 change: 1 addition & 0 deletions tests/tst_qso/tst_qso.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <QtTest>

#include "../../src/qso.h"
#include "../../src/callsign.h"
#include "../../src/klogdefinitions.h"


Expand Down
2 changes: 2 additions & 0 deletions tests/tst_qso/tst_qso.pro
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ TEMPLATE = app

HEADERS += \
../../src/utilities.h \
../../src/callsign.h \
../../src/global.h \
../../src/klogdefinitions.h \
#../../src/dataproxy_sqlite.h \
Expand All @@ -19,6 +20,7 @@ HEADERS += \

SOURCES += tst_qso.cpp \
../../src/utilities.cpp \
../../src/callsign.cpp \
#../../src/dataproxy_sqlite.cpp \
#../../src/database.cpp \
../../src/locator.cpp \
Expand Down

0 comments on commit 7353352

Please sign in to comment.