Simplify IDeviceFactory use

With a 1:1 mapping of factory and created device types, the signatures
of the device factory methods are much simpler, and yield even in
the cases where a factory created more than one device type
(WinRt and Qdb) less code after duplication of the factory.

Change-Id: I1c6279a88e8483001e5603cfe1922029243be610
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2018-10-04 19:08:16 +02:00
parent 9fe5733ef3
commit 0c2101d816
26 changed files with 109 additions and 186 deletions

View File

@@ -36,12 +36,11 @@ class AndroidDeviceFactory : public ProjectExplorer::IDeviceFactory
public:
AndroidDeviceFactory();
QString displayNameForId(Core::Id type) const override;
QList<Core::Id> availableCreationIds() const override;
QIcon iconForId(Core::Id type) const override;
QString displayName() const override;
QIcon icon() const override;
bool canCreate() const override;
ProjectExplorer::IDevice::Ptr create(Core::Id id) const override;
ProjectExplorer::IDevice::Ptr create() const override;
bool canRestore(const QVariantMap &map) const override;
ProjectExplorer::IDevice::Ptr restore(const QVariantMap &map) const override;
};