Merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/archfind into lp:qtcreator-plugin-ubuntu

Proposed by Benjamin Zeller
Status: Merged
Approved by: Zoltan Balogh
Approved revision: 232
Merged at revision: 230
Proposed branch: lp:~zeller-benjamin/qtcreator-plugin-ubuntu/archfind
Merge into: lp:qtcreator-plugin-ubuntu
Prerequisite: lp:~bzoltan/qtcreator-plugin-ubuntu/find_arch
Diff against target: 509 lines (+156/-33)
14 files modified
src/ubuntu/ubuntuclickdialog.cpp (+0/-1)
src/ubuntu/ubuntudeploystepfactory.cpp (+2/-2)
src/ubuntu/ubuntudevice.cpp (+9/-7)
src/ubuntu/ubuntudevice.h (+2/-2)
src/ubuntu/ubuntudevicefactory.cpp (+61/-4)
src/ubuntu/ubuntudevicesmodel.cpp (+24/-5)
src/ubuntu/ubuntudevicesmodel.h (+1/-1)
src/ubuntu/ubuntukitmanager.cpp (+49/-3)
src/ubuntu/ubuntulocalrunconfigurationfactory.cpp (+2/-2)
src/ubuntu/ubuntupackagestep.cpp (+1/-1)
src/ubuntu/ubuntupackagingwidget.cpp (+2/-2)
src/ubuntu/ubunturemoteanalyzesupport.cpp (+1/-1)
src/ubuntu/ubunturemotedebugsupport.cpp (+1/-1)
src/ubuntu/ubunturemotedeployconfiguration.cpp (+1/-1)
To merge this branch: bzr merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/archfind
Reviewer Review Type Date Requested Status
Zoltan Balogh Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+229238@code.launchpad.net

This proposal supersedes a proposal from 2014-08-01.

Commit message

- Store architecture of a device in the devicetype ID
- Fix all existing devices and Kits

Description of the change

- Store architecture of a device in the devicetype ID
- Fix all existing devices and Kits

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

