From 66371198ecbc47e3eae87f63997eb0c189dc83be Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 15 Jan 2020 17:48:50 +0100 Subject: 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 Reviewed-by: Christian Stenger --- src/plugins/baremetal/idebugserverprovider.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/plugins/baremetal/idebugserverprovider.cpp') 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 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(); -- cgit v1.2.1