comparison base/XmlExportable.cpp @ 85:ea730e3f9ace

* Ensure consistent ordering of layer text labels * Fix erroneous SR mismatch warning when adding a wave-file model when no other wave-file model is present (only models that don't assert any particular playback samplerate)
author Chris Cannam
date Thu, 27 Apr 2006 11:49:34 +0000
parents d397ea0a79f5
children 0f37e92e1782
comparison
equal deleted inserted replaced
84:97e085895524 85:ea730e3f9ace
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #include "XmlExportable.h" 16 #include "XmlExportable.h"
17 #include <map> 17 #include <map>
18 #include <QMutex>
19 #include <QMutexLocker>
18 20
19 QString 21 QString
20 XmlExportable::encodeEntities(QString s) 22 XmlExportable::encodeEntities(QString s)
21 { 23 {
22 s 24 s
47 } 49 }
48 50
49 int 51 int
50 XmlExportable::getObjectExportId(const void * object) 52 XmlExportable::getObjectExportId(const void * object)
51 { 53 {
54 static QMutex mutex;
55 QMutexLocker locker(&mutex);
56
52 static std::map<const void *, int> idMap; 57 static std::map<const void *, int> idMap;
53 static int maxId = 0; 58 static int maxId = 0;
54 59
55 if (idMap.find(object) == idMap.end()) { 60 if (idMap.find(object) == idMap.end()) {
56 idMap[object] = maxId++; 61 idMap[object] = maxId++;