diff options
author | hjk <hjk@qt.io> | 2020-01-15 17:48:50 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-01-16 09:39:59 +0000 |
commit | 66371198ecbc47e3eae87f63997eb0c189dc83be (patch) | |
tree | 02343c1146a627ed3cb9a9717b7ae5e99e7a93bf /src/plugins/baremetal/idebugserverprovider.cpp | |
parent | 850ae600fbe1acf9fd1acd5ba8ba13f26c5e5c70 (diff) | |
download | qt-creator-66371198ecbc47e3eae87f63997eb0c189dc83be.tar.gz |
BareMetal: Use the plain creation and fromMap(toMap()) for clones
This allows to drop the hierarchy of copy constructors and makes
the setup more similar to what various other factory types in
the ProjectExplorer use nowadays.
This slightly changes clone() behavior in some cases. If that's
not considered harmless, we can introduce some 'polishAfterClone'
or similar.
Change-Id: I935a1f4165bb88e517c136bf4594087aedfdd760
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/baremetal/idebugserverprovider.cpp')
-rw-r--r-- | src/plugins/baremetal/idebugserverprovider.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/plugins/baremetal/idebugserverprovider.cpp b/src/plugins/baremetal/idebugserverprovider.cpp index abe35db30b..1788f8df70 100644 --- a/src/plugins/baremetal/idebugserverprovider.cpp +++ b/src/plugins/baremetal/idebugserverprovider.cpp @@ -61,14 +61,6 @@ IDebugServerProvider::IDebugServerProvider(const QString &id) { } -IDebugServerProvider::IDebugServerProvider(const IDebugServerProvider &provider) - : m_id(createId(provider.m_id)) -{ - m_displayName = QCoreApplication::translate( - "BareMetal::IDebugServerProvider", "Clone of %1") - .arg(provider.displayName()); -} - IDebugServerProvider::~IDebugServerProvider() { const QSet<BareMetalDevice *> devices = m_devices; @@ -189,6 +181,11 @@ void IDebugServerProvider::providerUpdated() DebugServerProviderManager::notifyAboutUpdate(this); } +void IDebugServerProvider::resetId() +{ + m_id = createId(m_id); +} + bool IDebugServerProvider::fromMap(const QVariantMap &data) { m_id = data.value(idKeyC).toString(); |