diff options
author | Forkk <forkk@forkk.net> | 2014-01-07 18:09:05 -0600 |
---|---|---|
committer | Forkk <forkk@forkk.net> | 2014-01-07 18:09:05 -0600 |
commit | 3202b972f8dac05d4464eb46724b1bd703b9b21d (patch) | |
tree | 05d63b3945d8057d86fec899b9bd0dc533ee82ac /MultiMCVersion.h | |
parent | 28cb66e85cad786f08b40cf242cb17a70d9e7432 (diff) | |
download | MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.tar MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.tar.gz MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.tar.lz MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.tar.xz MultiMC-3202b972f8dac05d4464eb46724b1bd703b9b21d.zip |
Rework version numbering system.
Again...
Diffstat (limited to 'MultiMCVersion.h')
-rw-r--r-- | MultiMCVersion.h | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/MultiMCVersion.h b/MultiMCVersion.h index 75e017df..e205bec6 100644 --- a/MultiMCVersion.h +++ b/MultiMCVersion.h @@ -18,58 +18,63 @@ #include <QString> /*! - * \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; }; |