QComboBox vs KConfigDialogManager

Jeremy Whiting jpwhiting at kde.org
Wed Jun 1 04:55:59 BST 2011


Hey all, I wanted to document the source of a bug I just found the cause of
and get some input on possible fixes.

The bug I noticed was that using qt 4.8 konversation stopped showing
timestamps in the chat window.  After discussing with Eike I realized the
TimestampFormat in my konversationrc was getting saved by KConfigXT as the
Combobox currentIndex (0, 1, or 2) instead of the currentText ("hh:mm",
etc.)  So I spent some time debugging in KCoreConfigSkeleton and
KConfigDialogManager and found that KConfigDialogManager::property gets the
property to save by using the following algorithm.

1) Check if the widget has a kcfg_property is set on the widget.  If so, use
that property's value as the property to record.
2) Check if the widget has a User property to save (This was not set in
QComboBox in 4.7 but is set in 4.8 to the currentIndex property)
3) Try casting to a combobox and use the current text if the combobox is
editable, otherwise use the currentIndex

Anyone here can guess where the problem lies?  So the question is should the
USER property in QComboBox be currentIndex, and if so should we:
a) change all our .ui files KComboBox, QComboBox widgets to have
kcfg_property set if we want to save the currentText as the value of the
config item.
b) change the algorithm in KConfigDialogManager somehow to do the right
thing.

thoughts, opinions, etc. all welcome

Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20110531/4e0045ea/attachment.htm>
-------------- next part --------------
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


More information about the kde-core-devel mailing list