From 857a4e4dbed88b647619c213d731dc460d034820 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 3 May 2013 20:14:38 -0500 Subject: Implemented version list sorting. Resolves MMC-8: https://jira.forkk.net/browse/MMC-8 --- libmultimc/include/instversion.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'libmultimc/include/instversion.h') diff --git a/libmultimc/include/instversion.h b/libmultimc/include/instversion.h index e91e68ba..009bd412 100644 --- a/libmultimc/include/instversion.h +++ b/libmultimc/include/instversion.h @@ -104,6 +104,30 @@ public: */ virtual InstVersion *copyVersion(InstVersionList *newParent) const = 0; + /*! + * Checks if this version is less (older) than the given version. + * \param other The version to compare this one to. + * \return True if this version is older than the given version. + */ + virtual bool isLessThan(const InstVersion &other) const; + + /*! + * Checks if this version is greater (newer) than the given version. + * \param other The version to compare this one to. + * \return True if this version is newer than the given version. + */ + virtual bool isGreaterThan(const InstVersion &other) const; + + /*! + * \sa shouldSortBefore() + */ + virtual bool operator<(const InstVersion &rhs) { return isLessThan(rhs); } + + /*! + * \sa shouldSortAfter() + */ + virtual bool operator>(const InstVersion &rhs) { return isGreaterThan(rhs); } + protected: QString m_descriptor; QString m_name; -- cgit v1.2.3