X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fglobal.cpp;h=8941d5b8d30e14e51ee12064ce2ae15761c3dac6;hp=9f0e224dee7249153abe827aa42045a68c03f1e9;hb=3982589b93aa14c3cede148b8a5158b63055d65c;hpb=2bcb925e42921b124efd19d1978ff19f44a09113 diff --git a/src/common/global.cpp b/src/common/global.cpp index 9f0e224d..8941d5b8 100644 --- a/src/common/global.cpp +++ b/src/common/global.cpp @@ -96,18 +96,37 @@ void Global::registerMetaTypes() { qRegisterMetaTypeStreamOperators("UserId"); qRegisterMetaTypeStreamOperators("AccountId"); qRegisterMetaTypeStreamOperators("MsgId"); +} + +//! This includes version.inc and possibly version.gen and sets up our version numbers. +void Global::setupVersion() { + +# include "version.inc" +# ifdef HAVE_VERSION_GEN +# include "version.gen" +# endif + if(quasselGeneratedVersion.isEmpty()) { + quasselVersion = QString("v%1 (unknown rev)").arg(quasselBaseVersion); + } else { + QStringList parts = quasselGeneratedVersion.split(':'); + quasselVersion = QString("v%1").arg(parts[0]); + if(parts.count() >= 2) quasselVersion.append(QString(" (%1)").arg(parts[1])); + } + quasselBuildDate = __DATE__; + quasselBuildTime = __TIME__; } // Static variables QString Global::quasselVersion; -QString Global::quasselDate; -uint Global::quasselBuild; -uint Global::clientBuildNeeded; -QString Global::clientVersionNeeded; -uint Global::coreBuildNeeded; -QString Global::coreVersionNeeded; +QString Global::quasselBaseVersion; +QString Global::quasselGeneratedVersion; +QString Global::quasselBuildDate; +QString Global::quasselBuildTime; +uint Global::protocolVersion; +uint Global::clientNeedsProtocol; +uint Global::coreNeedsProtocol; Global::RunMode Global::runMode; uint Global::defaultPort;