We use KTextEdit in our application and have ourTextEdit->enableFindReplace(false); When pressing control+f with focus on the textedit the shortcut is blocked and does not reach the parent widget, which has a action also using the KStandardShortcut::find(). This is because the code in handleShortcut and overrideShortcut reads if (KStandardShortcut::find().contains(key)) { if (findReplaceEnabled) parent->slotFind(); return true; } instead of the arguably more correct: if (KStandardShortcut::find().contains(key)) { if (findReplaceEnabled) { parent->slotFind(); return true; } } which only blocks the event if it's actually handling the shortcut. Will submit a proper patch on RB if someone else agrees with my reasoning.
Should be: if (findReplaceEnabled && KStandardShortcut::find().contains(key)) { parent->slotFind(); return true; } If you want to go through the trouble to open a review request, please do, otherwise I can just commit it.
Ideally it needs doing for instances of find, find next and replace. I'm happy for you to commit, or I can do it if you're busy.
Did you actually test if it works with the change? I am unsure if KTextEdit::Private::overrideShortcut() needs to be changed, too.
Doh', you already wrote that it also needs to be changed in overrideShortcut :) I am getting old :P
https://git.reviewboard.kde.org/r/102919/
Git commit bb01bd6bcd5f2353c247c382ad716f6afe1a39dc by Christoph Feck. Committed on 14/11/2011 at 15:56. Pushed by cfeck into branch 'KDE/4.7'. Handle shortcuts for Find/Replace actions only when findReplaceEnabled() Simpler and less intrusive compared to the patch from RB, as discussed with David Faure. BUG: 284433 FIXED-IN: 4.7.4 REVIEW: 102919 M +9 -11 kdeui/widgets/ktextedit.cpp http://commits.kde.org/kdelibs/bb01bd6bcd5f2353c247c382ad716f6afe1a39dc