changeset 1683:e4f31f506116 single-point

Start ids at 0 - backward-compatibility makes testing easier
author Chris Cannam
date Wed, 03 Apr 2019 16:03:39 +0100
parents 4ca784e5033e
children 95396c9382e3
files base/XmlExportable.cpp
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/base/XmlExportable.cpp	Wed Apr 03 16:03:18 2019 +0100
+++ b/base/XmlExportable.cpp	Wed Apr 03 16:03:39 2019 +0100
@@ -72,10 +72,11 @@
 {
     if (m_exportId == -1) {
         static QMutex mutex;
-        static int lastId = 0;
+        static int nextId = 0;
         QMutexLocker locker(&mutex);
         if (m_exportId == -1) {
-            m_exportId = ++lastId;
+            m_exportId = nextId;
+            ++nextId;
         }
     }
     return m_exportId;