kxmlgui shortcuts regression

David Faure faure at kde.org
Mon Sep 22 09:38:15 BST 2008

On Sunday 21 September 2008, Michael Jansen wrote:
> > > Could you please give a use case? I have no idea what you are talking
> > > about. But perhaps david can help you as in "know that beast
> > > kxmlguiclient".
> >
> > Lets take KDevelop (though in theory even konqueror with multiple tabs
> > should do):
> >
> > - open two file, you get two tabs. Lets say fileA and fileB
> > - Focus fileA and open shortcuts editor
> > - change a shortcut thats specific for the xmlgui-client - i.e. not part
> >   of the application. In my example I'm changing "Capitalize" which is
> >   a katepart shortcut, to Meta+Ctrl+C
> > - close the editor via "ok"
> > - check wether the shortcut works, for me it does
> > - Switch to fileB by clicking on the tab or using Alt+Left/Right,
> >   doesn't matter
> > - try the shortcut, it doesn't work. Go to the shortcuts editor and see
> >   that the shortcut for the action is back to Default, i.e. Ctrl+Alt+U
> >   in the case of Capitalize

But how is this a "regression"?
Did this really work in KDE3? I have very strong doubts about that.

> > Now I'm not sure where the error is in this case, wether its the xmlgui
> > framework not notifying its clients about changes in the shortcuts, or
> > the clients not doing the right thing or wether the app is responsible
> > for notifying the clients. But somethings wrong for sure.

Yes, something's missing.
To take the matter further, what if you had katepart embedded into
two different applications, at the same time, and changed shortcuts in
one of them? To make both use cases work, I think what we need is
DBUS notification. But at the same time, I am not sure we want to
register each and every kxmlguiclient to dbus...
Another solution would be to use KDirWatch on the file where
the shortcuts are saved (that's a local xmlgui file, not kconfig, right?)
The third solution is "you must restart your application for these changes
to take effect" ;-)

David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).

More information about the kde-core-devel mailing list