[Kst] branches/work/kst/kst1kde4/kst/src/libkst (silent)

Andrew Walker arwalker at sumusltd.com
Thu Nov 26 05:40:03 CET 2009


SVN commit 1054491 by arwalker:

SVN_SILENT ongoing

 M  +7 -13     CMakeLists.txt  
 M  +2 -2      kstobject.h  
 M  +48 -18    kstobjectcollection.h  


--- branches/work/kst/kst1kde4/kst/src/libkst/CMakeLists.txt #1054490:1054491
@@ -1,4 +1,3 @@
-
 find_package(KDE4 REQUIRED)
 
 add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
@@ -7,20 +6,15 @@
 
 include(MacroLibrary)
 
-#include(ConvenienceLibs.cmake)
+include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
 
-#include(ManualStuff.cmake)
-
-#include(ConfigureChecks.cmake)
-
-include_directories(${CMAKE_SOURCE_DIR}/kst/src/extdate ${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} )
-
 #configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ksttimers.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/ksttimers.h)
 
 
 ########### next target ###############
 
 set(kst_LIB_SRCS
+#   ksdebug.cpp
     kstobject.cpp
     kstdatasource.cpp
     stdinsource.cpp
@@ -30,8 +24,9 @@
     rwlock.cpp
     kstmath.cpp
     kstdateparser.cpp
+#   ksttimezones.cpp
     kstscalar.cpp
- #   $(PROCPS_COPY)
+#   $(PROCPS_COPY)
     kststring.cpp
     kstmatrix.cpp
     kstrmatrix.cpp
@@ -45,11 +40,11 @@
     kstmatrixdefaults.cpp
     kstprimitive.cpp
     defaultprimitivenames.cpp)
-#    sysinfo.c)
+#   kstwaitcondition_unix.cpp)
 
 kde4_add_library(kst SHARED ${kst_LIB_SRCS})
 
-target_link_libraries(kst ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS})
+target_link_libraries(kst ${KDE4_KDECORE_LIBS} kio QtXml QtGui)
 
 set_target_properties(kst PROPERTIES VERSION 1.0.0 SOVERSION 1)
 install(TARGETS kst ${INSTALL_TARGETS_DEFAULT_ARGS})
@@ -57,7 +52,7 @@
 
 ########### install files ###############
 
-install(FILES  kstdatasource.h kstobject.h kst_export.h rwlock.h kstdateparser.h kstobjectcollection.h DESTINATION ${INCLUDE_INSTALL_DIR})
+install(FILES  kstdatasource.h kstobject.h kst_export.h rwlock.h kstdateparser.h kstobjectcollection.h DESTINATION /include)
 
 
 
@@ -71,7 +66,6 @@
 #lib_LTLIBRARIES = libkst.la
 #
 #libkst_la_SOURCES = \
-#	kstcodecs.cpp \
 #	ksdebug.cpp \
 #	kstobject.cpp \
 #	kstdatasource.cpp \
--- branches/work/kst/kst1kde4/kst/src/libkst/kstobject.h #1054490:1054491
@@ -359,7 +359,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)->tagName();
       }
       return rc;
     }
@@ -367,7 +367,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)->tagName();
       }
       return rc;
     }
--- branches/work/kst/kst1kde4/kst/src/libkst/kstobjectcollection.h #1054490:1054491
@@ -440,35 +440,40 @@
 template <class T>
 QExplicitlySharedDataPointer<T> KstObjectCollection<T>::retrieveObject(QStringList tag) const {
   if (tag.isEmpty()) {
-    return NULL;
+    return QExplicitlySharedDataPointer<T>();
   }
 
-  if (_index[tag.first()] && _index[tag.first()]->count() == 1) {
-    // the first tag element is unique, so use the index
-    KstObjectTreeNode<T> *n = _index[tag.first()]->first();
+  if (_index.contains(tag.first()) && _index.value(tag.first()).count() == 1) {
+    KstObjectTreeNode<T> *n = _index.value(tag.first()).first();
 
     if (n) {
       tag.pop_front();
       n = n->descendant(tag);
     }
+    
     if (n) {
-      return n->object();
+      return QExplicitlySharedDataPointer<T>(n->object());
     }
   }
 
-  // search through the tree
+  //
+  // search through the tree...
+  //
+  
   const KstObjectTreeNode<T> *n = _root.descendant(tag);
+  
   if (n) {
-    return n->object();
+    return QExplicitlySharedDataPointer<T>(n->object());
   } else {
-    return NULL;
+    return QExplicitlySharedDataPointer<T>();
   }
 }
 
+
 template <class T>
 QExplicitlySharedDataPointer<T> KstObjectCollection<T>::retrieveObject(const KstObjectTag& tag) const {
   if (!tag.isValid()) {
-    return NULL;
+    return QExplicitlySharedDataPointer<T>();
   }
 
   return retrieveObject(tag.fullTag());
@@ -598,21 +603,38 @@
 
 template <class T>
 typename KstObjectList<QExplicitlySharedDataPointer<T> >::Iterator KstObjectCollection<T>::findTag(const KstObjectTag& x) {
-  T *obj = retrieveObject(x);
+  T *obj;
+  
+  obj = retrieveObject(x).data();
   if (obj) {
-    return _list.find(obj);
+    typename KstObjectList<QExplicitlySharedDataPointer<T> >::Iterator it;
+    
+    for (it=_list.begin(); it!=_list.end(); ++it) {
+      if ((*it).data() == obj) {
+        return it;
+      }
+    }
   } else {
-    // For historical compatibility:
-    // previously, output vectors of equations, PSDs, etc. were named PSD1-ABCDE-freq
-    // now, they are PSD1-ABCDE/freq
+    //
+    // for historical compatibility:
+    // previously, output vectors of equations, PSDs, etc. 
+    //  were named PSD1-ABCDE-freq now, they are PSD1-ABCDE/freq
+    //
     QString newTag = x.tagString();
 
     newTag.replace(newTag.lastIndexOf('-'), 1, KstObjectTag::tagSeparator);
-    obj = retrieveObject(KstObjectTag::fromString(newTag));
+    obj = retrieveObject(KstObjectTag::fromString(newTag)).data();
     if (obj) {
-      return _list.find(obj);
+      typename KstObjectList<QExplicitlySharedDataPointer<T> >::Iterator it;
+      
+      for (it=_list.begin(); it!=_list.end(); ++it) {
+        if ((*it).data() == obj) {
+          return it;
+        }
+      }
     }
   }
+  
   return _list.end();
 }
 
@@ -623,9 +645,17 @@
 
 template <class T>
 typename KstObjectList<QExplicitlySharedDataPointer<T> >::ConstIterator KstObjectCollection<T>::findTag(const KstObjectTag& x) const {
-  T *obj = retrieveObject(x);
+  T *obj;
+  
+  obj = retrieveObject(x).data();
   if (obj) {
-    return _list.find(obj);
+    typename KstObjectList<QExplicitlySharedDataPointer<T> >::Iterator it;
+    
+    for (it=_list.begin(); it!=_list.end(); ++it) {
+      if ((*it).data() == obj) {
+        return it;
+      }
+    }
   } else {
     // For historical compatibility:
     // previously, output vectors of equations, PSDs, etc. were named PSD1-ABCDE-freq


More information about the Kst mailing list