forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user