Version: 0.99-devel (using KDE KDE 3.2.1) Installed from: Compiled From Sources Compiler: gcc (GCC) 3.3.2 20031022 OS: Linux The INDEX field for the new vector dialog becomes blank after creating a new vector. How to reproduce: - start Kst - create a vector through the data manager, or through data wizard - click "Vector" in the data manager to create another vector - note the INDEX field has become blank - click the drop-down list to view the available fields - close the dialog - click "Vector" in the data manager to create a vector again Kst crashes (no useful backtrace). Expected behaviour: The INDEX field does not disappear and Kst does not crash.
Appears to be a kdelibs bug. We might have to make a choice here: 1) update the editable state 2) support completion
False alarm, I found the problem - stale pointer in the dialog that was never triggered until setEditable(). Understandable since KComboBox deletes that pointer on you without warning.
CVS commit by staikos: today's lesson: beware KComboBox's pointers - it may delete them on you CCMAIL: 87004-done@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);