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

Peter Kümmel syntheticpp at gmx.net
Wed Feb 2 19:13:39 CET 2011


SVN commit 1218516 by kuemmel:

only show values with metas, cleanup

 M  +10 -0     primitivemodel.h  
 M  +0 -14     scalarmodel.cpp  
 M  +0 -2      scalarmodel.h  
 M  +0 -12     stringmodel.cpp  
 M  +0 -3      stringmodel.h  


--- branches/work/kst/portto4/kst/src/libkstapp/primitivemodel.h #1218515:1218516
@@ -143,9 +143,19 @@
 
 template<class T>
 void PrimitiveModel::addPrimitivesMetas(const PrimitivePtr& prim, PrimitiveTreeItem* parent) {
+  bool metas_available = false;
+  PrimitiveMap metas = prim->metas();
+  foreach(const PrimitivePtr& m, metas) {
+    if (kst_cast<T>(m)) {
+      metas_available = true;
+      break;
+    }
+  }
+  if (metas_available) {
   PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << prim->Name(), parent);
   addMetas<T>(prim->metas(), item);
 }
+}
 
 
 template<class T>
--- branches/work/kst/portto4/kst/src/libkstapp/scalarmodel.cpp #1218515:1218516
@@ -44,22 +44,8 @@
   }
 }
 
-// There are not yet any per-file scalars, though things like num_frames should be constant across a datasource
-// and therefore availible as a per-file scalar... so, maybe, FIXME.
-PrimitiveTreeItem* ScalarModel::addDataSourceFileItem(DataSourcePtr dataSource, PrimitiveTreeItem* parent)
-{
 
-  QString path = dataSource->descriptiveName();
-  QFileInfo info(path);
 
-  PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << info.fileName(), parent);
-  //new PrimitiveTreeItem(QList<QVariant>() << "In directory" << info.path(), item);
-
-  return item;
 }
 
-
-
-}
-
 // vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstapp/scalarmodel.h #1218515:1218516
@@ -31,8 +31,6 @@
 
   void addDataSourcesMetas(DataSourcePtr dataSource, PrimitiveTreeItem* parent = 0);
 
-protected:
-  PrimitiveTreeItem* addDataSourceFileItem(DataSourcePtr dataSource, PrimitiveTreeItem* parent);
 
 };
 
--- branches/work/kst/portto4/kst/src/libkstapp/stringmodel.cpp #1218515:1218516
@@ -44,20 +44,8 @@
   }
 }
 
-PrimitiveTreeItem* StringModel::addDataSourceFileItem(DataSourcePtr dataSource, PrimitiveTreeItem* parent)
-{
 
-  QString path = dataSource->descriptiveName();
-  QFileInfo info(path);
 
-  PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << info.fileName(), parent);
-  new PrimitiveTreeItem(QList<QVariant>() << "Name" << path, item);
-  new PrimitiveTreeItem(QList<QVariant>() << "In directory" << info.path(), item);
-
-  return item;
 }
 
-
-}
-
 // vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstapp/stringmodel.h #1218515:1218516
@@ -31,9 +31,6 @@
 
   void addDataSourcesMetas(DataSourcePtr dataSource, PrimitiveTreeItem* parent = 0);
 
-protected:
-  PrimitiveTreeItem* addDataSourceFileItem(DataSourcePtr dataSource, PrimitiveTreeItem* parent);
-
 };
 
 


More information about the Kst mailing list