From 3202b972f8dac05d4464eb46724b1bd703b9b21d Mon Sep 17 00:00:00 2001 From: Forkk Date: Tue, 7 Jan 2014 18:09:05 -0600 Subject: Rework version numbering system. Again... --- MultiMCVersion.h | 63 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 29 deletions(-) (limited to 'MultiMCVersion.h') diff --git a/MultiMCVersion.h b/MultiMCVersion.h index 75e017df..e205bec6 100644 --- a/MultiMCVersion.h +++ b/MultiMCVersion.h @@ -18,58 +18,63 @@ #include /*! - * \brief The Version class represents a MultiMC version number. + * \brief The Version class represents a MultiMC version. */ struct MultiMCVersion { + enum Type + { + //! Version type for stable release builds. + Release, + + //! Version type for release candidates. + ReleaseCandidate, + + //! Version type for development builds. + Development, + + //! Version type for custom builds. This is the default when no version type is specified. + Custom + }; + /*! * \brief Converts the Version to a string. * \return The version number in string format (major.minor.revision.build). */ QString toString() const { - QString vstr = QString("5.%1.%2").arg( + QString vstr = QString("%1.%2").arg( QString::number(major), QString::number(minor)); - if (build >= 0) vstr += "." + QString::number(build); - if (!channel.isEmpty()) vstr += "-" + channel; - if (!buildType.isEmpty()) vstr += "-" + buildType; + if (hotfix > 0) vstr += "." + QString::number(hotfix); + + // If the build is a development build or release candidate, add that info to the end. + if (type == Development) vstr += "-dev" + QString::number(build); + else if (type == ReleaseCandidate) vstr += "-rc" + QString::number(build); return vstr; } - /*! - * \brief The major version number. - * This is no longer going to always be 5 for MultiMC 5. Doing so is useless. - * Instead, we'll be starting major off at 1 and incrementing it with every major feature. - */ + //! The major version number. int major; - /*! - * \brief The minor version number. - * This number is incremented for major features and bug fixes. - */ + //! The minor version number. int minor; - /*! - * \brief The build number. - * This number is automatically set by Buildbot it is set to the build number of the buildbot - * build that this build came from. - * If this build didn't come from buildbot and no build number was given to CMake, this will default - * to -1, causing it to not show in this version's string representation. - */ + //! The hotfix number. + int hotfix; + + //! The build number. int build; - /*! - * \brief This build's channel. - */ + //! The build type. + Type type; + + //! The build channel. QString channel; - /*! - * \brief The build type. - * This indicates the type of build that this is. For example, lin64 or custombuild. - */ - QString buildType; + //! A short string identifying the platform that this version is for. For example, lin64 or win32. + QString platform; }; -- cgit v1.2.3