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

@@ -27,7 +27,6 @@
#include "iosqtversion.h"
#include "iosconstants.h"
#include <qtsupport/qtsupportconstants.h>
#include <utils/qtcassert.h>
#include <proparser/profileevaluator.h>
#include <QFileInfo>
@@ -38,6 +37,7 @@ namespace Internal {
IosQtVersionFactory::IosQtVersionFactory(QObject *parent)
: QtSupport::QtVersionFactory(parent)
{
setQtVersionCreator([] { return new IosQtVersion; });
}
bool IosQtVersionFactory::canRestore(const QString &type)
@@ -45,15 +45,6 @@ bool IosQtVersionFactory::canRestore(const QString &type)
return type == QLatin1String(Constants::IOSQT);
}
QtSupport::BaseQtVersion *IosQtVersionFactory::restore(const QString &type,
const QVariantMap &data)
{
QTC_ASSERT(canRestore(type), return nullptr);
auto v = new IosQtVersion;
v->fromMap(data);
return v;
}
int IosQtVersionFactory::priority() const
{
return 90;