Make BaseVersion const-correct in order to remove const-cast from Meta::Version

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2025-09-17 10:30:00 +01:00
parent b7b06c0e48
commit 5ef61aa445
No known key found for this signature in database
GPG key ID: 5E39D70B4C93C38E
7 changed files with 33 additions and 33 deletions

View file

@ -30,21 +30,21 @@ class BaseVersion {
* A string used to identify this version in config files.
* This should be unique within the version list or shenanigans will occur.
*/
virtual QString descriptor() = 0;
virtual QString descriptor() const = 0;
/*!
* The name of this version as it is displayed to the user.
* For example: "1.5.1"
*/
virtual QString name() = 0;
virtual QString name() const = 0;
/*!
* This should return a string that describes
* the kind of version this is (Stable, Beta, Snapshot, whatever)
*/
virtual QString typeString() const = 0;
virtual bool operator<(BaseVersion& a) { return name() < a.name(); }
virtual bool operator>(BaseVersion& a) { return name() > a.name(); }
virtual bool operator<(BaseVersion& a) const { return name() < a.name(); }
virtual bool operator>(BaseVersion& a) const { return name() > a.name(); }
};
Q_DECLARE_METATYPE(BaseVersion::Ptr)