forked from qt-creator/qt-creator
QbsProjectManager: Avoid use of global object pool
Change-Id: I6cce96dafda1694c46a4302ae121f7c08a9c82d8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -65,7 +65,6 @@
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QAction>
|
||||
#include <QtPlugin>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
@@ -84,11 +83,31 @@ static QbsProject *currentEditorProject()
|
||||
return doc ? qobject_cast<QbsProject *>(SessionManager::projectForFile(doc->filePath())) : nullptr;
|
||||
}
|
||||
|
||||
class QbsProjectManagerPluginPrivate
|
||||
{
|
||||
public:
|
||||
QbsManager manager;
|
||||
QbsBuildConfigurationFactory buildConfigFactory;
|
||||
QbsBuildStepFactory buildStepFactory;
|
||||
QbsCleanStepFactory cleanStepFactory;
|
||||
QbsInstallStepFactory installStepFactory;
|
||||
QbsDeployConfigurationFactory deployConfigFactory;
|
||||
QbsRunConfigurationFactory runConfigFactory;
|
||||
QbsProfilesSettingsPage profilesSetttingsPage;
|
||||
};
|
||||
|
||||
QbsProjectManagerPlugin::~QbsProjectManagerPlugin()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *errorMessage)
|
||||
{
|
||||
Q_UNUSED(arguments);
|
||||
Q_UNUSED(errorMessage);
|
||||
|
||||
d = new QbsProjectManagerPluginPrivate;
|
||||
|
||||
const Core::Context projectContext(::QbsProjectManager::Constants::PROJECT_ID);
|
||||
|
||||
Core::FileIconProvider::registerIconOverlayForSuffix(ProjectExplorer::Constants::FILEOVERLAY_QT, "qbs");
|
||||
@@ -97,16 +116,6 @@ bool QbsProjectManagerPlugin::initialize(const QStringList &arguments, QString *
|
||||
ProjectManager::registerProjectType<QbsProject>(QmlJSTools::Constants::QBS_MIMETYPE);
|
||||
KitManager::registerKitInformation(new QbsKitInformation);
|
||||
|
||||
//create and register objects
|
||||
addAutoReleasedObject(new QbsManager);
|
||||
addAutoReleasedObject(new QbsBuildConfigurationFactory);
|
||||
addAutoReleasedObject(new QbsBuildStepFactory);
|
||||
addAutoReleasedObject(new QbsCleanStepFactory);
|
||||
addAutoReleasedObject(new QbsInstallStepFactory);
|
||||
addAutoReleasedObject(new QbsDeployConfigurationFactory);
|
||||
addAutoReleasedObject(new QbsRunConfigurationFactory);
|
||||
addAutoReleasedObject(new QbsProfilesSettingsPage);
|
||||
|
||||
//menus
|
||||
// Build Menu:
|
||||
Core::ActionContainer *mbuild =
|
||||
|
||||
Reference in New Issue
Block a user