[DBusMenuImporter] Don't call removeAction() to avoid an empty QMenu

Authored by broulik on Nov 19 2018, 9:07 AM.

Description

[DBusMenuImporter] Don't call removeAction() to avoid an empty QMenu

As soon as QMenu becomes empty it is closed. This can happen when the application completely reloads its menu.
Instead, call deleteLater which will destroy the QAction later at which point it is automatically removed from the menu.

BUG: 399975
FIXED-IN: 5.14.4

CHANGELOG: Fixed global menu misbehaving and unexpectedly closing with certain applications

Differential Revision: https://phabricator.kde.org/D16297