[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Mon Apr 11 07:29:46 CEST 2005


CVS commit by staikos: 

Make sure the dialog gets a pointer to the data source when opening it.  The
data wizard probably has the same problem.  This dialog also needs to be updated
when a save happens since the field list could change.


  M +6 -0      kstdatasource.cpp   1.62
  M +2 -0      kstdatasource.h   1.40
  M +12 -0     kstvectordialog_i.cpp   1.67


--- kdeextragear-2/kst/kst/kstvectordialog_i.cpp  #1.66:1.67
@@ -458,4 +458,15 @@ bool KstVectorDialogI::edit_I() {
 
 void KstVectorDialogI::configureSource() {
+  KST::dataSourceList.lock().readLock();
+  KstDataSourcePtr ds = *KST::dataSourceList.findFileName(FileName->url());
+  KST::dataSourceList.lock().readUnlock();
+  if (!ds) {
+    ds = KstDataSource::loadSource(FileName->url());
+    if (!ds || !ds->isValid()) {
+      _configure->setEnabled(false);
+      return;
+    }
+  }
+
   assert(_configWidget);
   KDialogBase *dlg = new KDialogBase(this, "Data Config Dialog", true, i18n("Configure Data Source"));
@@ -464,4 +475,5 @@ void KstVectorDialogI::configureSource()
   _configWidget->reparent(dlg, QPoint(0, 0));
   dlg->setMainWidget(_configWidget);
+  _configWidget->setInstance(ds);
   _configWidget->load();
   dlg->exec();

--- kdeextragear-2/kst/kst/kstdatasource.h  #1.39:1.40
@@ -224,4 +224,6 @@ class KstDataSourceConfigWidget : public
     virtual void setConfig(KConfig*);
 
+    void setInstance(KstDataSourcePtr inst);
+
   public slots:
     virtual void load();

--- kdeextragear-2/kst/kst/kstdatasource.cpp  #1.61:1.62
@@ -712,4 +712,10 @@ void KstDataSourceConfigWidget::setConfi
 }
 
+
+void KstDataSourceConfigWidget::setInstance(KstDataSourcePtr inst) {
+  _instance = inst;
+}
+
+
 #include "kstdatasource.moc"
 // vim: ts=2 sw=2 et




More information about the Kst mailing list