KConfigDialog patch

Joris Guisson joris.guisson at gmail.com
Sat Aug 11 10:47:30 BST 2007


I have been working on the KDE 4 port of ktorrent. Obviously we need a
config dialog for that. And after some looking around in the API docs I
found KConfigDialog, which is brilliant in the way it works with KConfigXT.
It seems to be in the API for quite some time now, so it's a bit strange I
never discovered this before.

Anyway, it's brilliant except for one tiny thing, you cannot add pages when
the dialog is shown. This is very annoying for ktorrent, we have a page in
the dialog which allows you to load and unload plugins, some of these
plugins have preference pages. So when I press load, I want the preference
page of the plugin to be added to the dialog.

So I decided to have a look at the code, and I noticed that if I remove the
if test which prevents adding a page when the dialog is shown, things still
work. The only problem was that the widgets are not initialized properly,
which could easily be fixed by setting the value from the settings in
KConfigDialogManager::setupWidget. So that the widget immediately has it's
proper value.

This all then leads to the attached patch. Can this patch be included in
kdelibs ?

Joris,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070811/a9cba066/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kconfigdialog.patch
Type: text/x-patch
Size: 1104 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070811/a9cba066/attachment.bin>


More information about the kde-core-devel mailing list