Commit 22e3a7b3 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

Target: Make constructor private



Use Project::createTarget consistently

Change-Id: Ic8b60f35a830080d325758c93bca7068c9859c59
Reviewed-by: default avatarNiels Weber <niels.weber@theqtcompany.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent f133ca30
......@@ -59,7 +59,6 @@ class PROJECTEXPLORER_EXPORT Target : public ProjectConfiguration
Q_OBJECT
public:
Target(Project *parent, Kit *k);
~Target() override;
Project *project() const;
......@@ -158,6 +157,7 @@ signals:
void buildDirectoryChanged();
private:
Target(Project *parent, Kit *k);
void setEnabled(bool);
bool fromMap(const QVariantMap &map) override;
......@@ -169,7 +169,6 @@ private:
void changeBuildConfigurationEnabled();
void changeDeployConfigurationEnabled();
void changeRunConfigurationEnabled();
void handleKitUpdates(ProjectExplorer::Kit *k);
void handleKitRemoval(ProjectExplorer::Kit *k);
......
......@@ -863,7 +863,7 @@ Project::RestoreResult PythonProject::fromMap(const QVariantMap &map, QString *e
if (res == RestoreResult::Ok) {
Kit *defaultKit = KitManager::defaultKit();
if (!activeTarget() && defaultKit)
addTarget(new Target(this, defaultKit));
addTarget(createTarget(defaultKit));
refresh();
......
......@@ -606,13 +606,8 @@ Project::RestoreResult QbsProject::fromMap(const QVariantMap &map, QString *erro
return result;
Kit *defaultKit = KitManager::defaultKit();
if (!activeTarget() && defaultKit) {
Target *t = new Target(this, defaultKit);
t->updateDefaultBuildConfigurations();
t->updateDefaultDeployConfigurations();
t->updateDefaultRunConfigurations();
addTarget(t);
}
if (!activeTarget() && defaultKit)
addTarget(createTarget(defaultKit));
return RestoreResult::Ok;
}
......
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