Summary: | INDEX field not available for vector after creating a vector | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Rick Chern <rchern> |
Component: | general | Assignee: | George Staikos <staikos> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | netterfield |
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Rick Chern
2004-08-11 23:53:43 UTC
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); |