aboutsummaryrefslogtreecommitdiffstats
path: root/lang/cpp/src
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2020-10-15 14:45:31 +0000
committerIngo Klöcker <[email protected]>2020-10-23 11:50:16 +0000
commit2f53a2f4be86c0829213e2a9f846b7f8f0b106dc (patch)
tree2f9b899e9f601268dfe459f4ea00db3c171b80f8 /lang/cpp/src
parenttests: Fix gcc incompatibility (diff)
downloadgpgme-2f53a2f4be86c0829213e2a9f846b7f8f0b106dc.tar.gz
gpgme-2f53a2f4be86c0829213e2a9f846b7f8f0b106dc.zip
cpp, qt: Fix version info comparison
* lang/cpp/src/engineinfo.h (EngineInfo::Version::operator>(const Version &)): Fix logic. (EngineInfo::Version::operator>(const char *)): Use Version-overload of operator>. * lang/qt/tests/t-various.cpp: Add test. -- This fixes a logic error that 2.0.0 > 2.0.0 would return true.
Diffstat (limited to 'lang/cpp/src')
-rw-r--r--lang/cpp/src/engineinfo.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lang/cpp/src/engineinfo.h b/lang/cpp/src/engineinfo.h
index cd1b7a72..0bf7d0e8 100644
--- a/lang/cpp/src/engineinfo.h
+++ b/lang/cpp/src/engineinfo.h
@@ -87,13 +87,14 @@ public:
bool operator > (const char* other)
{
- return !operator<(Version(other));
+ return operator>(Version(other));
}
bool operator > (const Version & other)
{
- return !operator<(other);
+ return !operator<(other) && !operator==(other);
}
+
bool operator == (const Version& other)
{
return major == other.major