diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index 772031f86..18be65fab 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -610,7 +610,6 @@ void ContainmentInterface::mimeTypeRetrieved(KIO::Job *job, const QString &mimet } if (!appletList.isEmpty() || !wallpaperList.isEmpty()) { - choices->clear(); QHash actionsToApplets; choices->addSection(i18n("Widgets")); foreach (const KPluginInfo &info, appletList) { @@ -648,6 +647,11 @@ void ContainmentInterface::mimeTypeRetrieved(KIO::Job *job, const QString &mimet } } + // HACK If the QMenu becomes empty at any point after the "determining mimetype" + // popup was shown, it self-destructs, does not matter if we call clear() or remove + // the action manually, hence we remove the aforementioned item after we populated the menu + choices->removeAction(choices->actions().first()); + QAction *choice = choices->exec(); if (choice) { // Put the job on hold so it can be recycled to fetch the actual content,