aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>2015-04-26 13:06:25 +0300
committerhjk <hjk@theqtcompany.com>2015-04-27 08:26:56 +0000
commite2fd350f023aeb26e32cba0eeb7c97940cff624f (patch)
treec54b23e9c12f5d4d58f8036469ba5d433e465169
parentf5ba484fbef2da53b4af3ec100454f89da7d8f21 (diff)
BareMetal: Support seamless 3.3 -> 3.4 upgrade
Change-Id: I49caf77ee5e9f08fdede9d6881a4da717c5da057 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: hjk <hjk@theqtcompany.com>
-rw-r--r--src/plugins/baremetal/baremetaldevice.cpp18
-rw-r--r--src/plugins/baremetal/defaultgdbserverprovider.h1
2 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/baremetal/baremetaldevice.cpp b/src/plugins/baremetal/baremetaldevice.cpp
index 2df60b0546..daa93d5eb3 100644
--- a/src/plugins/baremetal/baremetaldevice.cpp
+++ b/src/plugins/baremetal/baremetaldevice.cpp
@@ -31,11 +31,15 @@
#include "baremetaldevice.h"
#include "baremetaldeviceconfigurationwidget.h"
-
+#include "defaultgdbserverprovider.h"
+#include "gdbserverprovidermanager.h"
#include "gdbserverproviderprocess.h"
#include <coreplugin/id.h>
+
+#include <ssh/sshconnection.h>
#include <utils/qtcassert.h>
+
#include <QCoreApplication>
using namespace ProjectExplorer;
@@ -73,7 +77,17 @@ void BareMetalDevice::setGdbServerProviderId(const QString &id)
void BareMetalDevice::fromMap(const QVariantMap &map)
{
IDevice::fromMap(map);
- setGdbServerProviderId(map.value(QLatin1String(gdbServerProviderIdKeyC)).toString());
+ QString gdbServerProvider = map.value(QLatin1String(gdbServerProviderIdKeyC)).toString();
+ if (gdbServerProvider.isEmpty()) {
+ const QSsh::SshConnectionParameters sshParams = sshParameters();
+ DefaultGdbServerProvider *newProvider = new DefaultGdbServerProvider;
+ newProvider->setDisplayName(displayName());
+ newProvider->m_host = sshParams.host;
+ newProvider->m_port = sshParams.port;
+ GdbServerProviderManager::instance()->registerProvider(newProvider);
+ gdbServerProvider = newProvider->id();
+ }
+ setGdbServerProviderId(gdbServerProvider);
}
QVariantMap BareMetalDevice::toMap() const
diff --git a/src/plugins/baremetal/defaultgdbserverprovider.h b/src/plugins/baremetal/defaultgdbserverprovider.h
index c9390f3981..53379d4409 100644
--- a/src/plugins/baremetal/defaultgdbserverprovider.h
+++ b/src/plugins/baremetal/defaultgdbserverprovider.h
@@ -65,6 +65,7 @@ private:
friend class DefaultGdbServerProviderConfigWidget;
friend class DefaultGdbServerProviderFactory;
+ friend class BareMetalDevice;
};
class DefaultGdbServerProviderFactory : public GdbServerProviderFactory