mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 07:37:31 +02:00
Merge pull request #14528 from sethalves/fix-delete-home
work around menu-item name hash collision for Home
This commit is contained in:
commit
77e1c98264
2 changed files with 6 additions and 1 deletions
|
@ -146,6 +146,11 @@ protected:
|
||||||
int findPositionOfMenuItem(MenuWrapper* menu, const QString& searchMenuItem);
|
int findPositionOfMenuItem(MenuWrapper* menu, const QString& searchMenuItem);
|
||||||
int positionBeforeSeparatorIfNeeded(MenuWrapper* menu, int requestedPosition);
|
int positionBeforeSeparatorIfNeeded(MenuWrapper* menu, int requestedPosition);
|
||||||
|
|
||||||
|
// There is a design flaw here -- _actionHash is system-wide and hashes the names of menu-items to their
|
||||||
|
// QActions. The path (parent submenu name etc) isn't included in the hash key. This generally works,
|
||||||
|
// but we add "Home" twice -- once for "go home" and once for "set startup location to home". Anytime
|
||||||
|
// a user bookmarks a place and gives it a name like an existing menu-item, something will go wrong.
|
||||||
|
// TODO: change the js api to require the full path when referring to a specific menu item.
|
||||||
QHash<QString, QAction*> _actionHash;
|
QHash<QString, QAction*> _actionHash;
|
||||||
|
|
||||||
bool isValidGrouping(const QString& grouping) const { return grouping == "Advanced" || grouping == "Developer"; }
|
bool isValidGrouping(const QString& grouping) const { return grouping == "Advanced" || grouping == "Developer"; }
|
||||||
|
|
Loading…
Reference in a new issue