mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 07:12:40 +02:00
work around menu-item name hash collision for Home
This commit is contained in:
parent
3c43f44119
commit
541d0ab4d6
2 changed files with 6 additions and 1 deletions
|
@ -117,7 +117,7 @@ namespace MenuOption {
|
|||
const QString FrameTimer = "Show Timer";
|
||||
const QString FullscreenMirror = "Mirror";
|
||||
const QString Help = "Help...";
|
||||
const QString HomeLocation = "Home";
|
||||
const QString HomeLocation = "Home ";
|
||||
const QString IncreaseAvatarSize = "Increase Avatar Size";
|
||||
const QString IndependentMode = "Independent Mode";
|
||||
const QString ActionMotorControl = "Enable Default Motor Control";
|
||||
|
|
|
@ -146,6 +146,11 @@ protected:
|
|||
int findPositionOfMenuItem(MenuWrapper* menu, const QString& searchMenuItem);
|
||||
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;
|
||||
|
||||
bool isValidGrouping(const QString& grouping) const { return grouping == "Advanced" || grouping == "Developer"; }
|
||||
|
|
Loading…
Reference in a new issue