OK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ubuntu/ubuntuclickdialog.cpp'
2--- src/ubuntu/ubuntuclickdialog.cpp 2014-07-31 09:41:18 +0000
3+++ src/ubuntu/ubuntuclickdialog.cpp 2014-08-01 14:04:50 +0000
4@@ -29,7 +29,6 @@
5 #include <projectexplorer/toolchainmanager.h>
6 #include <texteditor/fontsettings.h>
7
8-
9 #include "ubuntucreatenewchrootdialog.h"
10
11 namespace Ubuntu {
12
13=== modified file 'src/ubuntu/ubuntudeploystepfactory.cpp'
14--- src/ubuntu/ubuntudeploystepfactory.cpp 2014-07-29 12:35:13 +0000
15+++ src/ubuntu/ubuntudeploystepfactory.cpp 2014-08-01 14:04:50 +0000
16@@ -29,10 +29,10 @@
17 return types;
18
19 Core::Id targetDevice = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->target()->kit());
20- if(targetDevice != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && targetDevice != Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID)
21+ if(targetDevice != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && !targetDevice.toString().startsWith(QLatin1String(Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID)))
22 return types;
23
24- bool isRemote = targetDevice == Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID;
25+ bool isRemote = targetDevice.toString().startsWith(QLatin1String(Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID));
26 bool isCMake = parent->target()->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID;
27 bool isHTML = parent->target()->project()->id() == Ubuntu::Constants::UBUNTUPROJECT_ID;
28 bool isQML = parent->target()->project()->id() == "QmlProjectManager.QmlProject";
29
30=== modified file 'src/ubuntu/ubuntudevice.cpp'
31--- src/ubuntu/ubuntudevice.cpp 2014-06-24 07:16:24 +0000
32+++ src/ubuntu/ubuntudevice.cpp 2014-08-01 14:04:50 +0000
33@@ -39,7 +39,7 @@
34 namespace Internal {
35
36 enum {
37- debug = 0
38+ debug = 1
39 };
40
41 const QLatin1String DEVICE_SETTINGS_VERSION("UbuntuDevice.Version");
42@@ -877,8 +877,8 @@
43 loadDefaultConfig();
44 }
45
46-UbuntuDevice::UbuntuDevice(const QString &name, ProjectExplorer::IDevice::MachineType machineType, ProjectExplorer::IDevice::Origin origin, Core::Id id)
47- : LinuxDevice(name,Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID),machineType,origin,id)
48+UbuntuDevice::UbuntuDevice(const QString &name, ProjectExplorer::IDevice::MachineType machineType, ProjectExplorer::IDevice::Origin origin, Core::Id id, const QString &architecture)
49+ : LinuxDevice(name,Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID).withSuffix(architecture),machineType,origin,id)
50 , m_helper(new UbuntuDeviceHelper(this))
51 , m_processState(NotStarted)
52 {
53@@ -1146,7 +1146,9 @@
54
55 QString UbuntuDevice::architecture() const
56 {
57- return m_architecture;
58+ QString arch = this->type().suffixAfter(Constants::UBUNTU_DEVICE_TYPE_ID);
59+ if(debug) qDebug()<<"Reporting device architecture as: "<<arch;
60+ return arch;
61 }
62
63 UbuntuDevice::FeatureState UbuntuDevice::hasNetworkConnection() const
64@@ -1233,7 +1235,7 @@
65
66 QString UbuntuDevice::displayType() const
67 {
68- return tr("Ubuntu Device");
69+ return tr("Ubuntu Device (%1)").arg(architecture());
70 }
71
72 ProjectExplorer::IDevice::Ptr UbuntuDevice::clone() const
73@@ -1274,9 +1276,9 @@
74 return qSharedPointerCast<const UbuntuDevice>(LinuxDevice::sharedFromThis());
75 }
76
77-UbuntuDevice::Ptr UbuntuDevice::create(const QString &name, const QString& serial, ProjectExplorer::IDevice::MachineType machineType, ProjectExplorer::IDevice::Origin origin)
78+UbuntuDevice::Ptr UbuntuDevice::create(const QString &name, const QString& serial, ProjectExplorer::IDevice::MachineType machineType, const QString &archName, ProjectExplorer::IDevice::Origin origin)
79 {
80- return Ptr(new UbuntuDevice(name,machineType,origin,Core::Id::fromSetting(serial)));
81+ return Ptr(new UbuntuDevice(name,machineType,origin,Core::Id::fromSetting(serial),archName));
82 }
83
84 //////////////
85
86=== modified file 'src/ubuntu/ubuntudevice.h'
87--- src/ubuntu/ubuntudevice.h 2014-06-16 15:02:01 +0000
88+++ src/ubuntu/ubuntudevice.h 2014-08-01 14:04:50 +0000
89@@ -155,7 +155,7 @@
90 virtual ~UbuntuDevice ();
91
92 static Ptr create();
93- static Ptr create(const QString &name,const QString &serial, MachineType machineType, Origin origin = ManuallyAdded);
94+ static Ptr create(const QString &name,const QString &serial, MachineType machineType, const QString &archName, Origin origin = ManuallyAdded);
95
96 QString serialNumber () const;
97 UbuntuDeviceHelper *helper () const;
98@@ -207,7 +207,7 @@
99 ConstPtr sharedFromThis() const;
100 protected:
101 UbuntuDevice();
102- UbuntuDevice(const QString &name,MachineType machineType, Origin origin, Core::Id id);
103+ UbuntuDevice(const QString &name,MachineType machineType, Origin origin, Core::Id id, const QString &architecture);
104 UbuntuDevice(const UbuntuDevice &other);
105 void loadDefaultConfig();
106 void setupPrivateKey ();
107
108=== modified file 'src/ubuntu/ubuntudevicefactory.cpp'
109--- src/ubuntu/ubuntudevicefactory.cpp 2014-06-02 09:48:49 +0000
110+++ src/ubuntu/ubuntudevicefactory.cpp 2014-08-01 14:04:50 +0000
111@@ -20,10 +20,18 @@
112 #include "ubuntudevice.h"
113
114 #include <utils/qtcassert.h>
115+#include <QDir>
116+#include <QFile>
117+#include <QTextStream>
118+#include <QStandardPaths>
119
120 namespace Ubuntu {
121 namespace Internal {
122
123+//copied from IDevice
124+const char TypeKey[] = "OsType";
125+const char MachineTypeKey[] = "Type";
126+
127 UbuntuDeviceFactory::UbuntuDeviceFactory(QObject *parent) : ProjectExplorer::IDeviceFactory(parent)
128 {
129 }
130@@ -34,13 +42,16 @@
131
132 QString Ubuntu::Internal::UbuntuDeviceFactory::displayNameForId(Core::Id type) const
133 {
134- QTC_ASSERT(type == Constants::UBUNTU_DEVICE_TYPE_ID, return QString());
135- return tr("Ubuntu Device");
136+ QTC_ASSERT(type.toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)), return QString());
137+
138+ return tr("Ubuntu Device (%1)").arg(type.suffixAfter(Constants::UBUNTU_DEVICE_TYPE_ID));
139 }
140
141 QList<Core::Id> Ubuntu::Internal::UbuntuDeviceFactory::availableCreationIds() const
142 {
143- return QList<Core::Id>() << Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID);
144+ return QList<Core::Id>()
145+ << Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID).withSuffix("armhf")
146+ << Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID).withSuffix("i386");
147 }
148
149 bool Ubuntu::Internal::UbuntuDeviceFactory::canCreate() const
150@@ -56,12 +67,58 @@
151
152 bool Ubuntu::Internal::UbuntuDeviceFactory::canRestore(const QVariantMap &map) const
153 {
154- return ProjectExplorer::IDevice::typeFromMap(map) == Constants::UBUNTU_DEVICE_TYPE_ID;
155+ return ProjectExplorer::IDevice::typeFromMap(map).toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID));
156 }
157
158 ProjectExplorer::IDevice::Ptr Ubuntu::Internal::UbuntuDeviceFactory::restore(const QVariantMap &map) const
159 {
160 QTC_ASSERT(canRestore(map), return UbuntuDevice::Ptr());
161+
162+ //fix up old device types
163+ if ( ProjectExplorer::IDevice::typeFromMap(map) == Constants::UBUNTU_DEVICE_TYPE_ID ) {
164+ //if those values are not available in the map we can not restore the devices anyway, its better to
165+ //return invalid device in that case
166+ QTC_ASSERT(map.contains(QLatin1String(TypeKey)), return UbuntuDevice::Ptr());
167+ QTC_ASSERT(map.contains(QLatin1String(MachineTypeKey)), return UbuntuDevice::Ptr());
168+
169+ Core::Id newType;
170+
171+ ProjectExplorer::IDevice::MachineType mType =
172+ static_cast<ProjectExplorer::IDevice::MachineType>(map.value(QLatin1String(MachineTypeKey),
173+ ProjectExplorer::IDevice::Hardware).toInt());
174+ if (mType == ProjectExplorer::IDevice::Emulator) {
175+ QString emuName = ProjectExplorer::IDevice::idFromMap(map).toSetting().toString();
176+ QString emuArchFileName = QStringLiteral("%1/ubuntu-emulator/%2/.device")
177+ .arg(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation))
178+ .arg(emuName);
179+
180+ QString archType;
181+ if (QFile::exists(emuArchFileName)) {
182+ QFile emuArchFile(emuArchFileName);
183+ if (emuArchFile.open(QIODevice::ReadOnly)) {
184+ QTextStream in(&emuArchFile);
185+ archType = in.readAll().simplified();
186+ }
187+ }
188+
189+ if (archType.isEmpty()) {
190+ //if there is no arch file, make a guess
191+ archType = QStringLiteral("i386");
192+ }
193+
194+ newType = Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID).withSuffix(archType);
195+ } else {
196+ newType = Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID).withSuffix("armhf");
197+ }
198+
199+ QVariantMap newMap = map;
200+ newMap[QLatin1String(TypeKey)] = newType.toString();
201+
202+ const ProjectExplorer::IDevice::Ptr device = UbuntuDevice::create();
203+ device->fromMap(newMap);
204+ return device;
205+ }
206+
207 const ProjectExplorer::IDevice::Ptr device = UbuntuDevice::create();
208 device->fromMap(map);
209 return device;
210
211=== modified file 'src/ubuntu/ubuntudevicesmodel.cpp'
212--- src/ubuntu/ubuntudevicesmodel.cpp 2014-07-31 10:39:40 +0000
213+++ src/ubuntu/ubuntudevicesmodel.cpp 2014-08-01 14:04:50 +0000
214@@ -418,7 +418,7 @@
215 ProjectExplorer::DeviceManager* devMgr = ProjectExplorer::DeviceManager::instance();
216 for(int i = 0; i < devMgr->deviceCount(); i++) {
217 ProjectExplorer::IDevice::ConstPtr dev = devMgr->deviceAt(i);
218- if(dev && dev->type() == Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID)) {
219+ if(dev && dev->type().toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID))) {
220
221 //ugly hack to get a mutable version of the device
222 //no idea why its necessary to lock it up
223@@ -499,7 +499,7 @@
224 if(!ptr)
225 return;
226
227- if(ptr->type() != Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID))
228+ if(!ptr->type().toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)))
229 return;
230
231 if(debug) qDebug()<<"Device Manager reports device added: "<<id.toString();
232@@ -572,7 +572,7 @@
233 * will happen automatically when the device is
234 * registered in the device manager
235 */
236-void UbuntuDevicesModel::registerNewDevice(const QString &serial)
237+void UbuntuDevicesModel::registerNewDevice(const QString &serial, const QString &arch)
238 {
239 if(findDevice(Core::Id::fromSetting(serial).uniqueIdentifier()) >= 0)
240 return;
241@@ -581,6 +581,7 @@
242 tr("Ubuntu Device")
243 , serial
244 , ProjectExplorer::IDevice::Hardware
245+ , arch
246 , ProjectExplorer::IDevice::AutoDetected);
247
248 ProjectExplorer::DeviceManager::instance()->addDevice(dev);
249@@ -931,6 +932,7 @@
250 QRegularExpression regexUbuntu (QStringLiteral("ubuntu=([0-9]+)"));
251 QRegularExpression regexDevice (QStringLiteral("device=([0-9]+)"));
252 QRegularExpression regexVersion(QStringLiteral("version=([0-9]+)"));
253+ QRegularExpression regexArch (QStringLiteral("arch=(\\w+)"));
254 while (iter.hasNext()) {
255 QString line = iter.next();
256 if(line.isEmpty()) {
257@@ -944,6 +946,7 @@
258 QRegularExpressionMatch mUbu = regexUbuntu.match(line);
259 QRegularExpressionMatch mDev = regexDevice.match(line);
260 QRegularExpressionMatch mVer = regexVersion.match(line);
261+ QRegularExpressionMatch mArch = regexArch.match(line);
262
263
264 if(!mName.hasMatch())
265@@ -956,6 +959,7 @@
266 QString ubuntuVer = tr("unknown");
267 QString deviceVer = tr("unknown");
268 QString imageVer = tr("unknown");
269+ QString archType = QStringLiteral("i386");
270
271 if(mUbu.hasMatch())
272 ubuntuVer = mUbu.captured(1);
273@@ -966,6 +970,9 @@
274 if(mVer.hasMatch())
275 imageVer = mVer.captured(1);
276
277+ if(mArch.hasMatch())
278+ archType = mArch.captured(1);
279+
280 bool addToManager = false;
281 Ubuntu::Internal::UbuntuDevice::Ptr dev;
282 Core::Id devId = Core::Id::fromSetting(deviceSerial);
283@@ -979,6 +986,7 @@
284 deviceSerial,
285 deviceSerial,
286 ProjectExplorer::IDevice::Emulator,
287+ archType,
288 ProjectExplorer::IDevice::AutoDetected);
289
290 addToManager = true;
291@@ -1028,7 +1036,18 @@
292
293 if (lineData.count() == 2) {
294 QString sSerialNumber = lineData.takeFirst();
295- //QString sDeviceInfo = lineData.takeFirst();
296+ QString sDeviceInfo = lineData.takeFirst();
297+
298+ QRegularExpression archExp(QStringLiteral("arch:([\\w]+)"));
299+ QRegularExpressionMatch archMatch = archExp.match(sDeviceInfo);
300+
301+ QString arch = QStringLiteral("armhf");
302+ if(archMatch.hasMatch()) {
303+ arch = archMatch.captured(1);
304+ } else {
305+ qDebug()<<"Could not get the architecture from: "<<sDeviceInfo<<" defaulting to armhf";
306+ }
307+
308
309 //sometimes the adb server is not started when adb devices is
310 //executed, we just skip those lines
311@@ -1044,7 +1063,7 @@
312 continue;
313 }
314
315- registerNewDevice(sSerialNumber);
316+ registerNewDevice(sSerialNumber,arch);
317 }
318 }
319 }
320
321=== modified file 'src/ubuntu/ubuntudevicesmodel.h'
322--- src/ubuntu/ubuntudevicesmodel.h 2014-07-30 16:52:15 +0000
323+++ src/ubuntu/ubuntudevicesmodel.h 2014-08-01 14:04:50 +0000
324@@ -118,7 +118,7 @@
325 UbuntuDevicesItem *createItem (UbuntuDevice::Ptr dev);
326 int indexFromHelper (QObject* possibleHelper);
327 void deviceChanged(QObject* possibleHelper, const QVector<int> &relatedRoles);
328- void registerNewDevice(const QString &serial);
329+ void registerNewDevice(const QString &serial, const QString &arch);
330
331 void setState(UbuntuDevicesModel::State newState);
332 void setBusy(bool arg);
333
334=== modified file 'src/ubuntu/ubuntukitmanager.cpp'
335--- src/ubuntu/ubuntukitmanager.cpp 2014-07-29 07:58:30 +0000
336+++ src/ubuntu/ubuntukitmanager.cpp 2014-08-01 14:04:50 +0000
337@@ -11,6 +11,7 @@
338 #include <projectexplorer/toolchain.h>
339 #include <projectexplorer/toolchainmanager.h>
340 #include <projectexplorer/kitinformation.h>
341+#include <projectexplorer/devicesupport/devicemanager.h>
342 #include <debugger/debuggeritemmanager.h>
343 #include <debugger/debuggerkitinformation.h>
344 #include <qtsupport/qtkitinformation.h>
345@@ -19,6 +20,7 @@
346 #include <qtsupport/qtversionmanager.h>
347
348 #include <QMessageBox>
349+#include <QRegularExpression>
350 #include <QTextStream>
351
352 namespace Ubuntu {
353@@ -314,6 +316,10 @@
354
355 ProjectExplorer::SysRootKitInformation::setSysRoot(newKit,Utils::FileName::fromString(UbuntuClickTool::targetBasePath(tc->clickTarget())));
356
357+ //we always want a ubuntu device
358+ Core::Id devTypeId = Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID).withSuffix(tc->clickTarget().architecture);
359+ ProjectExplorer::DeviceTypeKitInformation::setDeviceTypeId(newKit,devTypeId);
360+
361 //@TODO add gdbserver support
362 QtSupport::QtKitInformation::setQtVersion(newKit, createOrFindQtVersion(tc));
363 return newKit;
364@@ -378,9 +384,49 @@
365
366 //make sure we point to a ubuntu device
367 Core::Id devId = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k);
368- if(devId != Constants::UBUNTU_DEVICE_TYPE_ID || !devId.isValid()) {
369- ProjectExplorer::DeviceTypeKitInformation::setDeviceTypeId(k,Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID));
370- ProjectExplorer::DeviceKitInformation::setDevice(k,ProjectExplorer::IDevice::ConstPtr());
371+ if ( !devId.isValid() || //invalid type
372+ devId == Constants::UBUNTU_DEVICE_TYPE_ID || //Kit uses still the old device type ids
373+ !devId.toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)) //kit has a wrong device type
374+ ) {
375+
376+ //if this kit still uses the old type ids, we try to find the correct device by name
377+ bool doMigration = (devId == Constants::UBUNTU_DEVICE_TYPE_ID);
378+
379+ //a old kit with a incorrect device ID, lets set the correct device type id
380+ Core::Id devTypeId = Core::Id(Constants::UBUNTU_DEVICE_TYPE_ID).withSuffix(tc->clickTarget().architecture);
381+ ProjectExplorer::DeviceTypeKitInformation::setDeviceTypeId(k,devTypeId);
382+
383+ if (doMigration) {
384+ UbuntuDevice::ConstPtr fuzzyMatch;
385+ UbuntuDevice::ConstPtr fullMatch;
386+
387+ //lets search for a device
388+ ProjectExplorer::DeviceManager *devMgr = ProjectExplorer::DeviceManager::instance();
389+ for (int i = 0; i<devMgr->deviceCount(); i++) {
390+ ProjectExplorer::IDevice::ConstPtr dev = devMgr->deviceAt(i);
391+ if(!dev)
392+ continue;
393+
394+ //the type ID also checks if the architecture is correct
395+ if(dev->type() != devTypeId)
396+ continue;
397+
398+ UbuntuDevice::ConstPtr ubuntuDev = qSharedPointerCast<const UbuntuDevice>(dev);
399+
400+ //we found a possible Device!
401+ if(!fuzzyMatch)
402+ fuzzyMatch = ubuntuDev;
403+
404+ //this is most likely the device that was used with this kit by using the autocreate button
405+ QRegularExpression regExp (QStringLiteral("^(%1\\s+\\(.*\\))$").arg(ubuntuDev->displayName()));
406+ QRegularExpressionMatch m = regExp.match(ubuntuDev->displayName());
407+ if (m.hasMatch()) {
408+ fullMatch = ubuntuDev;
409+ break;
410+ }
411+ }
412+ ProjectExplorer::DeviceKitInformation::setDevice(k,!fullMatch.isNull() ? fullMatch : fuzzyMatch);
413+ }
414 }
415
416 //values the user can change
417
418=== modified file 'src/ubuntu/ubuntulocalrunconfigurationfactory.cpp'
419--- src/ubuntu/ubuntulocalrunconfigurationfactory.cpp 2014-07-29 12:35:13 +0000
420+++ src/ubuntu/ubuntulocalrunconfigurationfactory.cpp 2014-08-01 14:04:50 +0000
421@@ -42,12 +42,12 @@
422 QList<Core::Id> types;
423
424 Core::Id targetDevice = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit());
425- if(targetDevice != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && targetDevice != Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID) {
426+ if(targetDevice != ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE && !targetDevice.toString().startsWith(QLatin1String(Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID))) {
427 if(debug) qDebug()<<"Rejecting device type: "<<targetDevice.toString();
428 return types;
429 }
430
431- bool isRemote = targetDevice == Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID;
432+ bool isRemote = targetDevice.toString().startsWith(QLatin1String(Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID));
433 bool isCMake = parent->project()->id() == CMakeProjectManager::Constants::CMAKEPROJECT_ID;
434 bool isHTML = parent->project()->id() == Ubuntu::Constants::UBUNTUPROJECT_ID;
435 bool isApp = UbuntuProjectGuesser::isClickAppProject(parent->project());
436
437=== modified file 'src/ubuntu/ubuntupackagestep.cpp'
438--- src/ubuntu/ubuntupackagestep.cpp 2014-07-29 12:35:13 +0000
439+++ src/ubuntu/ubuntupackagestep.cpp 2014-08-01 14:04:50 +0000
440@@ -455,7 +455,7 @@
441 return;
442 }
443
444- bool ubuntuDevice = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(bc->target()->kit()) == Constants::UBUNTU_DEVICE_TYPE_ID;
445+ bool ubuntuDevice = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(bc->target()->kit()).toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID));
446 bool injectDebugScript = (m_packageMode == EnableDebugScript) ||
447 (m_packageMode == AutoEnableDebugScript && bc->buildType() == ProjectExplorer::BuildConfiguration::Debug)
448 || (m_packageMode == AutoEnableDebugScript && bc->target()->project()->id() == "QmlProjectManager.QmlProject");
449
450=== modified file 'src/ubuntu/ubuntupackagingwidget.cpp'
451--- src/ubuntu/ubuntupackagingwidget.cpp 2014-07-30 07:30:29 +0000
452+++ src/ubuntu/ubuntupackagingwidget.cpp 2014-08-01 14:04:50 +0000
453@@ -757,7 +757,7 @@
454 ProjectExplorer::IDevice::ConstPtr dev = ProjectExplorer::DeviceKitInformation::device(pckStep->target()->kit());
455 if (!dev)
456 break; //fall through to clear buildsteps
457- if (dev->type() != Constants::UBUNTU_DEVICE_TYPE_ID)
458+ if (!dev->type().toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)))
459 break; //fall through to clear buildsteps
460
461 UbuntuDevice::ConstPtr ubuntuDev = qSharedPointerCast<const UbuntuDevice>(dev);
462@@ -817,7 +817,7 @@
463 if(!k)
464 return;
465
466- if(ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k) != Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID) {
467+ if(!ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(k).toString().startsWith(QLatin1String(Ubuntu::Constants::UBUNTU_DEVICE_TYPE_ID))) {
468 QMessageBox::warning(this,tr("Wrong kit type"),tr("It is not supported to create click packages for a non UbuntuSDK target"));
469 return;
470 }
471
472=== modified file 'src/ubuntu/ubunturemoteanalyzesupport.cpp'
473--- src/ubuntu/ubunturemoteanalyzesupport.cpp 2014-06-24 07:16:24 +0000
474+++ src/ubuntu/ubunturemoteanalyzesupport.cpp 2014-08-01 14:04:50 +0000
475@@ -93,7 +93,7 @@
476 runner->setEnv(environment());
477 runner->setQmlDebugPort(d->qmlPort);
478
479- QTC_ASSERT(device()->type() == Constants::UBUNTU_DEVICE_TYPE_ID,return);
480+ QTC_ASSERT(device()->type().toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)),return);
481 runner->start(qSharedPointerCast<const UbuntuDevice>(device()),clickPackage());
482 }
483
484
485=== modified file 'src/ubuntu/ubunturemotedebugsupport.cpp'
486--- src/ubuntu/ubunturemotedebugsupport.cpp 2014-06-13 14:50:30 +0000
487+++ src/ubuntu/ubunturemotedebugsupport.cpp 2014-08-01 14:04:50 +0000
488@@ -128,7 +128,7 @@
489 connect(launcher, SIGNAL(finished(bool)), SLOT(handleAppRunnerFinished(bool)));
490 connect(launcher, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString)));
491
492- QTC_ASSERT(device()->type() == Constants::UBUNTU_DEVICE_TYPE_ID,return);
493+ QTC_ASSERT(device()->type().toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)),return);
494 launcher->start(qSharedPointerCast<const UbuntuDevice>(device()),clickPackage());
495 }
496
497
498=== modified file 'src/ubuntu/ubunturemotedeployconfiguration.cpp'
499--- src/ubuntu/ubunturemotedeployconfiguration.cpp 2014-07-29 12:35:13 +0000
500+++ src/ubuntu/ubunturemotedeployconfiguration.cpp 2014-08-01 14:04:50 +0000
501@@ -90,7 +90,7 @@
502 return ids;
503
504 const Core::Id devType = ProjectExplorer::DeviceTypeKitInformation::deviceTypeId(parent->kit());
505- if (devType == Constants::UBUNTU_DEVICE_TYPE_ID && !UbuntuProjectGuesser::isScopesProject(parent->project()))
506+ if (devType.toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)) && !UbuntuProjectGuesser::isScopesProject(parent->project()))
507 ids << Core::Id(Constants::UBUNTU_DEPLOYCONFIGURATION_ID);
508
509 return ids;

Subscribers

People subscribed via source and target branches