https://highfidelity.fogbugz.com/f/cases/3714
Showing the changes to interface/src/AvatarBookmarks.cpp (1 of 4 files). Show all
Unified · Split
| @@ -14,6 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | #include <QMessageBox> |
| 15 | 15 | #include <QStandardPaths> |
| 16 | 16 | #include <QQmlContext> |
| 17 | +//#include <QQmlEngine> | |
| 17 | 18 | |
| 18 | 19 | #include <Application.h> |
| 19 | 20 | #include <OffscreenUi.h> |
| @@ -39,7 +40,7 @@ void AvatarBookmarks::setupMenus(Menu* menubar, MenuWrapper* menu) { · 19 unmodified lines | ||
| 39 | 40 | QObject::connect(_deleteBookmarksAction, SIGNAL(triggered()), this, SLOT(deleteBookmark()), Qt::QueuedConnection); |
| 40 | 41 | |
| 41 | 42 | Bookmarks::setupMenus(menubar, menu); |
| 42 | − | |
| 43 | + Bookmarks::sortActions(menubar, _bookmarksMenu); | |
| 43 | 44 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 44 | 45 | auto context = offscreenUi->getRootContext(); |
| 45 | 46 | context->setContextProperty("avatarBookmarks", this); |
| @@ -74,7 +75,16 @@ void AvatarBookmarks::addBookmarkToMenu(Menu* menubar, const QString& name, cons · 28 unmodified lines | ||
| 74 | 75 | QAction* changeAction = _bookmarksMenu->newAction(); |
| 75 | 76 | changeAction->setData(address); |
| 76 | 77 | connect(changeAction, SIGNAL(triggered()), this, SLOT(changeToBookmarkedAvatar())); |
| 78 | + if (!_isMenuSorted) { | |
| 79 | + menubar->addActionToQMenuAndActionHash(_bookmarksMenu, changeAction, name, 0, QAction::NoRole); | |
| 80 | + } else { | |
| 81 | + // TODO: this is aggressive but all other alternative have proved less fruitful so far. | |
| 82 | + // having experimented with various pointer types, It is possible the issues are deeper routed in the MenuWrapper/Menu Qt/QML architecture | |
| 83 | + // further research did not produce better results | |
| 77 | 84 | |
| 78 | − menubar->addActionToQMenuAndActionHash(_bookmarksMenu, changeAction, name, 0, QAction::NoRole); | |
| 79 | − Bookmarks::sortActions(_bookmarksMenu); | |
| 85 | + //menubar->addActionToQMenuAndActionHash(_bookmarksMenu, changeAction, name, 0, QAction::NoRole, | |
| 86 | + //Bookmarks::getMenuItemLocation(_bookmarksMenu->actions(), name)); | |
| 87 | + menubar->addActionToQMenuAndActionHash(_bookmarksMenu, changeAction, name, 0, QAction::NoRole); | |
| 88 | + Bookmarks::sortActions(menubar, _bookmarksMenu); | |
| 89 | + } | |
| 80 | 90 | } |