2014-04-06 07:29:37 +05:30
|
|
|
#include "BuildConfig.h"
|
2015-03-25 03:10:49 +05:30
|
|
|
#include <QObject>
|
2014-04-06 02:28:47 +05:30
|
|
|
|
|
|
|
Config BuildConfig;
|
|
|
|
|
|
|
|
Config::Config()
|
|
|
|
{
|
|
|
|
// Version information
|
2015-12-28 09:15:49 +05:30
|
|
|
VERSION_MAJOR = @MultiMC_VERSION_MAJOR@;
|
2014-04-06 02:28:47 +05:30
|
|
|
VERSION_MINOR = @MultiMC_VERSION_MINOR@;
|
|
|
|
VERSION_HOTFIX = @MultiMC_VERSION_HOTFIX@;
|
|
|
|
VERSION_BUILD = @MultiMC_VERSION_BUILD@;
|
2015-03-25 03:10:49 +05:30
|
|
|
|
2014-04-06 02:28:47 +05:30
|
|
|
BUILD_PLATFORM = "@MultiMC_BUILD_PLATFORM@";
|
|
|
|
CHANLIST_URL = "@MultiMC_CHANLIST_URL@";
|
2016-11-21 01:10:59 +05:30
|
|
|
ANALYTICS_ID = "@MultiMC_ANALYTICS_ID@";
|
2014-04-06 02:28:47 +05:30
|
|
|
NOTIFICATION_URL = "@MultiMC_NOTIFICATION_URL@";
|
|
|
|
FULL_VERSION_STR = "@MultiMC_VERSION_MAJOR@.@MultiMC_VERSION_MINOR@.@MultiMC_VERSION_BUILD@";
|
|
|
|
|
|
|
|
GIT_COMMIT = "@MultiMC_GIT_COMMIT@";
|
2015-12-28 09:15:49 +05:30
|
|
|
GIT_REFSPEC = "@MultiMC_GIT_REFSPEC@";
|
|
|
|
if(GIT_REFSPEC.startsWith("refs/heads/") && !CHANLIST_URL.isEmpty() && VERSION_BUILD >= 0)
|
|
|
|
{
|
|
|
|
VERSION_CHANNEL = GIT_REFSPEC;
|
|
|
|
VERSION_CHANNEL.remove("refs/heads/");
|
|
|
|
UPDATER_ENABLED = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
VERSION_CHANNEL = QObject::tr("custom");
|
|
|
|
}
|
|
|
|
|
2014-04-06 02:28:47 +05:30
|
|
|
VERSION_STR = "@MultiMC_VERSION_STRING@";
|
|
|
|
NEWS_RSS_URL = "@MultiMC_NEWS_RSS_URL@";
|
2015-10-02 03:42:53 +05:30
|
|
|
PASTE_EE_KEY = "@MultiMC_PASTE_EE_API_KEY@";
|
2016-04-07 02:39:30 +05:30
|
|
|
WONKO_ROOT_URL = "@MultiMC_WONKO_ROOT_URL@";
|
2014-04-06 02:28:47 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
QString Config::printableVersionString() const
|
|
|
|
{
|
2017-01-15 00:14:34 +05:30
|
|
|
QString vstr = QString("%1.%2.%3").arg(QString::number(VERSION_MAJOR), QString::number(VERSION_MINOR), QString::number(VERSION_HOTFIX));
|
2015-12-28 09:15:49 +05:30
|
|
|
|
|
|
|
// If the build is not a main release, append the channel
|
|
|
|
if(VERSION_CHANNEL != "stable")
|
2015-03-25 03:10:49 +05:30
|
|
|
{
|
2015-12-28 09:15:49 +05:30
|
|
|
vstr += "-" + VERSION_CHANNEL;
|
2015-03-25 03:10:49 +05:30
|
|
|
}
|
2015-12-28 09:15:49 +05:30
|
|
|
|
|
|
|
// if a build number is set, also add it to the end
|
|
|
|
if(VERSION_BUILD >= 0)
|
2015-03-25 03:10:49 +05:30
|
|
|
{
|
2015-12-28 09:15:49 +05:30
|
|
|
vstr += "-" + QString::number(VERSION_BUILD);
|
2015-03-25 03:10:49 +05:30
|
|
|
}
|
2014-04-06 02:28:47 +05:30
|
|
|
return vstr;
|
|
|
|
}
|