QtSupport et al: Centralize QtVersionFactory::restore

Similar to the various types of project *ConfigurationFactory

Change-Id: I7b721f127c8bcc13c7db6880d36c79dd091bc037
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-02-13 18:45:41 +01:00
parent dcac6afcad
commit 5b03c1e059
14 changed files with 30 additions and 75 deletions

View File

@@ -38,6 +38,7 @@ namespace Internal {
AndroidQtVersionFactory::AndroidQtVersionFactory(QObject *parent)
: QtSupport::QtVersionFactory(parent)
{
setQtVersionCreator([] { return new AndroidQtVersion; });
}
bool AndroidQtVersionFactory::canRestore(const QString &type)
@@ -45,15 +46,6 @@ bool AndroidQtVersionFactory::canRestore(const QString &type)
return type == QLatin1String(Constants::ANDROIDQT);
}
QtSupport::BaseQtVersion *AndroidQtVersionFactory::restore(const QString &type,
const QVariantMap &data)
{
QTC_ASSERT(canRestore(type), return nullptr);
auto v = new AndroidQtVersion;
v->fromMap(data);
return v;
}
int AndroidQtVersionFactory::priority() const
{
return 90;

View File

@@ -36,7 +36,6 @@ public:
explicit AndroidQtVersionFactory(QObject *parent = nullptr);
bool canRestore(const QString &type) override;
QtSupport::BaseQtVersion *restore(const QString &type, const QVariantMap &data) override;
int priority() const override;
QtSupport::BaseQtVersion *create(const Utils::FileName &qmakePath, ProFileEvaluator *evaluator,