diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-07-14 13:32:18 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-07-14 13:32:18 +0300 |
commit | 440afcedb02bd878deb2053d2905170763df673d (patch) | |
tree | e6c249c1ed0b53fef779bc895de1064c5f30b4e5 | |
parent | b0a21c9389dfb6962713b61cdb28fa0022c25eeb (diff) | |
download | PrismLauncher-440afcedb02bd878deb2053d2905170763df673d.tar.gz PrismLauncher-440afcedb02bd878deb2053d2905170763df673d.tar.bz2 PrismLauncher-440afcedb02bd878deb2053d2905170763df673d.zip |
fixed warning
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
-rw-r--r-- | launcher/java/JavaInstall.cpp | 19 | ||||
-rw-r--r-- | launcher/java/JavaInstall.h | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/launcher/java/JavaInstall.cpp b/launcher/java/JavaInstall.cpp index 2931a0de..cfa47140 100644 --- a/launcher/java/JavaInstall.cpp +++ b/launcher/java/JavaInstall.cpp @@ -18,6 +18,7 @@ #include "JavaInstall.h" +#include "BaseVersion.h" #include "StringUtils.h" bool JavaInstall::operator<(const JavaInstall& rhs) @@ -43,3 +44,21 @@ bool JavaInstall::operator>(const JavaInstall& rhs) { return (!operator<(rhs)) && (!operator==(rhs)); } + +bool JavaInstall::operator<(BaseVersion& a) +{ + try { + return operator<(dynamic_cast<JavaInstall&>(a)); + } catch (const std::bad_cast& e) { + return BaseVersion::operator<(a); + } +} + +bool JavaInstall::operator>(BaseVersion& a) +{ + try { + return operator>(dynamic_cast<JavaInstall&>(a)); + } catch (const std::bad_cast& e) { + return BaseVersion::operator>(a); + } +} diff --git a/launcher/java/JavaInstall.h b/launcher/java/JavaInstall.h index aa673dad..30815b5a 100644 --- a/launcher/java/JavaInstall.h +++ b/launcher/java/JavaInstall.h @@ -30,6 +30,8 @@ struct JavaInstall : public BaseVersion { virtual QString typeString() const { return arch; } + virtual bool operator<(BaseVersion& a) override; + virtual bool operator>(BaseVersion& a) override; bool operator<(const JavaInstall& rhs); bool operator==(const JavaInstall& rhs); bool operator>(const JavaInstall& rhs); |