[Kst] extragear/graphics/kst/kst

Rick Chern rchern at interchange.ubc.ca
Thu Jul 14 02:46:13 CEST 2005


SVN commit 434417 by rchern:

Still allow configuring of datasource even when no matrices are available
(For the test MATRIX_SHORT.dat file, data needs to be read starting at row 1 and headers read from row 0 for the matrix to be recognized).

 M  +0 -2      kstdatasource.cpp  
 M  +18 -5     kstmatrixdialog_i.cpp  
 M  +1 -0      kstmatrixdialog_i.h  


--- trunk/extragear/graphics/kst/kst/kstdatasource.cpp #434416:434417
@@ -572,8 +572,6 @@
   }
 
   return rc;
-  
-    
 }
 
 
--- trunk/extragear/graphics/kst/kst/kstmatrixdialog_i.cpp #434416:434417
@@ -823,9 +823,6 @@
   if (ds) {
     ds->readLock();
     list = ds->matrixList();
-    
- 
-    
     _field->setEditable(!ds->fieldListIsComplete());
     _configWidget = ds->configWidget();
     ds->readUnlock();
@@ -847,15 +844,21 @@
       _connect->show();
     } else if (url.isValid()) {
       list = KstDataSource::matrixListForSource(u, QString::null, &type, &complete);
+      
+      // pretend we're getting the full field list
+      if (list.isEmpty()) {
+        QStringList fullList = KstDataSource::fieldListForSource(u, QString::null, &type, &complete);  
+      }
+      
       if (!_inTest || (_inTest && !list.isEmpty())) {
         _connect->hide();
       }
     }
     _field->setEditable(!complete);
     _field->setEnabled(!list.isEmpty());
-    if (!list.isEmpty() && !type.isEmpty()) {
+    if (!type.isEmpty()) {
       _configWidget = KstDataSource::configWidgetForSource(u, type);
-    }
+    } 
 //    _kstDataRange->setAllowTime(KstDataSource::supportsTime(u, type));
   }
 
@@ -875,6 +878,16 @@
 }
 
 
+void KstMatrixDialogI::markSourceAndSave() {
+  assert(_configWidget);
+  KstDataSourcePtr src = static_cast<KstDataSourceConfigWidget*>((QWidget*)_configWidget)->instance();
+  if (src) {
+    src->disableReuse();
+  }
+  static_cast<KstDataSourceConfigWidget*>((QWidget*)_configWidget)->save();
+}
+
+
 void KstMatrixDialogI::setXStartCountFromEndDirty() {
   _xStartCountFromEnd->setTristate(false);
   _xStartCountFromEndDirty = true;
--- trunk/extragear/graphics/kst/kst/kstmatrixdialog_i.h #434416:434417
@@ -112,6 +112,7 @@
     void yNumStepsReadToEndClicked();
     void configureSource();
     void enableSource();
+    void markSourceAndSave();
     void testURL();
     
     void setXStartCountFromEndDirty();


More information about the Kst mailing list