[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    QComboBox vs KConfigDialogManager
From:       Jeremy Whiting <jpwhiting () kde ! org>
Date:       2011-06-01 3:55:59
Message-ID: BANLkTimrHb11eUwSKaCPE2-QYwq7Srsu9w () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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

[Attachment #5 (text/html)]

Hey all, I wanted to document the source of a bug I just found the cause of=
 and get some input on possible fixes.<br><br>The bug I noticed was that us=
ing qt 4.8 konversation stopped showing timestamps in the chat window.=A0 A=
fter discussing with Eike I realized the TimestampFormat in my konversation=
rc was getting saved by KConfigXT as the Combobox currentIndex (0, 1, or 2)=
 instead of the currentText (&quot;hh:mm&quot;, etc.)=A0 So I spent some ti=
me debugging in KCoreConfigSkeleton and KConfigDialogManager and found that=
 KConfigDialogManager::property gets the property to save by using the foll=
owing algorithm.<br>
<br>1) Check if the widget has a kcfg_property is set on the widget.=A0 If =
so, use that property&#39;s value as the property to record.<br>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)<br>
3) Try casting to a combobox and use the current text if the combobox is ed=
itable, otherwise use the currentIndex<br><br>Anyone here can guess where t=
he problem lies?=A0 So the question is should the USER property in QComboBo=
x be currentIndex, and if so should we:<br>
a) change all our .ui files KComboBox, QComboBox widgets to have kcfg_prope=
rty set if we want to save the currentText as the value of the config item.=
<br>b) change the algorithm in KConfigDialogManager somehow to do the right=
 thing.<br>
<br>thoughts, opinions, etc. all welcome<br><br>Jeremy<br>


>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic