[Kst] branches/work/kst/portto4/kst/src/libkst

Adam Treat treat at kde.org
Thu Feb 15 22:50:02 CET 2007


SVN commit 633958 by treat:

* Fix for QMaps


 M  +3 -3      kstdatasource.cpp  
 M  +1 -1      kstdebug.cpp  
 M  +3 -3      kstobject.h  
 M  +2 -2      kstobjectcollection.h  
 M  +4 -4      ksttimezones.cpp  
 M  +4 -4      rwlock.cpp  


--- branches/work/kst/portto4/kst/src/libkst/kstdatasource.cpp #633957:633958
@@ -51,7 +51,7 @@
   pluginInfo.clear();
   kConfigObject = 0L;
   for (QMap<QString,QString>::Iterator i = urlMap.begin(); i != urlMap.end(); ++i) {
-    KIO::NetAccess::removeTempFile(i.data());
+    KIO::NetAccess::removeTempFile(i.value());
   }
   urlMap.clear();
 }
@@ -578,7 +578,7 @@
 QString KstDataSource::fileName() const {
   // Look to see if it was a URL and save the URL instead
   for (QMap<QString,QString>::ConstIterator i = urlMap.begin(); i != urlMap.end(); ++i) {
-    if (i.data() == _filename) {
+    if (i.value() == _filename) {
       return i.key();
     }
   }
@@ -605,7 +605,7 @@
   QString name = Q3StyleSheet::escape(_filename);
   // Look to see if it was a URL and save the URL instead
   for (QMap<QString,QString>::ConstIterator i = urlMap.begin(); i != urlMap.end(); ++i) {
-    if (i.data() == _filename) {
+    if (i.value() == _filename) {
       name = Q3StyleSheet::escape(i.key());
       break;
     }
--- branches/work/kst/portto4/kst/src/libkst/kstdebug.cpp #633957:633958
@@ -57,7 +57,7 @@
 #ifdef BENCHMARK
   kstdDebug() << "DRAW COUNTS ---------------------------------------" << endl;
   for (QMap<QString,int>::ConstIterator i = _drawCounter.begin(); i != _drawCounter.end(); ++i) {
-    kstdDebug() << i.key() << ": " << i.data() << endl;
+    kstdDebug() << i.key() << ": " << i.value() << endl;
   }
 #endif
 }
--- branches/work/kst/portto4/kst/src/libkst/kstobject.h #633957:633958
@@ -361,7 +361,7 @@
     virtual QStringList tagNames() {
       QStringList rc;
       for (typename QMap<QString,T>::ConstIterator it = QMap<QString,T>::begin(); it != QMap<QString,T>::end(); ++it) {
-        rc << it.data()->tagName();
+        rc << it.value()->tagName();
       }
       return rc;
     }
@@ -370,7 +370,7 @@
     QStringList tagNames() const {
       QStringList rc;
       for (typename QMap<QString,T>::ConstIterator it = QMap<QString,T>::begin(); it != QMap<QString,T>::end(); ++it) {
-        rc << it.data()->tagName();
+        rc << it.value()->tagName();
       }
       return rc;
     }
@@ -383,7 +383,7 @@
     typename QMap<QString,T>::iterator findTag(const QString& tag) {
       typename QMap<QString,T>::iterator i;
       for (i = QMap<QString,T>::begin(); i != QMap<QString,T>::end(); ++i) {
-        if (i.data()->tagName() == tag) {
+        if (i.value()->tagName() == tag) {
           break;
         }
       }
--- branches/work/kst/portto4/kst/src/libkst/kstobjectcollection.h #633957:633958
@@ -173,7 +173,7 @@
 template <class T>
 KstObjectTreeNode<T>::~KstObjectTreeNode() {
   for (QMapIterator<QString, KstObjectTreeNode*> i = _children.begin(); i != _children.end(); ++i) {
-    delete (i.data());
+    delete (i.value());
   }
 }
 
@@ -334,7 +334,7 @@
 
   // delete children
   for (QMapIterator<QString, KstObjectTreeNode*> i = _children.begin(); i != _children.end(); ++i) {
-    delete (i.data());
+    delete (i.value());
   }
   _children.clear();
 }
--- branches/work/kst/portto4/kst/src/libkst/ksttimezones.cpp #633957:633958
@@ -387,7 +387,7 @@
     {
         for (ZoneMap::ConstIterator it = m_zones->begin(); it != m_zones->end(); ++it)
         {
-            delete it.data();
+            delete it.value();
         }
     }
     delete m_zones;
@@ -550,7 +550,7 @@
             // Compare it with each zoneinfo file.
             for (ZoneMap::Iterator it = m_zones->begin(); it != m_zones->end(); ++it)
             {
-                KstTimezone *zone = it.data();
+                KstTimezone *zone = it.value();
                 f.setName(m_zoneinfoDir + '/' + zone->name());
                 if (f.open(QIODevice::ReadOnly))
                 {
@@ -629,7 +629,7 @@
         int bestOffset = INT_MAX;
         for (ZoneMap::Iterator it = m_zones->begin(); it != m_zones->end(); ++it)
         {
-            KstTimezone *zone = it.data();
+            KstTimezone *zone = it.value();
             int candidateOffset = QABS(zone->offset(Qt::LocalTime));
             if (zone->parse(matcher) && matcher.test() && (candidateOffset < bestOffset))
             {
@@ -649,7 +649,7 @@
         return m_UTC;
     ZoneMap::ConstIterator it = m_zones->find(name);
     if (it != m_zones->end())
-        return it.data();
+        return it.value();
 
     // Error.
     return 0;
--- branches/work/kst/portto4/kst/src/libkst/rwlock.cpp #633957:633958
@@ -52,7 +52,7 @@
 #endif
   } else {
     QMap<Qt::HANDLE, int>::Iterator it = _readLockers.find(me);
-    if (it != _readLockers.end() && it.data() > 0) {
+    if (it != _readLockers.end() && it.value() > 0) {
       // thread already has another read lock
     } else {
       while (_writeCount > 0 || _waitingWriters) {  // writer priority otherwise
@@ -88,7 +88,7 @@
 
   if (_readCount > 0) {
     QMap<Qt::HANDLE, int>::Iterator it = _readLockers.find(me);
-    if (it != _readLockers.end() && it.data() > 0) {
+    if (it != _readLockers.end() && it.value() > 0) {
       // cannot acquire a write lock if I already have a read lock -- ERROR
       kstdFatal() << "Thread " << (int)QThread::currentThread() << " tried to write lock KstRWLock " << (void*)this << " while holding a read lock" << endl;
       return;
@@ -130,10 +130,10 @@
       return;
     } else {
       --_readCount;
-      if (it.data() == 1) {
+      if (it.value() == 1) {
         _readLockers.remove(it);
       } else {
-        --(it.data());
+        --(it.value());
       }
     }
   } else if (_writeCount > 0) {


More information about the Kst mailing list