obsolete(?) code in KApplication::notify()

Reinhold Kainhofer reinhold at kainhofer.com
Fri Nov 17 17:05:29 GMT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Freitag, 17. November 2006 17:45 schrieb Andreas Hartmetz:
> Hi!
>
> While browsing kdelibs(4) to find use cases of KShortcut, I found some
> really wrong looking and undocumented code in KApplication::notify().
> To get you a quick impression, here is the beginning of the code in
> question:
>
[...]
>        static const KShortcut& _selectAll = KStdAccel::selectAll();
[...]
>           int key = kevent->key() | kevent->modifiers();
>           if (_selectAll.contains(key))
>           {
>              if (t == QEvent::KeyPress)
>              {
>                 edit->selectAll();
>                 return true;
>              }
>              else
>              {
>                 kevent->accept();
>              }
>           }
> ## snip ##
>
> Strangely, other widgets seem to get their events just fine without
> special hacks in KApplication.

Without looking at the codepathes, the "special hacks" seem to be needed to 
let the Q* widget use the KDE shortcuts form kcontrol. E.g. you can change 
the shortcut for "Select all" from Ctrl+A to something else. That code from 
above makes this possible. But then, I might be wrong, too.

Unfortunately, it seems that (at least in kde 3.5.5) changing the Shortcut 
for "Cut" does not seem to work in konqui's URL bar. Only Ctrl+X works, even 
though I changed that in kcontrol to something different.

Cheers,
Reinhold
- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: reinhold at kainhofer.com, http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFXevcTqjEwhXvPN0RAmJHAJ9m84XCCuwgUcQtzlEfVBLFFzT0zACfSU0K
CCiJvc23DKV7zDJFxXhWZW8=
=89xC
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list