forked from qt-creator/qt-creator
QtSupportPlugin: Pimpl partially to remove uses of global object pool
Change-Id: I6c23d6220e8ca212f3785a7aff7915d7979f01eb Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -46,14 +46,31 @@
|
|||||||
|
|
||||||
#include <utils/macroexpander.h>
|
#include <utils/macroexpander.h>
|
||||||
|
|
||||||
#include <QtPlugin>
|
const char kHostBins[] = "CurrentProject:QT_HOST_BINS";
|
||||||
|
const char kInstallBins[] = "CurrentProject:QT_INSTALL_BINS";
|
||||||
static const char kHostBins[] = "CurrentProject:QT_HOST_BINS";
|
|
||||||
static const char kInstallBins[] = "CurrentProject:QT_INSTALL_BINS";
|
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
using namespace QtSupport;
|
|
||||||
using namespace QtSupport::Internal;
|
namespace QtSupport {
|
||||||
|
namespace Internal {
|
||||||
|
|
||||||
|
class QtSupportPluginPrivate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QtVersionManager qtVersionManager;
|
||||||
|
DesktopQtVersionFactory desktopQtVersionFactory;
|
||||||
|
|
||||||
|
CodeGenSettingsPage codeGenSettingsPage;
|
||||||
|
QtOptionsPage qtOptionsPage;
|
||||||
|
|
||||||
|
ExamplesWelcomePage examplesPage{true};
|
||||||
|
ExamplesWelcomePage tutorialPage{false};
|
||||||
|
};
|
||||||
|
|
||||||
|
QtSupportPlugin::~QtSupportPlugin()
|
||||||
|
{
|
||||||
|
delete d;
|
||||||
|
}
|
||||||
|
|
||||||
bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||||
{
|
{
|
||||||
@@ -65,14 +82,7 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
|
|||||||
|
|
||||||
JsExpander::registerQObjectForJs(QLatin1String("QtSupport"), new CodeGenerator);
|
JsExpander::registerQObjectForJs(QLatin1String("QtSupport"), new CodeGenerator);
|
||||||
|
|
||||||
addAutoReleasedObject(new QtVersionManager);
|
d = new QtSupportPluginPrivate;
|
||||||
addAutoReleasedObject(new DesktopQtVersionFactory);
|
|
||||||
|
|
||||||
addAutoReleasedObject(new CodeGenSettingsPage);
|
|
||||||
addAutoReleasedObject(new QtOptionsPage);
|
|
||||||
|
|
||||||
addAutoReleasedObject(new ExamplesWelcomePage(true)); // Examples
|
|
||||||
addAutoReleasedObject(new ExamplesWelcomePage(false)); // Tutorials
|
|
||||||
|
|
||||||
ProjectExplorer::KitManager::registerKitInformation(new QtKitInformation);
|
ProjectExplorer::KitManager::registerKitInformation(new QtKitInformation);
|
||||||
|
|
||||||
@@ -109,3 +119,6 @@ void QtSupportPlugin::extensionsInitialized()
|
|||||||
"You probably want %1 instead.").arg(QString::fromLatin1(kHostBins)),
|
"You probably want %1 instead.").arg(QString::fromLatin1(kHostBins)),
|
||||||
[]() { return qmakeProperty("QT_INSTALL_BINS"); });
|
[]() { return qmakeProperty("QT_INSTALL_BINS"); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // Internal
|
||||||
|
} // QtSupport
|
||||||
|
@@ -30,16 +30,19 @@
|
|||||||
namespace QtSupport {
|
namespace QtSupport {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ExamplesWelcomePage;
|
|
||||||
|
|
||||||
class QtSupportPlugin : public ExtensionSystem::IPlugin
|
class QtSupportPlugin : public ExtensionSystem::IPlugin
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QtSupport.json")
|
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QtCreatorPlugin" FILE "QtSupport.json")
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool initialize(const QStringList &arguments, QString *errorMessage);
|
~QtSupportPlugin() final;
|
||||||
void extensionsInitialized();
|
|
||||||
|
private:
|
||||||
|
bool initialize(const QStringList &arguments, QString *errorMessage) final;
|
||||||
|
void extensionsInitialized() final;
|
||||||
|
|
||||||
|
class QtSupportPluginPrivate *d = nullptr;
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
private slots:
|
private slots:
|
||||||
|
Reference in New Issue
Block a user