aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/extensionmanager/extensionmanagerwidget.cpp
diff options
context:
space:
mode:
authorAlessandro Portale <[email protected]>2024-11-12 15:40:54 +0100
committerAlessandro Portale <[email protected]>2024-11-13 23:33:03 +0000
commitae59ed0e4abd3e5f6504466cdae84d6e3ce2cd3a (patch)
tree3879d26d75ddabc9b54c6373a80cdbe706f5449b /src/plugins/extensionmanager/extensionmanagerwidget.cpp
parentba29f8f812260dd3dc1ab0edcdc4ba4861af475f (diff)
ExtensionsManager: Omit reloading for softloadable plugins
This change avoids the "Reload now" info bar if a disabled and softloadable plugin gets enabled. Fixes: QTCREATORBUG-31123 Change-Id: I4fb2a526aa9b04cb54867a57669cf073a021e733 Reviewed-by: Marcus Tillmanns <[email protected]>
Diffstat (limited to 'src/plugins/extensionmanager/extensionmanagerwidget.cpp')
-rw-r--r--src/plugins/extensionmanager/extensionmanagerwidget.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/plugins/extensionmanager/extensionmanagerwidget.cpp b/src/plugins/extensionmanager/extensionmanagerwidget.cpp
index 0c367adc5ea..d6f0ddf3de6 100644
--- a/src/plugins/extensionmanager/extensionmanagerwidget.cpp
+++ b/src/plugins/extensionmanager/extensionmanagerwidget.cpp
@@ -9,6 +9,7 @@
#include "extensionsmodel.h"
#include <coreplugin/coreconstants.h>
+#include <coreplugin/coreplugin.h>
#include <coreplugin/coreplugintr.h>
#include <coreplugin/icontext.h>
#include <coreplugin/icore.h>
@@ -266,17 +267,19 @@ public:
return;
const bool doIt = m_pluginView.data().setPluginsEnabled({spec}, checked);
if (doIt) {
- if (!ICore::infoBar()->canInfoBeAdded(kRestartSetting))
- return;
-
- Utils::InfoBarEntry info(
- kRestartSetting,
- Core::Tr::tr("Plugin changes will take effect after restart."));
- info.addCustomButton(Tr::tr("Restart Now"), [] {
- ICore::infoBar()->removeInfo(kRestartSetting);
- QTimer::singleShot(0, ICore::instance(), &ICore::restart);
- });
- ICore::infoBar()->addInfo(info);
+ if (checked && spec->isEffectivelySoftloadable()) {
+ ExtensionSystem::PluginManager::loadPluginsAtRuntime({spec});
+ Core::Internal::CorePlugin::loadMimeFromPlugin(spec);
+ } else if (ICore::infoBar()->canInfoBeAdded(kRestartSetting)) {
+ Utils::InfoBarEntry info(
+ kRestartSetting,
+ Core::Tr::tr("Plugin changes will take effect after restart."));
+ info.addCustomButton(Tr::tr("Restart Now"), [] {
+ ICore::infoBar()->removeInfo(kRestartSetting);
+ QTimer::singleShot(0, ICore::instance(), &ICore::restart);
+ });
+ ICore::infoBar()->addInfo(info);
+ }
ExtensionSystem::PluginManager::writeSettings();
} else {