Commit b711b707 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[DBusMenuImporter] Send "opened" signal alongside about to show

Firefox deliberately ignores the "about-to-show" event and only updates its menus in response to "opened".
There was an unused slot to send an "opened" event. Use that and place the updateMenu call inside.
Also use an UniqueConnection.

Differential Revision:
parent 59ba8b8f
......@@ -431,11 +431,8 @@ void DBusMenuImporter::slotGetLayoutFinished(QDBusPendingCallWatcher *watcher)
if (action->menu()) {
auto menu = action->menu();
connect(menu, &QMenu::aboutToShow, this, [menu, this]() {
if (QMenu *menuAction = action->menu()) {
connect(menuAction, &QMenu::aboutToShow, this, &DBusMenuImporter::slotMenuAboutToShow, Qt::UniqueConnection);
connect(menu, &QMenu::aboutToHide, this, &DBusMenuImporter::slotMenuAboutToHide, Qt::UniqueConnection);
......@@ -527,6 +524,8 @@ void DBusMenuImporter::slotMenuAboutToShow()
QMenu *menu = qobject_cast<QMenu*>(sender());
QAction *action = menu->menuAction();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment