Skip to content

Commit

Permalink
Bugfix call/MM is now from the call entity
Browse files Browse the repository at this point in the history
  • Loading branch information
ea4k committed Sep 2, 2022
1 parent c29f85e commit 1cca0dc
Show file tree
Hide file tree
Showing 14 changed files with 5,076 additions and 5,052 deletions.
1 change: 1 addition & 0 deletions src/Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Aug 2022 - 2.2.1
- Bugfix: Temporary bugfix for Setup eLog Page preventing crash on start. (Closes #489)
- Bugfix: Temporary quick fix to prevent call validation in some classes that may cause errors. (Opens #490)
- Bugfix: Config for real time for clublog was not properly managed.
- Bugfix: Calls like EA4K/MM were identified like Scotland, not maritime.
- Improvement: Code improvement in the Setup of eLogs.
- Tests: Tests for SetupPageElog added.

Expand Down
918 changes: 459 additions & 459 deletions src/translations/klog_ca.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_cs.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_da.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_de.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_es.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_fi.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_fr.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_hr.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_it.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_ja.ts

Large diffs are not rendered by default.

918 changes: 459 additions & 459 deletions src/translations/klog_pl.ts

Large diffs are not rendered by default.

17 changes: 14 additions & 3 deletions src/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,8 @@ QString Utilities::getMainCallFromComplexCall(const QString &_complexCall)
{ // Return the part of the call that provides entity and prefix information:
// EA4K/F => F
// VK9/EA4K => VK9
// EA4K/MM => EA4K
// MM/EA4K => MM

QString call = _complexCall;
if (call.length() == 1)
Expand All @@ -839,7 +841,7 @@ QString Utilities::getMainCallFromComplexCall(const QString &_complexCall)
//qDebug() << Q_FUNC_INFO << ": " << _complexCall;
if (call.count('/') >1)
{ //Things like F/EA4K/P will become F/EA4K
//logEvent (Q_FUNC_INFO, QString("With 2 /"), Debug);
//logEvent (Q_FUNC_INFO, QString("With 2 /"), Debug);
call = call.section("/", 0,1);
}
//qDebug() << Q_FUNC_INFO << ": First cut: " << call;
Expand All @@ -855,8 +857,17 @@ QString Utilities::getMainCallFromComplexCall(const QString &_complexCall)
QString first = parts.at(0);
QString second = parts.at(1);
// First identify normal suffixes /P, /1, /QRP...
bool firstCountry = !isAValidOperatingSuffix(first);
bool firstCountry = !isAValidOperatingSuffix(first);
bool secondCountry = !isAValidOperatingSuffix(second);
//qDebug() << QString("First = %1, Second = %2").arg(boolToQString(firstCountry)).arg(boolToQString(secondCountry));
if (!firstCountry)
{
if ((parts.at(0)) == "MM")
{ // Special case for Scotland EA4K/MM colliding as maritime movil
// Scotland requires the prefix first like in MM/EA4K
firstCountry=true;
}
}
//qDebug() << Q_FUNC_INFO << " - 020" ;
if (firstCountry && secondCountry)
{ // EA4K/VK9M
Expand Down Expand Up @@ -893,7 +904,7 @@ QString Utilities::getMainCallFromComplexCall(const QString &_complexCall)
}
else if (isAValidOperatingSuffix(second))
{// EA4K/2
call = second;
call = first;
}
else
{ // None is a normal country prefix
Expand Down
12 changes: 12 additions & 0 deletions tests/tst_utilities/tst_utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private slots:
void test_logLevels();
void test_isValidSimpleCall();
void test_getPrefixFromCall();
void test_getMainCallFromComplexCall();

private:
Utilities *util;
Expand Down Expand Up @@ -441,6 +442,17 @@ void tst_Utilities::test_isValidSimpleCall()
QVERIFY2(!util->isValidSimpleCall("XXXX"), "XXXX");
}

void tst_Utilities::test_getMainCallFromComplexCall()
{
QVERIFY2(util->getMainCallFromComplexCall("EA4K")=="EA4K", "EA4K");
QVERIFY2(util->getMainCallFromComplexCall("EA4K/P")=="EA4K", "EA4K/P");
QVERIFY2(util->getMainCallFromComplexCall("EA4K/MM")=="EA4K", "EA4K/MM");
QVERIFY2(util->getMainCallFromComplexCall("MM/EA4K")=="MM", "MM/EA4K");
QVERIFY2(util->getMainCallFromComplexCall("EA4K/F")=="F", "EA4K/F");
QVERIFY2(util->getMainCallFromComplexCall("EA4K/1")=="EA4K", "EA4K/1");
QVERIFY2(util->getMainCallFromComplexCall("VK9/EA4K")=="VK9", "VK9/EA4K");
}


QTEST_APPLESS_MAIN(tst_Utilities)

Expand Down

0 comments on commit 1cca0dc

Please sign in to comment.