Commit 755adc80 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇

[DBusMenuImporter] Just send "opened" in updateMenu()

We call updateMenu() to cache the first level of menus in advance in global menu applet.
Just move the "opened" call there to ensure it's always called both when the menu shows or when someone manually triggers it.

Differential Revision: https://phabricator.kde.org/D9782
parent a3dae3ab
......@@ -477,6 +477,9 @@ void DBusMenuImporter::updateMenu(QMenu * menu)
watcher->setProperty(DBUSMENU_PROPERTY_ID, id);
connect(watcher, &QDBusPendingCallWatcher::finished, this,
&DBusMenuImporter::slotAboutToShowDBusCallFinished);
// Firefox deliberately ignores "aboutToShow" whereas Qt ignores" opened", so we'll just send both all the time...
d->sendEvent(id, QStringLiteral("opened"));
}
void DBusMenuImporter::slotAboutToShowDBusCallFinished(QDBusPendingCallWatcher *watcher)
......@@ -525,12 +528,6 @@ void DBusMenuImporter::slotMenuAboutToShow()
Q_ASSERT(menu);
updateMenu(menu);
QAction *action = menu->menuAction();
Q_ASSERT(action);
int id = action->property(DBUSMENU_PROPERTY_ID).toInt();
d->sendEvent(id, QStringLiteral("opened"));
}
QMenu *DBusMenuImporter::createMenu(QWidget *parent)
......
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