Warn on startup about ambiguous shortcuts (with an exception for Shift+Delete)

Review Request #129299 - Created Oct. 31, 2016 and submitted

Information
Albert Astals Cid
kxmlgui
Reviewers
kdeframeworks
dfaure, elvisangelaccio

Add a warning at the createGui stage about ambiguous shortcuts being found in the same action collection.

This is usually a developer issue, but the error message about ambiguity will only show up when someone tries to use the shortcut, so it is relatively easy to miss if you do not try all your actions via a shortcut.

Also if the involved shortcut is one of the non primary shortcuts of edit_cut + deletefile, just give it away, since it's Shift+Delete being fought over as part of our defaults being ambiguous.

gwenview without any patch gives the warning
gwenview with https://git.reviewboard.kde.org/r/129717/ doesn't give the warning (since it's using the standard actions instead of a own one for delete)
gwenview with https://git.reviewboard.kde.org/r/129718/ doesn't give the warning (since it's manually removing Shift+Delete for cut)

Issues

  • 5
  • 4
  • 0
  • 9
Description From Last Updated
I think it would be better if this were not blocking (i.e. creating the QMessageBox manually and showing it with ... Elvis Angelaccio Elvis Angelaccio
How come this is the only exception? Aleix Pol Gonzalez Aleix Pol Gonzalez
This should be moved out of the loop, so that this lookup only happens once. David Faure David Faure
We could optimize this a bit, to not change the list just to filter out the main shortcut (and then ... David Faure David Faure
shortcuts.insert(portableShortcutText, action) is faster (see "Effective C++") David Faure David Faure
Elvis Angelaccio
Albert Astals Cid
Aleix Pol Gonzalez
Aleix Pol Gonzalez
David Faure
Albert Astals Cid
David Faure
Albert Astals Cid
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 8eabbf6725386e716b7536c71a9181dfe5d959f0 by Albert Astals Cid to branch master.
Christoph Feck
See bug 375555 for a regression. Not sure if it is fixable.
Loading...