aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-07-14 13:32:18 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-07-14 13:32:18 +0300
commit440afcedb02bd878deb2053d2905170763df673d (patch)
treee6c249c1ed0b53fef779bc895de1064c5f30b4e5
parentb0a21c9389dfb6962713b61cdb28fa0022c25eeb (diff)
downloadPrismLauncher-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.cpp19
-rw-r--r--launcher/java/JavaInstall.h2
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);