New way to check the test branch.

This commit is contained in:
Roman Telezhynskyi 2020-10-24 11:57:56 +03:00
parent eaf87cc4a1
commit ad4b9cbb6b
2 changed files with 4 additions and 39 deletions

View File

@ -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;

View File

@ -44,7 +44,6 @@ public:
static FvUpdater* sharedUpdater();
static void drop();
static QString CurrentFeedURL();
static int CurrentVersion();
static bool IsTestBuild();
// Set / get feed URL