diff --git a/src/plugins/android/androidrunfactories.cpp b/src/plugins/android/androidrunfactories.cpp index 210e4cce786ba9b93fefce20b834f9cf08daab62..8b3b6a6b3165c55b1549acd424d8c6772615a7dc 100644 --- a/src/plugins/android/androidrunfactories.cpp +++ b/src/plugins/android/androidrunfactories.cpp @@ -107,18 +107,11 @@ RunConfiguration *AndroidRunConfigurationFactory::doCreate(Target *parent, const return new AndroidRunConfiguration(parent, id, pathFromId(id)); } -RunConfiguration *AndroidRunConfigurationFactory::restore(Target *parent, - const QVariantMap &map) +RunConfiguration *AndroidRunConfigurationFactory::doRestore(Target *parent, + const QVariantMap &map) { - if (!canRestore(parent, map)) - return 0; Core::Id id = ProjectExplorer::idFromMap(map); - AndroidRunConfiguration *rc = new AndroidRunConfiguration(parent, id, pathFromId(id)); - if (rc->fromMap(map)) - return rc; - - delete rc; - return 0; + return new AndroidRunConfiguration(parent, id, pathFromId(id)); } RunConfiguration *AndroidRunConfigurationFactory::clone(Target *parent, RunConfiguration *source) diff --git a/src/plugins/android/androidrunfactories.h b/src/plugins/android/androidrunfactories.h index c605e506b62317729b43c73db824908c09c7f6fc..66f95f719315676e09ee2033815e2148cb00eade 100644 --- a/src/plugins/android/androidrunfactories.h +++ b/src/plugins/android/androidrunfactories.h @@ -56,12 +56,10 @@ public: bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); - bool canHandle(ProjectExplorer::Target *t) const; QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t, ProjectExplorer::Node *n); @@ -69,6 +67,8 @@ private: bool canHandle(ProjectExplorer::Target *t) const; ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); + ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map); }; class AndroidRunControlFactory : public ProjectExplorer::IRunControlFactory diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index 1f834cca4916608cd3c077d41e1f00f799d2809a..0772632c9a4255e5164e2d7a83e33dae15ed9ed6 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -544,16 +544,11 @@ bool CMakeRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, c return ProjectExplorer::idFromMap(map).name().startsWith(CMAKE_RC_PREFIX); } -ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map) +ProjectExplorer::RunConfiguration *CMakeRunConfigurationFactory::doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map) { - if (!canRestore(parent, map)) - return 0; - CMakeRunConfiguration *rc(new CMakeRunConfiguration(parent, ProjectExplorer::idFromMap(map), - QString(), QString(), QString())); - if (rc->fromMap(map)) - return rc; - delete rc; - return 0; + return new CMakeRunConfiguration(parent, ProjectExplorer::idFromMap(map), + QString(), QString(), QString()); } QString CMakeRunConfigurationFactory::buildTargetFromId(Core::Id id) diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h index ab7728b8ac2fe6e24df97af6d467943b8ff25870..5694e9ccfa48eb8e291889ee79e4356dab624d9f 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h @@ -163,7 +163,6 @@ public: bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product); @@ -177,6 +176,8 @@ private: bool canHandle(ProjectExplorer::Target *parent) const; ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); + ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map); }; } diff --git a/src/plugins/madde/maemorunfactories.cpp b/src/plugins/madde/maemorunfactories.cpp index d0cd8cfe042d85dd1d39446183a7e2acb2242c26..d675fb543b3f1e4a09bd19a15edc064ed1e5e3d7 100644 --- a/src/plugins/madde/maemorunfactories.cpp +++ b/src/plugins/madde/maemorunfactories.cpp @@ -137,20 +137,11 @@ RunConfiguration *MaemoRunConfigurationFactory::doCreate(Target *parent, const C return new MaemoRunConfiguration(parent, id, pathFromId(id)); } -RunConfiguration *MaemoRunConfigurationFactory::restore(Target *parent, +RunConfiguration *MaemoRunConfigurationFactory::doRestore(Target *parent, const QVariantMap &map) { - if (!canRestore(parent, map)) - return 0; - Core::Id id = ProjectExplorer::idFromMap(map); - MaemoRunConfiguration *rc - = new MaemoRunConfiguration(parent, id, pathFromId(id)); - if (rc->fromMap(map)) - return rc; - - delete rc; - return 0; + return new MaemoRunConfiguration(parent, id, pathFromId(id)); } RunConfiguration *MaemoRunConfigurationFactory::clone(Target *parent, RunConfiguration *source) diff --git a/src/plugins/madde/maemorunfactories.h b/src/plugins/madde/maemorunfactories.h index 2d04db7133fab8f6c67205daa4c166d33cee029c..ce7782fb86b71df403715d24f50efc349188cdae 100644 --- a/src/plugins/madde/maemorunfactories.h +++ b/src/plugins/madde/maemorunfactories.h @@ -61,17 +61,18 @@ public: bool canCreate(Target *parent, const Core::Id id) const; bool canRestore(Target *parent, const QVariantMap &map) const; - RunConfiguration *restore(Target *parent, const QVariantMap &map); bool canClone(Target *parent, RunConfiguration *source) const; RunConfiguration *clone(Target *parent, RunConfiguration *source); - bool canHandle(ProjectExplorer::Target *t) const; QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t, ProjectExplorer::Node *n); private: + bool canHandle(ProjectExplorer::Target *t) const; + RunConfiguration *doCreate(Target *parent, const Core::Id id); + RunConfiguration *doRestore(Target *parent, const QVariantMap &map); }; class MaemoRunControlFactory : public IRunControlFactory diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp index 361070aa5c42f053a015b81ac51be18d39952eb3..8d36b864dcc96766e96ff4de502597d9419360b8 100644 --- a/src/plugins/projectexplorer/runconfiguration.cpp +++ b/src/plugins/projectexplorer/runconfiguration.cpp @@ -462,6 +462,18 @@ RunConfiguration *IRunConfigurationFactory::create(Target *parent, const Core::I return rc; } +RunConfiguration *IRunConfigurationFactory::restore(Target *parent, const QVariantMap &map) +{ + if (!canRestore(parent, map)) + return 0; + RunConfiguration *rc = doRestore(parent, map); + if (!rc->fromMap(map)) { + delete rc; + rc = 0; + } + return rc; +} + IRunConfigurationFactory *IRunConfigurationFactory::find(Target *parent, const QVariantMap &map) { QList<IRunConfigurationFactory *> factories diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 8c143d3ebad02ea5ac4ba9cbbcee410d6c176547..d7fc752477321becff0beb1d663f9e9a2b2a17c0 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -216,7 +216,7 @@ public: virtual bool canCreate(Target *parent, const Core::Id id) const = 0; RunConfiguration *create(Target *parent, const Core::Id id); virtual bool canRestore(Target *parent, const QVariantMap &map) const = 0; - virtual RunConfiguration *restore(Target *parent, const QVariantMap &map) = 0; + RunConfiguration *restore(Target *parent, const QVariantMap &map); virtual bool canClone(Target *parent, RunConfiguration *product) const = 0; virtual RunConfiguration *clone(Target *parent, RunConfiguration *product) = 0; @@ -229,6 +229,7 @@ signals: private: virtual RunConfiguration *doCreate(Target *parent, const Core::Id id) = 0; + virtual RunConfiguration *doRestore(Target *parent, const QVariantMap &map) = 0; }; class RunConfigWidget; diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.cpp index 2cfa65fd24ee00d51be60d74044d977da34ecba5..b1d0817669141a9128657ab79ec4cff3276faf8b 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.cpp @@ -120,17 +120,10 @@ bool QmlProjectRunConfigurationFactory::canRestore(ProjectExplorer::Target *pare return parent && canCreate(parent, ProjectExplorer::idFromMap(map)); } -ProjectExplorer::RunConfiguration *QmlProjectRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map) +ProjectExplorer::RunConfiguration *QmlProjectRunConfigurationFactory::doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map) { - if (!canRestore(parent, map)) - return 0; - - Core::Id id = ProjectExplorer::idFromMap(map); - QmlProjectRunConfiguration *rc = new QmlProjectRunConfiguration(parent, id); - if (rc->fromMap(map)) - return rc; - delete rc; - return 0; + return new QmlProjectRunConfiguration(parent, ProjectExplorer::idFromMap(map)); } bool QmlProjectRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.h index f2b3e500a1b542a626b096112095d772dda18207..a0d61f2ab441630f89188032e7220af5404270cf 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationfactory.h @@ -48,7 +48,6 @@ public: bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); @@ -56,6 +55,8 @@ private: bool canHandle(ProjectExplorer::Target *parent) const; ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); + ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map); }; } // namespace Internal diff --git a/src/plugins/qnx/blackberryrunconfigurationfactory.cpp b/src/plugins/qnx/blackberryrunconfigurationfactory.cpp index 84f1dc79267a74878af0b6dd8f126d59f9ea4b89..dd1602a1fbdcab4a1cfdcdb87821f14bae55214d 100644 --- a/src/plugins/qnx/blackberryrunconfigurationfactory.cpp +++ b/src/plugins/qnx/blackberryrunconfigurationfactory.cpp @@ -110,20 +110,12 @@ bool BlackBerryRunConfigurationFactory::canRestore(ProjectExplorer::Target *pare return ProjectExplorer::idFromMap(map).name().startsWith(Constants::QNX_BB_RUNCONFIGURATION_PREFIX); } -ProjectExplorer::RunConfiguration *BlackBerryRunConfigurationFactory::restore( +ProjectExplorer::RunConfiguration *BlackBerryRunConfigurationFactory::doRestore( ProjectExplorer::Target *parent, const QVariantMap &map) { - if (!canRestore(parent, map)) - return 0; - - ProjectExplorer::RunConfiguration *rc = 0; - rc = new BlackBerryRunConfiguration(parent, Core::Id(Constants::QNX_BB_RUNCONFIGURATION_PREFIX), QString()); - if (rc->fromMap(map)) - return rc; - - delete rc; - return 0; + Q_UNUSED(map); + return new BlackBerryRunConfiguration(parent, Core::Id(Constants::QNX_BB_RUNCONFIGURATION_PREFIX), QString()); } bool BlackBerryRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, diff --git a/src/plugins/qnx/blackberryrunconfigurationfactory.h b/src/plugins/qnx/blackberryrunconfigurationfactory.h index 2d38bcd401cc7f637b998235e7ecef4c358840e0..5dd363f2704c789909c7e36b9d13fe28dafeca41 100644 --- a/src/plugins/qnx/blackberryrunconfigurationfactory.h +++ b/src/plugins/qnx/blackberryrunconfigurationfactory.h @@ -50,14 +50,16 @@ public: ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, - const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); +private: bool canHandle(ProjectExplorer::Target *t) const; + + ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map); }; } // namespace Internal diff --git a/src/plugins/qnx/qnxrunconfigurationfactory.cpp b/src/plugins/qnx/qnxrunconfigurationfactory.cpp index 81c53104390463cd5ef290ed88b25f43158d7acd..42fb326355193b03a6041a623baec7f630dd8f3c 100644 --- a/src/plugins/qnx/qnxrunconfigurationfactory.cpp +++ b/src/plugins/qnx/qnxrunconfigurationfactory.cpp @@ -103,18 +103,11 @@ bool QnxRunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, con && ProjectExplorer::idFromMap(map).name().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX); } -ProjectExplorer::RunConfiguration *QnxRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map) +ProjectExplorer::RunConfiguration *QnxRunConfigurationFactory::doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map) { - if (!canRestore(parent, map)) - return 0; - - ProjectExplorer::RunConfiguration *rc = 0; - rc = new QnxRunConfiguration(parent, Core::Id(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX), QString()); - if (rc->fromMap(map)) - return rc; - - delete rc; - return 0; + Q_UNUSED(map); + return new QnxRunConfiguration(parent, Core::Id(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX), QString()); } bool QnxRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const diff --git a/src/plugins/qnx/qnxrunconfigurationfactory.h b/src/plugins/qnx/qnxrunconfigurationfactory.h index f74559da4aa4b361897dc152b9fb5ded7a956552..56abf5e7eb297a187be195ba8e5cb51f0dc01534 100644 --- a/src/plugins/qnx/qnxrunconfigurationfactory.h +++ b/src/plugins/qnx/qnxrunconfigurationfactory.h @@ -49,8 +49,6 @@ public: bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, - const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, @@ -60,6 +58,8 @@ private: bool canHandle(ProjectExplorer::Target *t) const; ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); + ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map); }; } // namespace Internal diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp index b6f2c53f9ba8512b1944315b379f16a08d8d4ea8..55ab79ee37470714fdc01724b1e5392b173f8ee6 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp @@ -757,16 +757,10 @@ bool Qt4RunConfigurationFactory::canRestore(ProjectExplorer::Target *parent, con return ProjectExplorer::idFromMap(map).toString().startsWith(QLatin1String(QT4_RC_PREFIX)); } -ProjectExplorer::RunConfiguration *Qt4RunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map) +ProjectExplorer::RunConfiguration *Qt4RunConfigurationFactory::doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map) { - if (!canRestore(parent, map)) - return 0; - Qt4RunConfiguration *rc = new Qt4RunConfiguration(parent, ProjectExplorer::idFromMap(map)); - if (rc->fromMap(map)) - return rc; - - delete rc; - return 0; + return new Qt4RunConfiguration(parent, ProjectExplorer::idFromMap(map)); } bool Qt4RunConfigurationFactory::canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h index 7b07c9c62b9123418de666f787e4de9c8383e634..2e5e5184b7e22da74ad247553b7d6392a0909df8 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h @@ -214,19 +214,21 @@ public: bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); QList<Core::Id> availableCreationIds(ProjectExplorer::Target *parent) const; QString displayNameForId(const Core::Id id) const; - bool canHandle(ProjectExplorer::Target *t) const; QList<ProjectExplorer::RunConfiguration *> runConfigurationsForNode(ProjectExplorer::Target *t, ProjectExplorer::Node *n); private: + bool canHandle(ProjectExplorer::Target *t) const; + ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); + ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map); }; } // namespace Internal diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp index 3f5c0b8ee5a3cbc66ff5bf6d0e3525d108b68f5e..807488aa6e766852fcc16ddb4a08f783ab971b66 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp @@ -416,15 +416,10 @@ bool CustomExecutableRunConfigurationFactory::canRestore(ProjectExplorer::Target } ProjectExplorer::RunConfiguration * -CustomExecutableRunConfigurationFactory::restore(ProjectExplorer::Target *parent, const QVariantMap &map) +CustomExecutableRunConfigurationFactory::doRestore(ProjectExplorer::Target *parent, const QVariantMap &map) { - if (!canRestore(parent, map)) - return 0; - CustomExecutableRunConfiguration *rc(new CustomExecutableRunConfiguration(parent)); - if (rc->fromMap(map)) - return rc; - delete rc; - return 0; + Q_UNUSED(map); + return new CustomExecutableRunConfiguration(parent); } bool CustomExecutableRunConfigurationFactory::canClone(ProjectExplorer::Target *parent, diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.h b/src/plugins/qtsupport/customexecutablerunconfiguration.h index 64b175d76c22bdc2473c3f68cca7c80671aa4060..312c6c04a0406fa83a0264f571175451396b8ff9 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.h +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.h @@ -139,7 +139,6 @@ public: bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *product) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source); @@ -148,6 +147,8 @@ private: bool canHandle(ProjectExplorer::Target *parent) const; ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); + ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map); }; } // namespace QtSupport diff --git a/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.cpp b/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.cpp index cd220fc53afd1fd7e7fe6eb4eb668347ada7ea0b..015a2ea6d05536e824c9c525b1d4e320b99d1000 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.cpp @@ -110,17 +110,12 @@ RunConfiguration *RemoteLinuxRunConfigurationFactory::doCreate(Target *parent, c return new RemoteLinuxRunConfiguration(parent, id, pathFromId(id)); } -RunConfiguration *RemoteLinuxRunConfigurationFactory::restore(Target *parent, - const QVariantMap &map) +RunConfiguration *RemoteLinuxRunConfigurationFactory::doRestore(Target *parent, + const QVariantMap &map) { - QTC_ASSERT(canRestore(parent, map), return 0); - RemoteLinuxRunConfiguration *rc = new RemoteLinuxRunConfiguration(parent, - Core::Id(RemoteLinuxRunConfiguration::IdPrefix), QString()); - if (rc->fromMap(map)) - return rc; - - delete rc; - return 0; + Q_UNUSED(map); + return new RemoteLinuxRunConfiguration(parent, + Core::Id(RemoteLinuxRunConfiguration::IdPrefix), QString()); } RunConfiguration *RemoteLinuxRunConfigurationFactory::clone(Target *parent, diff --git a/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.h b/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.h index bca5608bef68e569f245719386601374cc46264a..33099be6310989f69cd5733f779d14ef4ac1377e 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.h +++ b/src/plugins/remotelinux/remotelinuxrunconfigurationfactory.h @@ -48,8 +48,6 @@ public: bool canCreate(ProjectExplorer::Target *parent, const Core::Id id) const; bool canRestore(ProjectExplorer::Target *parent, const QVariantMap &map) const; - ProjectExplorer::RunConfiguration *restore(ProjectExplorer::Target *parent, - const QVariantMap &map); bool canClone(ProjectExplorer::Target *parent, ProjectExplorer::RunConfiguration *source) const; ProjectExplorer::RunConfiguration *clone(ProjectExplorer::Target *parent, @@ -59,6 +57,8 @@ private: bool canHandle(const ProjectExplorer::Target *target) const; ProjectExplorer::RunConfiguration *doCreate(ProjectExplorer::Target *parent, const Core::Id id); + ProjectExplorer::RunConfiguration *doRestore(ProjectExplorer::Target *parent, + const QVariantMap &map); }; } // namespace Internal