Bug 188879 - hardcoded shortcuts in katesearchbar.cpp interfere with applications using katepart
Summary: hardcoded shortcuts in katesearchbar.cpp interfere with applications using ka...
Status: VERIFIED FIXED
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-05 14:24 UTC by Thomas Braun
Modified: 2009-05-04 22:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Braun 2009-04-05 14:24:24 UTC
Version:            (using Devel)
OS:                Linux
Installed from:    Compiled sources

Hi,

I'm a developer of kile, a LaTeX IDE for KDE.
Since a very long time we now use happily katepart as our editor.
Since the same long time we used to have the shortcuts
ALT+1, ALT+2 to ALT+9 bound to very often used compile commands.

Since KDE4 katepart uses some of these shortcuts (ALT+1 to ALT+4) for its own stuff. See kdelibs/kate/utils/katesearchbar.cpp:1635 from KDE 4.2 branch:

    // Grab Alt+1 .. Alt+4 for search mode switching
        connect(new QShortcut(QKeySequence(Qt::ALT + Qt::Key_1), m_widget,
                0, 0, Qt::WidgetWithChildrenShortcut), SIGNAL(activated()),
                this, SLOT(onPowerModeChangedPlainText()));
        connect(new QShortcut(QKeySequence(Qt::ALT + Qt::Key_2), m_widget,
                0, 0, Qt::WidgetWithChildrenShortcut), SIGNAL(activated()),
                this, SLOT(onPowerModeChangedWholeWords()));
        connect(new QShortcut(QKeySequence(Qt::ALT + Qt::Key_3), m_widget,
                0, 0, Qt::WidgetWithChildrenShortcut), SIGNAL(activated()),
                this, SLOT(onPowerModeChangedEscapeSequences()));
        connect(new QShortcut(QKeySequence(Qt::ALT + Qt::Key_4), m_widget,
                0, 0, Qt::WidgetWithChildrenShortcut), SIGNAL(activated()),
                this, SLOT(onPowerModeChangedRegularExpression()));

These shortcuts don't show up in the configure shortcuts dialog which prevents us to remove them and also made finding them quite difficult. So please define them as actions so that they show up in the configure dialog.

Or is there a different way to redefine/remove these shortcuts?

Especially the shortcut ALT+1 is bound to the Quickbuild command in kile and from my experience 99% of our users expect this shortcut to do this rather than changing the search mode of the editor.

thanks,
thomas
Comment 1 Christoph Cullmann 2009-04-29 09:49:23 UTC
How to use KAction and still have actions only bound to this widget?
Comment 2 Andreas Pakulat 2009-04-29 12:09:03 UTC
Hmm, to get the actions to show up inside the shortcut config dialog you'd have to add them to the actioncollection of the xmlguiclient (i.e. the view IIRC). However that means that they'll be associated with the view and if you then use the widget-with-children context those actions can be triggered even if the searchbar is not shown and just the kate view is active.

So I fear the only way to help the kile people is by bringing back that dreaded "shortcuts" page in the editor config pages and put these shortcuts there.
Comment 3 Christoph Cullmann 2009-04-30 07:57:43 UTC
Hmm, perhaps I should just remove them, I don't see the need to switch this modes for searching every 5 secs, that such prominent shortcuts must be taken, or?
Comment 4 Christoph Cullmann 2009-04-30 08:12:17 UTC
SVN commit 961399 by cullmann:

remove the ALT-1/4 shortcuts
even if we later introduce them as actions, remove the hardcoded ALT-* text from the combobox before string freeze
BUG: 188879



 M  +4 -4      dialogs/searchbarpower.ui  
 M  +2 -0      utils/katesearchbar.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=961399
Comment 5 Thomas Braun 2009-05-03 22:54:06 UTC
Thanks a lot! You are the hero of many kile users :)
Comment 6 Christoph Cullmann 2009-05-04 22:33:47 UTC
No Problem, sorry for the regression. Hardcoded shortcuts are no good idea, and for such prominent onces especially :(