Core: Export Core::executePluginInstallWizard

ExtensionManager wants to execute the wizard, but it lives in another
plugin.

This change exports the former Core::PluginInstallWizard::exec as
Core::executePluginInstallWizard

Change-Id: I3ba068e9c8351355abfedfb9f6d6879de55b0534
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2024-05-27 22:38:24 +02:00
parent 43d57eb76f
commit 01040420a7
3 changed files with 6 additions and 12 deletions

View File

@@ -98,7 +98,7 @@ void PluginDialog::closeDialog()
void PluginDialog::showInstallWizard() void PluginDialog::showInstallWizard()
{ {
if (PluginInstallWizard::exec()) if (executePluginInstallWizard())
m_isRestartRequired = true; m_isRestartRequired = true;
} }

View File

@@ -71,7 +71,6 @@ static FilePath pluginInstallPath(bool installIntoApplication)
} }
namespace Core { namespace Core {
namespace Internal {
class SourcePage : public WizardPage class SourcePage : public WizardPage
{ {
@@ -145,7 +144,7 @@ struct ArchiveIssue
// Async. Result is set if any issue was found. // Async. Result is set if any issue was found.
void checkContents(QPromise<ArchiveIssue> &promise, const FilePath &tempDir) void checkContents(QPromise<ArchiveIssue> &promise, const FilePath &tempDir)
{ {
PluginSpec *coreplugin = PluginManager::specForPlugin(CorePlugin::instance()); PluginSpec *coreplugin = PluginManager::specForPlugin(Internal::CorePlugin::instance());
// look for plugin // look for plugin
QDirIterator it(tempDir.path(), libraryNameFilter(), QDir::Files | QDir::NoSymLinks, QDirIterator it(tempDir.path(), libraryNameFilter(), QDir::Files | QDir::NoSymLinks,
@@ -397,7 +396,7 @@ static bool copyPluginFile(const FilePath &src, const FilePath &dest)
return true; return true;
} }
bool PluginInstallWizard::exec(const FilePath &archive) bool executePluginInstallWizard(const FilePath &archive)
{ {
Wizard wizard(ICore::dialogParent()); Wizard wizard(ICore::dialogParent());
wizard.setWindowTitle(Tr::tr("Install Plugin")); wizard.setWindowTitle(Tr::tr("Install Plugin"));
@@ -442,5 +441,4 @@ bool PluginInstallWizard::exec(const FilePath &archive)
return false; return false;
} }
} // namespace Internal
} // namespace Core } // namespace Core

View File

@@ -3,18 +3,14 @@
#pragma once #pragma once
#include "core_global.h"
#include <utils/filepath.h> #include <utils/filepath.h>
#include <QCoreApplication> #include <QCoreApplication>
namespace Core { namespace Core {
namespace Internal {
class PluginInstallWizard CORE_EXPORT bool executePluginInstallWizard(const Utils::FilePath &archive = {});
{
public:
static bool exec(const Utils::FilePath &archive = {});
};
} // namespace Internal
} // namespace Core } // namespace Core