Commit c988702f authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

Hide the Plugins menu if no plugins were loaded

Apparently KXmlGUI sets the action object name to the "name=" tag from the
ui.rc XML file.

BUG: 441199
FIXED-IN: 21.08.2
(cherry picked from commit 8ee53cc5)
parent 41207a96
......@@ -13,6 +13,7 @@
#include <QFileInfo>
#include <QDir>
#include <QCommandLineParser>
#include <QMenuBar>
#include <QStandardPaths>
#include <QTimer>
......@@ -167,7 +168,18 @@ MainWindow *Application::newMainWindow()
&Konsole::Application::createWindow);
connect(window, &Konsole::MainWindow::terminalsDetached, this, &Konsole::Application::detachTerminals);
m_pluginManager.registerMainWindow(window);
if (!m_pluginManager.plugins().empty()) {
m_pluginManager.registerMainWindow(window);
} else {
const QList<QAction *> allActions = window->menuBar()->actions();
auto it = std::find_if(allActions.cbegin(), allActions.cend(), [](QAction *action) {
return action->objectName() == QLatin1String("plugins");
});
if (it != allActions.cend()) {
(*it)->setVisible(false);
}
}
return window;
}
......
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