From ad4b9cbb6babdba10b05a4b9a5084c4bbc5b103f Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 24 Oct 2020 11:57:56 +0300 Subject: [PATCH] New way to check the test branch. --- src/libs/fervor/fvupdater.cpp | 42 ++++------------------------------- src/libs/fervor/fvupdater.h | 1 - 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/src/libs/fervor/fvupdater.cpp b/src/libs/fervor/fvupdater.cpp index a5703b469..542b881e2 100644 --- a/src/libs/fervor/fvupdater.cpp +++ b/src/libs/fervor/fvupdater.cpp @@ -92,44 +92,10 @@ QString FvUpdater::CurrentFeedURL() return FvUpdater::IsTestBuild() ? *testFeedURL : *defaultFeedURL; } -//--------------------------------------------------------------------------------------------------------------------- -int FvUpdater::CurrentVersion() -{ -#ifdef Q_OS_MAC - const QString path = QCoreApplication::applicationDirPath() + QLatin1String("/../Resources/VERSION"); -#else - const QString path = QApplication::applicationDirPath() + QDir::separator() + QLatin1String("VERSION"); -#endif - - QFile file(path); - if (file.exists()) - { - if (not file.open(QIODevice::ReadOnly | QIODevice::Text)) - { - return APP_VERSION; - } - - QTextStream in(&file); - try - { - return VAbstractConverter::GetFormatVersion(in.read(15)); - } - catch(const VException &) - { - return APP_VERSION; - } - } - else - { - return APP_VERSION; - } -} - //--------------------------------------------------------------------------------------------------------------------- bool FvUpdater::IsTestBuild() { - const int version = FvUpdater::CurrentVersion(); - return (version != 0x0 && version != APP_VERSION); + return (MAJOR_VERSION * 1000 + MINOR_VERSION) % 2 != 0; } //--------------------------------------------------------------------------------------------------------------------- @@ -577,7 +543,7 @@ bool FvUpdater::VersionIsIgnored(const QString &version) return true; // Ignore invalid version } - if (decVersion == FvUpdater::CurrentVersion()) + if (decVersion == APP_VERSION) { return true; } @@ -592,7 +558,7 @@ bool FvUpdater::VersionIsIgnored(const QString &version) } } - if (decVersion > FvUpdater::CurrentVersion()) + if (decVersion > APP_VERSION) { // Newer version - do not skip return false; @@ -616,7 +582,7 @@ void FvUpdater::IgnoreVersion(const QString &version) return ; // Ignore invalid version } - if (decVersion == FvUpdater::CurrentVersion()) + if (decVersion == APP_VERSION) { // Don't ignore the current version return; diff --git a/src/libs/fervor/fvupdater.h b/src/libs/fervor/fvupdater.h index f02696a19..0cfa26385 100644 --- a/src/libs/fervor/fvupdater.h +++ b/src/libs/fervor/fvupdater.h @@ -44,7 +44,6 @@ public: static FvUpdater* sharedUpdater(); static void drop(); static QString CurrentFeedURL(); - static int CurrentVersion(); static bool IsTestBuild(); // Set / get feed URL