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

Peter Kümmel syntheticpp at gmx.net
Sun Jan 30 17:03:38 CET 2011


SVN commit 1218019 by kuemmel:

cleanup string and scalar view

 M  +2 -0      datasources/ascii/asciisource.cpp  
 M  +2 -2      libkstapp/scalarmodel.cpp  
 M  +1 -2      libkstapp/stringmodel.cpp  


--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1218018:1218019
@@ -272,7 +272,9 @@
       }
       didRead += line.size();
       --left;
+      if (header_row != _config._fieldsLine && header_row != _config._unitsLine) {
       _strings[QString("Header %1").arg(header_row, 2, 10, QChar('0'))] = QString::fromAscii(line).trimmed();
+      }
       header_row++;
     }
     _rowIndex[0] = didRead;
--- branches/work/kst/portto4/kst/src/libkstapp/scalarmodel.cpp #1218018:1218019
@@ -26,13 +26,13 @@
 
 void ScalarModel::addDataSourcesMetas(DataSourcePtr dataSource, PrimitiveTreeItem* parent) {
 
-  PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << dataSource->descriptiveName(), parent);
-
   QStringList scalars = dataSource->scalar().list();
   if (scalars.isEmpty()) {
     return;
   }
 
+  PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << dataSource->descriptiveName(), parent);
+
   scalars.sort();
   foreach(const QString& scalar, scalars) {
     double value;
--- branches/work/kst/portto4/kst/src/libkstapp/stringmodel.cpp #1218018:1218019
@@ -26,13 +26,12 @@
 
 void StringModel::addDataSourcesMetas(DataSourcePtr dataSource, PrimitiveTreeItem* parent) {
 
-  PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << dataSource->descriptiveName(), parent);
-
   QStringList strings = dataSource->string().list();
   if (strings.isEmpty()) {
     return;
   }
 
+  PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << dataSource->descriptiveName(), parent);
 
   strings.sort();
   foreach(const QString& str, strings) {


More information about the Kst mailing list