changeset 336:3144af512ea3 tonioni

Sometimes a zero is just a zero
author Chris Cannam
date Tue, 11 Mar 2014 14:54:28 +0000
parents 40bcaf772d78
children 1e3af7f4fa86 dd07d48d7d4f
files framework/VersionTester.cpp
diffstat 1 files changed, 17 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/framework/VersionTester.cpp	Thu Mar 06 15:16:43 2014 +0000
+++ b/framework/VersionTester.cpp	Tue Mar 11 14:54:28 2014 +0000
@@ -60,17 +60,21 @@
     int be = blist.size();
     int e = std::max(ae, be);
     for (int i = 0; i < e; ++i) {
-    int an = 0, bn = 0;
-    if (i < ae) {
-        an = alist[i].toInt();
-        if (an == 0) an = -1; // non-numeric field -> "-pre1" etc
-    }
-    if (i < be) {
-        bn = blist[i].toInt();
-        if (bn == 0) bn = -1;
-    }
-    if (an < bn) return false;
-    if (an > bn) return true;
+        int an = 0, bn = 0;
+        if (i < ae) {
+            an = alist[i].toInt();
+            if (an == 0 && alist[i] != "0") {
+                an = -1; // non-numeric field -> "-pre1" etc
+            }
+        }
+        if (i < be) {
+            bn = blist[i].toInt();
+            if (bn == 0 && blist[i] != "0") {
+                bn = -1;
+            }
+        }
+        if (an < bn) return false;
+        if (an > bn) return true;
     }
     return false;
 }
@@ -103,8 +107,9 @@
     if (lines.empty()) return;
 
     QString latestVersion = lines[0];
-    SVDEBUG << "Comparing current version \"" << m_myVersion              << "\" with latest version \"" << latestVersion	      << "\"" << endl;
+    cerr << "Comparing current version \"" << m_myVersion << "\" with latest version \"" << latestVersion << "\"" << endl;
     if (isVersionNewerThan(latestVersion, m_myVersion)) {
+        cerr << "Latest version \"" << latestVersion << "\" is newer than current version \"" << m_myVersion << "\"" << endl;
         emit newerVersionAvailable(latestVersion);
     }
 }