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

Peter Kümmel syntheticpp at gmx.net
Wed Jan 19 15:13:31 CET 2011


SVN commit 1215747 by kuemmel:

remove concrete type info from addDataSourcesMetas

 M  +1 -1      primitivemodel.h  
 M  +5 -0      scalarmodel.cpp  
 M  +4 -0      stringmodel.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/primitivemodel.h #1215746:1215747
@@ -97,7 +97,7 @@
         continue;
       }
       addPrimitivesMetas<T>(kst_cast<Primitive>(obj));
-    } else if (kst_cast<DataSource>(obj) && !kst_cast<DataSource>(obj)->scalar().list().isEmpty()) {
+    } else if (kst_cast<DataSource>(obj)) {
       addDataSourcesMetas(kst_cast<DataSource>(obj));
     } else if (kst_cast<DataObject>(obj)) {
       addDataObjectsMetas<T>(kst_cast<DataObject>(obj));
--- branches/work/kst/portto4/kst/src/libkstapp/scalarmodel.cpp #1215746:1215747
@@ -25,6 +25,11 @@
 
 
 void ScalarModel::addDataSourcesMetas(DataSourcePtr dataSource, PrimitiveTreeItem* parent) {
+  if (dataSource->scalar().list().isEmpty()) {
+    return;
+  }
+
+
   PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << dataSource->Name(), parent);
 
   QStringList scalars = dataSource->scalar().list();
--- branches/work/kst/portto4/kst/src/libkstapp/stringmodel.cpp #1215746:1215747
@@ -25,6 +25,10 @@
 
 
 void StringModel::addDataSourcesMetas(DataSourcePtr dataSource, PrimitiveTreeItem* parent) {
+  if (dataSource->string().list().isEmpty()) {
+    return;
+  }
+
   PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << dataSource->Name(), parent);
 
   QStringList scalars = dataSource->string().list();


More information about the Kst mailing list