[Differential] [Commented On] D1523: Project Manager View plugin has hardcoded/fixed shortcuts

rjvbb (René J.V. Bertin) noreply at phabricator.kde.org
Fri Jun 3 12:08:37 UTC 2016


rjvbb added a comment.


  I'm not getting the shortcut changes applied through an `actionCollection()` to work. They show up, and I do get conflict warnings about Key_Delete until I change the shortcut on the Project Manager's "Remove..." action. But for some reason the old shortcuts remain active.
  
  I've also realised that these shortcuts are apparently enabled only when the project manager has focus, so not when you're editing a file for instance. That's logical, but IMHO it also means that there's a lot less point in having shortcuts. Shortcuts are extremely useful if they can prevent you from having to go for the mouse, but if you're already using the mouse instead of the keyboard you can almost apply the opposite argument. IOW, I'm now running a local patch which removes the F2 shortcut (just use a right-click to select a file to be renamed and use the context menu). It also remaps the Remove shortcut to the one used in the Finder; that could of course be a Mac-specific change.
  
    diff --git plugins/projectmanagerview/projectmanagerview.cpp plugins/projectmanagerview/projectmanagerview.cpp
    index f08fe23..e8eeca1 100644
    --- plugins/projectmanagerview/projectmanagerview.cpp
    +++ plugins/projectmanagerview/projectmanagerview.cpp
    @@ -146,12 +146,12 @@ bool ProjectManagerView::eventFilter(QObject* obj, QEvent* event)
         if (obj == m_ui->projectTreeView) {
             if (event->type() == QEvent::KeyRelease) {
                 QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
    -            if (keyEvent->key() == Qt::Key_Delete && keyEvent->modifiers() == Qt::NoModifier) {
    +            if (keyEvent->key() == Qt:: Key_Backspace && keyEvent->modifiers() == Qt::ControlModifier) {
                     m_plugin->removeItems(selectedItems());
                     return true;
    -            } else if (keyEvent->key() == Qt::Key_F2 && keyEvent->modifiers() == Qt::NoModifier) {
    -                m_plugin->renameItems(selectedItems());
    -                return true;
    +//             } else if (keyEvent->key() == Qt::Key_F2 && keyEvent->modifiers() == Qt::NoModifier) {
    +//                 m_plugin->renameItems(selectedItems());
    +//                 return true;
                 } else if (keyEvent->key() == Qt::Key_C && keyEvent->modifiers() == Qt::ControlModifier) {
                     m_plugin->copyFromContextMenu();
                     return true;

REPOSITORY
  rKDEVPLATFORM KDevPlatform

REVISION DETAIL
  https://phabricator.kde.org/D1523

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: rjvbb, mwolff, #kdevelop
Cc: mwolff, kdevelop-devel, #kdevelop, Pilzschaf, akshaydeo, surgenight, joshiakshay, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20160603/96d663e7/attachment.html>


More information about the KDevelop-devel mailing list