Bug in KXMLGuiFactory::addClient()
Andras Mantia
amantia at kde.org
Wed Mar 31 16:24:41 BST 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
While dealing with shortcut settings, I've discovered that if in a main
application which has multiple parts I change the shortcut for a part and ask
the part's KXMLGuiClient to reload the XML file, the shortcuts is not set
correctly when they are set back from a custom to default. Example: you have
multiple instances of the same part (an editor), you change the Select All
shortcut to CTRL-1 from the default CTRL-A. In order to change it in every
instance, there is a reloadXML() call for all the instances. If you switch to
another editor view, the XML GUI for the current view is removed and the GUI
for the new one is added with addClient(). This loads the GUI from the XML
file and sets also the modified shortcut from there.
But if you reset the shortcut (CTRL-1 here) to the default one (CTRL-A), the
default shortcut is not saved in the XMLGui file, and in addClient() the
shortcut is not changes and remains the customized one (CTRL-1). See
KXMLGuiFactory::addClient() after the "// process a possibly existing
actionproperties section" line.
I'd suggest to reset all the shortcuts to the default one when adding a
client, as anyway customizations will be loaded after that. We would need
something like the below one after that comment line:
KActionPtrList actionList = doc->actionCollection()->actions();
KActionPtrList::Iterator actionIt;
for ( actionIt = actionList.begin(); actionIt != actionList.end();
++actionIt )
{
(*actionIt)->setShortcut((*actionIt)->shortcutDefault());
}
This makes addClient() somewhat slower, but I believe the current behavior is
wrong.
Opinions?
Andras
- ---
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAauK5TQdfac6L/08RAnYFAJ93Wem1XLmzN5pX4MIxKq/QMHyudACfYop8
ECQpH+bhXqQFmqi/VTClDEI=
=Q2R7
-----END PGP SIGNATURE-----
More information about the kde-core-devel
mailing list