[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Thu Aug 12 00:35:23 CEST 2004


CVS commit by staikos: 

today's lesson: beware KComboBox's pointers - it may delete them on you
CCMAIL: 87004-done at bugs.kde.org


  M +18 -5     kstvectordialog_i.cpp   1.47
  M +1 -1      kstvectordialog_i.h   1.17


--- kdeextragear-2/kst/kst/kstvectordialog_i.cpp  #1.46:1.47
@@ -98,7 +98,14 @@ void KstVectorDialogI::updateCompletion(
   }
 
+  _fieldCompletion = Field->completionObject();
+
   Field->insertStringList(list);
+  if (_fieldCompletion) {
+    _fieldCompletion->clear();
   _fieldCompletion->insertItems(list);
+  }
+  if (!current_text.isEmpty() && (list.contains(current_text) || Field->editable())) {
   Field->setCurrentText(current_text);
+  }
 }
 
@@ -114,5 +121,7 @@ void KstVectorDialogI::_fillFieldsForEdi
   /* fill the fields */
   Field->clear();
+  if (_fieldCompletion) {
   _fieldCompletion->clear();
+  }
   KstDataSourcePtr tf;
   {
@@ -123,11 +132,15 @@ void KstVectorDialogI::_fillFieldsForEdi
       tf->readLock();
       Field->insertStringList(tf->fieldList());
+      if (_fieldCompletion) {
       _fieldCompletion->insertItems(tf->fieldList());
+      }
       tf->readUnlock();
     } else {
       QStringList list = KstDataSource::fieldListForSource(FileName->url());
       Field->insertStringList(list);
+      if (_fieldCompletion) {
       _fieldCompletion->insertItems(list);
     }
+    }
     KST::dataSourceList.lock().readUnlock();
   }

--- kdeextragear-2/kst/kst/kstvectordialog_i.h  #1.16:1.17
@@ -48,5 +48,5 @@ class KstVectorDialogI : public KstVecto
   private:
     static KstVectorDialogI *_inst;
-    KCompletion *_fieldCompletion;
+    QGuardedPtr<KCompletion> _fieldCompletion;
     KstRVectorPtr _getPtr(const QString &tagin);
 





More information about the Kst mailing list