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

Proposed by Benjamin Zeller on 2016-07-20
Status: Merged
Merged at revision: 467
Proposed branch: lp:~zeller-benjamin/qtcreator-plugin-ubuntu/qtc41-beta
Merge into: lp:qtcreator-plugin-ubuntu
Diff against target: 3158 lines (+596/-466)
70 files modified
UbuntuPlugin.pro (+6/-6)
src/ubuntu/clicktoolchain.cpp (+25/-14)
src/ubuntu/clicktoolchain.h (+4/-3)
src/ubuntu/device/container/containerdeviceprocess.cpp (+17/-15)
src/ubuntu/device/container/containerdeviceprocess.h (+1/-3)
src/ubuntu/device/container/ubuntulocaldeployconfiguration.cpp (+1/-1)
src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp (+21/-3)
src/ubuntu/device/container/ubuntulocalrunconfiguration.h (+8/-8)
src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp (+1/-1)
src/ubuntu/device/container/ubuntulocalruncontrolfactory.cpp (+54/-22)
src/ubuntu/device/container/ubuntulocalscopedebugsupport.cpp (+7/-8)
src/ubuntu/device/container/ubuntulocalscopedebugsupport.h (+1/-1)
src/ubuntu/device/remote/abstractremoterunsupport.cpp (+6/-5)
src/ubuntu/device/remote/abstractremoterunsupport.h (+1/-1)
src/ubuntu/device/remote/ubuntudeploystepfactory.cpp (+25/-38)
src/ubuntu/device/remote/ubuntudeploystepfactory.h (+4/-5)
src/ubuntu/device/remote/ubuntudevice.cpp (+9/-13)
src/ubuntu/device/remote/ubuntudevice.h (+1/-4)
src/ubuntu/device/remote/ubuntudevicesignaloperation.cpp (+3/-3)
src/ubuntu/device/remote/ubuntudevicesignaloperation.h (+3/-3)
src/ubuntu/device/remote/ubuntudirectuploadstep.cpp (+16/-13)
src/ubuntu/device/remote/ubuntudirectuploadstep.h (+3/-0)
src/ubuntu/device/remote/ubunturemoteanalyzesupport.cpp (+18/-15)
src/ubuntu/device/remote/ubunturemoteanalyzesupport.h (+2/-2)
src/ubuntu/device/remote/ubunturemotedebugsupport.cpp (+17/-9)
src/ubuntu/device/remote/ubunturemoterunconfiguration.cpp (+20/-5)
src/ubuntu/device/remote/ubunturemoterunconfiguration.h (+8/-8)
src/ubuntu/device/remote/ubunturemoteruncontrol.cpp (+2/-2)
src/ubuntu/device/remote/ubunturemoteruncontrolfactory.cpp (+51/-20)
src/ubuntu/device/remote/ubunturemoterunner.cpp (+1/-1)
src/ubuntu/localportsmanager.cpp (+5/-5)
src/ubuntu/ubuntuabstractguieditordocument.cpp (+0/-10)
src/ubuntu/ubuntuabstractguieditordocument.h (+0/-4)
src/ubuntu/ubuntuclickdialog.cpp (+1/-1)
src/ubuntu/ubuntuclicktool.cpp (+17/-6)
src/ubuntu/ubuntuclicktool.h (+3/-1)
src/ubuntu/ubuntucmakecache.cpp (+1/-0)
src/ubuntu/ubuntuconstants.h (+2/-0)
src/ubuntu/ubuntudevicemode.cpp (+0/-6)
src/ubuntu/ubuntudevicemode.h (+0/-3)
src/ubuntu/ubuntudevicesmodel.cpp (+45/-44)
src/ubuntu/ubuntudevicesmodel.h (+9/-9)
src/ubuntu/ubuntufixmanifeststep.cpp (+2/-1)
src/ubuntu/ubuntufixmanifeststep.h (+1/-1)
src/ubuntu/ubuntuhtmlbuildconfiguration.cpp (+2/-1)
src/ubuntu/ubuntukitmanager.cpp (+17/-7)
src/ubuntu/ubuntumenu.cpp (+1/-1)
src/ubuntu/ubuntupackagestep.cpp (+19/-17)
src/ubuntu/ubuntupackagestep.h (+1/-1)
src/ubuntu/ubuntupackagingmode.cpp (+0/-6)
src/ubuntu/ubuntupackagingmode.h (+0/-3)
src/ubuntu/ubuntupackagingmodel.cpp (+2/-2)
src/ubuntu/ubuntuplugin.cpp (+2/-2)
src/ubuntu/ubuntuplugin.h (+0/-1)
src/ubuntu/ubuntuproject.cpp (+7/-8)
src/ubuntu/ubuntuproject.h (+4/-2)
src/ubuntu/ubuntuprojectfile.cpp (+0/-8)
src/ubuntu/ubuntuprojectfile.h (+0/-4)
src/ubuntu/ubuntuprojectnode.cpp (+1/-1)
src/ubuntu/ubuntuqmlbuildconfiguration.cpp (+33/-38)
src/ubuntu/ubuntuqmlbuildconfiguration.h (+7/-7)
src/ubuntu/ubuntuqtversion.cpp (+50/-15)
src/ubuntu/ubuntuqtversion.h (+5/-3)
src/ubuntu/ubuntuwelcomemode.cpp (+5/-1)
src/ubuntu/wizards/createtargetwizard.cpp (+1/-1)
src/ubuntu/wizards/ubuntufatpackagingwizard.cpp (+1/-1)
src/ubuntu/wizards/ubuntufirstrunwizard.cpp (+1/-1)
src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp (+9/-6)
src/ubuntu/wizards/ubuntuprojectapplicationwizard.h (+1/-1)
src/ubuntu/wizards/ubuntuprojectmigrationwizard.cpp (+5/-5)
To merge this branch: bzr merge lp:~zeller-benjamin/qtcreator-plugin-ubuntu/qtc41-beta
Reviewer Review Type Date Requested Status
Zoltan Balogh 2016-07-20 Pending
Review via email: mp+300621@code.launchpad.net

Commit message

- Make QtC-P-U actually compile against Qt 4.1 beta

Description of the change

- Make QtC-P-U actually compile against Qt 4.1 beta

To post a comment you must log in.
467. By Benjamin Zeller on 2016-08-18

- More fixes
- Upgrading to latest QtC checkout

468. By Benjamin Zeller on 2016-08-18

Merge trunk

469. By Benjamin Zeller on 2016-08-24

Fix the profiler

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UbuntuPlugin.pro'
2--- UbuntuPlugin.pro 2016-05-17 16:33:36 +0000
3+++ UbuntuPlugin.pro 2016-08-24 15:35:12 +0000
4@@ -52,9 +52,9 @@
5 src/ubuntu/ubuntuproject.cpp \
6 src/ubuntu/ubuntuprojectfile.cpp \
7 src/ubuntu/ubuntuprojectnode.cpp \
8- src/ubuntu/ubuntuversion.cpp \
9- src/ubuntu/ubuntufeatureprovider.cpp \
10- src/ubuntu/ubuntuversionmanager.cpp \
11+ #src/ubuntu/ubuntuversion.cpp \
12+ #src/ubuntu/ubuntufeatureprovider.cpp \
13+ #src/ubuntu/ubuntuversionmanager.cpp \
14 src/ubuntu/ubuntupackagingmode.cpp \
15 src/ubuntu/ubuntubzr.cpp \
16 src/ubuntu/ubuntuclickmanifest.cpp \
17@@ -121,9 +121,9 @@
18 src/ubuntu/ubuntuproject.h \
19 src/ubuntu/ubuntuprojectfile.h \
20 src/ubuntu/ubuntuprojectnode.h \
21- src/ubuntu/ubuntuversion.h \
22- src/ubuntu/ubuntufeatureprovider.h \
23- src/ubuntu/ubuntuversionmanager.h \
24+ #src/ubuntu/ubuntuversion.h \
25+ #src/ubuntu/ubuntufeatureprovider.h \
26+ #src/ubuntu/ubuntuversionmanager.h \
27 src/ubuntu/ubuntupackagingmode.h \
28 src/ubuntu/ubuntubzr.h \
29 src/ubuntu/ubuntuclickmanifest.h \
30
31=== modified file 'src/ubuntu/clicktoolchain.cpp'
32--- src/ubuntu/clicktoolchain.cpp 2016-03-18 13:13:22 +0000
33+++ src/ubuntu/clicktoolchain.cpp 2016-08-24 15:35:12 +0000
34@@ -20,6 +20,7 @@
35 #include "ubuntuconstants.h"
36
37 #include <utils/fileutils.h>
38+#include <utils/algorithm.h>
39 #include <projectexplorer/abi.h>
40 #include <QDebug>
41 #include <QVariant>
42@@ -79,11 +80,6 @@
43 return Utils::FileName::fromString(QLatin1String("/usr/bin/gdb-multiarch"));
44 }
45
46-QString ClickToolChain::type() const
47-{
48- return QString::fromLatin1(Constants::UBUNTU_CLICK_TOOLCHAIN_ID);
49-}
50-
51 QString ClickToolChain::typeDisplayName() const
52 {
53 return ClickToolChainFactory::tr("Ubuntu GCC");
54@@ -139,6 +135,11 @@
55 return clickArchitectures.keys();
56 }
57
58+QString ClickToolChain::remoteCompilerCommand() const
59+{
60+ return QString::fromLatin1("/usr/bin/%1").arg(compilerCommand().fileName());
61+}
62+
63 QVariantMap ClickToolChain::toMap() const
64 {
65 QVariantMap map = GccToolChain::toMap();
66@@ -196,7 +197,7 @@
67 }
68
69 ClickToolChain::ClickToolChain(const UbuntuClickTool::Target &target, Detection d)
70- : GccToolChain(QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID), d)
71+ : GccToolChain(Constants::UBUNTU_CLICK_TOOLCHAIN_ID, d)
72 , m_clickTarget(target)
73 {
74 resetToolChain(Utils::FileName::fromString(
75@@ -216,24 +217,24 @@
76 }
77
78 ClickToolChain::ClickToolChain()
79- : GccToolChain(QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID),ManualDetection)
80+ : GccToolChain(Constants::UBUNTU_CLICK_TOOLCHAIN_ID,ManualDetection)
81 {
82 }
83
84 ClickToolChainFactory::ClickToolChainFactory()
85 {
86- setId(Constants::UBUNTU_CLICK_TOOLCHAIN_ID);
87 setDisplayName(tr("Ubuntu GCC"));
88 }
89
90-QList<ProjectExplorer::ToolChain *> ClickToolChainFactory::autoDetect()
91+QList<ProjectExplorer::ToolChain *> ClickToolChainFactory::autoDetect(
92+ const QList<ProjectExplorer::ToolChain *> &alreadyKnown)
93 {
94- return createToolChainsForClickTargets();
95+ return createToolChainsForClickTargets(alreadyKnown);
96 }
97
98 bool ClickToolChainFactory::canRestore(const QVariantMap &data)
99 {
100- return idFromMap(data).startsWith(QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID) + QLatin1Char(':'));
101+ return typeIdFromMap(data) == Constants::UBUNTU_CLICK_TOOLCHAIN_ID;
102 }
103
104 ProjectExplorer::ToolChain *ClickToolChainFactory::restore(const QVariantMap &data)
105@@ -259,7 +260,7 @@
106 return 0;
107 }
108
109-QList<ProjectExplorer::ToolChain *> ClickToolChainFactory::createToolChainsForClickTargets()
110+QList<ProjectExplorer::ToolChain *> ClickToolChainFactory::createToolChainsForClickTargets(const QList<ProjectExplorer::ToolChain *> &alreadyKnown)
111 {
112 QList<ProjectExplorer::ToolChain*> toolChains;
113
114@@ -270,10 +271,20 @@
115 if(!clickArchitectures.contains(target.architecture))
116 continue;
117
118- if(UbuntuClickTool::findOrCreateGccWrapper(target).isEmpty())
119+ QString comp = UbuntuClickTool::findOrCreateGccWrapper(target);
120+ if(comp.isEmpty())
121 continue;
122
123- ClickToolChain* tc = new ClickToolChain(target, ProjectExplorer::ToolChain::AutoDetection);
124+ auto predicate = [&](ProjectExplorer::ToolChain *tc) {
125+ if (tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
126+ return false;
127+ auto clickTc = static_cast<ClickToolChain *>(tc);
128+ return clickTc->clickTarget().containerName == target.containerName;
129+ };
130+
131+ ProjectExplorer::ToolChain *tc = Utils::findOrDefault(alreadyKnown, predicate);
132+ if (!tc)
133+ tc = new ClickToolChain(target, ProjectExplorer::ToolChain::AutoDetection);
134 toolChains.append(tc);
135 }
136
137
138=== modified file 'src/ubuntu/clicktoolchain.h'
139--- src/ubuntu/clicktoolchain.h 2015-06-30 13:34:14 +0000
140+++ src/ubuntu/clicktoolchain.h 2016-08-24 15:35:12 +0000
141@@ -37,7 +37,6 @@
142
143 virtual QList<Utils::FileName> suggestedMkspecList() const override;
144 virtual Utils::FileName suggestedDebugger() const override;
145- virtual QString type() const override;
146 virtual QString typeDisplayName() const override;
147 virtual bool isValid() const override;
148 virtual void addToEnvironment(Utils::Environment &env) const override;
149@@ -53,6 +52,8 @@
150 static ProjectExplorer::Abi architectureNameToAbi ( const QString &arch );
151 static QList<QString> supportedArchitectures ();
152
153+ QString remoteCompilerCommand () const;
154+
155 protected:
156 virtual bool fromMap(const QVariantMap &data) override;
157
158@@ -75,11 +76,11 @@
159
160 // ToolChainFactory interface
161 public:
162- virtual QList<ProjectExplorer::ToolChain *> autoDetect() override;
163+ virtual QList<ProjectExplorer::ToolChain *> autoDetect(const QList<ProjectExplorer::ToolChain *> &alreadyKnown) override;
164 virtual bool canRestore(const QVariantMap &data) override;
165 virtual ProjectExplorer::ToolChain *restore(const QVariantMap &data) override;
166
167- static QList<ProjectExplorer::ToolChain *> createToolChainsForClickTargets();
168+ static QList<ProjectExplorer::ToolChain *> createToolChainsForClickTargets(const QList<ProjectExplorer::ToolChain *> &alreadyKnown);
169 };
170
171 } // namespace Internal
172
173=== modified file 'src/ubuntu/device/container/containerdeviceprocess.cpp'
174--- src/ubuntu/device/container/containerdeviceprocess.cpp 2016-05-23 07:26:49 +0000
175+++ src/ubuntu/device/container/containerdeviceprocess.cpp 2016-08-24 15:35:12 +0000
176@@ -3,6 +3,7 @@
177
178 #include <utils/qtcassert.h>
179 #include <utils/qtcprocess.h>
180+#include <projectexplorer/runnables.h>
181
182 #include <QProcess>
183 #include <QDebug>
184@@ -30,13 +31,11 @@
185 };
186
187 connect(cleaner, &SshDeviceProcess::finished, callback);
188- cleaner->start(QStringLiteral("rm"), QStringList{m_pidFile});
189-}
190
191-void ContainerDeviceProcess::setWorkingDirectory(const QString &directory)
192-{
193- m_workingDir = directory;
194- LinuxDeviceProcess::setWorkingDirectory(directory);
195+ ProjectExplorer::StandardRunnable r;
196+ r.executable = QStringLiteral("rm");
197+ r.commandLineArguments = m_pidFile;
198+ cleaner->start(r);
199 }
200
201 void ContainerDeviceProcess::doSignal(const int sig)
202@@ -50,11 +49,14 @@
203 }
204 signaler->deleteLater();
205 });
206- QString cmd = QString::fromLatin1("kill -%2 `cat %1`").arg(m_pidFile).arg(sig);
207- signaler->start(cmd, QStringList());
208+
209+ ProjectExplorer::StandardRunnable r;
210+ r.executable = QStringLiteral("kill");
211+ r.commandLineArguments = QString::fromLatin1("-%2 `cat %1`").arg(m_pidFile).arg(sig);
212+ signaler->start(r);
213 }
214
215-QString ContainerDeviceProcess::fullCommandLine() const
216+QString ContainerDeviceProcess::fullCommandLine(const ProjectExplorer::StandardRunnable &runnable) const
217 {
218 QString fullCommandLine;
219 QStringList rcFiles {
220@@ -63,12 +65,12 @@
221 };
222 foreach (const QString &filePath, rcFiles)
223 fullCommandLine += QString::fromLatin1("test -f %1 && . %1;").arg(filePath);
224- if (!m_workingDir.isEmpty()) {
225- fullCommandLine.append(QLatin1String("cd ")).append(Utils::QtcProcess::quoteArgUnix(m_workingDir))
226+ if (runnable.workingDirectory.isEmpty()) {
227+ fullCommandLine.append(QLatin1String("cd ")).append(Utils::QtcProcess::quoteArgUnix(runnable.workingDirectory))
228 .append(QLatin1String(" && "));
229 }
230 QString envString;
231- for (auto it = environment().constBegin(); it != environment().constEnd(); ++it) {
232+ for (auto it = runnable.environment.constBegin(); it != runnable.environment.constEnd(); ++it) {
233 if (!envString.isEmpty())
234 envString += QLatin1Char(' ');
235 envString.append(it.key()).append(QLatin1String("='")).append(it.value())
236@@ -82,10 +84,10 @@
237
238 fullCommandLine.append(Utils::QtcProcess::quoteArgUnix(QStringLiteral("dbus-run-session")));
239 fullCommandLine += QString::fromLatin1(" bash -c \"echo \\$\\$ > %1; exec ").arg(m_pidFile);
240- fullCommandLine.append(Utils::QtcProcess::quoteArgUnix(executable()));
241- if (!arguments().isEmpty()) {
242+ fullCommandLine.append(Utils::QtcProcess::quoteArgUnix(runnable.executable));
243+ if (!runnable.commandLineArguments.isEmpty()) {
244 fullCommandLine.append(QLatin1Char(' '));
245- fullCommandLine.append(Utils::QtcProcess::joinArgs(arguments(), Utils::OsTypeLinux));
246+ fullCommandLine.append(runnable.commandLineArguments);
247 }
248 fullCommandLine.append(QStringLiteral("\""));
249 return fullCommandLine;
250
251=== modified file 'src/ubuntu/device/container/containerdeviceprocess.h'
252--- src/ubuntu/device/container/containerdeviceprocess.h 2016-04-08 09:01:23 +0000
253+++ src/ubuntu/device/container/containerdeviceprocess.h 2016-08-24 15:35:12 +0000
254@@ -17,7 +17,6 @@
255 public:
256 ContainerDeviceProcess(const QSharedPointer<const ProjectExplorer::IDevice> &device, QObject *parent = 0);
257 ~ContainerDeviceProcess();
258- virtual void setWorkingDirectory(const QString &directory) override;
259
260 // DeviceProcess interface
261 virtual void interrupt() override { doSignal(2); }
262@@ -27,8 +26,7 @@
263 void doSignal (const int sig);
264 private:
265 // SshDeviceProcess interface
266- virtual QString fullCommandLine() const override;
267- QString m_workingDir;
268+ virtual QString fullCommandLine(const ProjectExplorer::StandardRunnable &) const override;
269 QString m_pidFile;
270
271 };
272
273=== modified file 'src/ubuntu/device/container/ubuntulocaldeployconfiguration.cpp'
274--- src/ubuntu/device/container/ubuntulocaldeployconfiguration.cpp 2016-04-06 09:35:59 +0000
275+++ src/ubuntu/device/container/ubuntulocaldeployconfiguration.cpp 2016-08-24 15:35:12 +0000
276@@ -134,7 +134,7 @@
277
278 void UbuntuLocalDeployConfiguration::selectAsDefaultHack()
279 {
280- target()->setActiveDeployConfiguration(this);
281+ //target()->setActiveDeployConfiguration(this);
282 }
283
284 } // namespace Internal
285
286=== modified file 'src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp'
287--- src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp 2016-07-22 10:17:50 +0000
288+++ src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp 2016-08-24 15:35:12 +0000
289@@ -30,6 +30,7 @@
290 #include <qtsupport/qtkitinformation.h>
291 #include <projectexplorer/target.h>
292 #include <projectexplorer/buildconfiguration.h>
293+#include <projectexplorer/runnables.h>
294 #include <utils/environment.h>
295 #include <utils/qtcprocess.h>
296 #include <cmakeprojectmanager/cmakeproject.h>
297@@ -60,14 +61,14 @@
298 }
299
300 UbuntuLocalRunConfiguration::UbuntuLocalRunConfiguration(ProjectExplorer::Target *parent, Core::Id id)
301- : RemoteLinux::AbstractRemoteLinuxRunConfiguration(parent, id)
302+ : ProjectExplorer::RunConfiguration(parent, id)
303 {
304 setDisplayName(appId());
305 addExtraAspect(new UbuntuLocalEnvironmentAspect(this));
306 }
307
308 UbuntuLocalRunConfiguration::UbuntuLocalRunConfiguration(ProjectExplorer::Target *parent, UbuntuLocalRunConfiguration *source)
309- : RemoteLinux::AbstractRemoteLinuxRunConfiguration(parent,source)
310+ : ProjectExplorer::RunConfiguration(parent,source)
311 {
312 }
313
314@@ -126,6 +127,23 @@
315 return Configured;
316 }
317
318+ProjectExplorer::Runnable UbuntuLocalRunConfiguration::runnable() const
319+{
320+ if (m_executable.isEmpty())
321+ return ProjectExplorer::Runnable();
322+
323+ ProjectExplorer::StandardRunnable r;
324+ r.executable = remoteExecutableFilePath();
325+ r.device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
326+ r.commandLineArguments = Utils::QtcProcess::joinArgs(arguments(), Utils::OsTypeLinux);
327+
328+ // Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
329+ r.workingDirectory = Utils::FileUtils::normalizePathName(m_workingDir.toString());
330+ r.environment = environment();
331+
332+ return r;
333+}
334+
335 bool UbuntuLocalRunConfiguration::aboutToStart(QString *errorMessage)
336 {
337 if(target()->project()->id() != Constants::UBUNTUPROJECT_ID) {
338@@ -628,7 +646,7 @@
339 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
340 ClickToolChain *uTc = nullptr;
341
342- if (tc && tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
343+ if (tc && tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
344 uTc = static_cast<ClickToolChain *>(tc);
345
346 if (uTc) {
347
348=== modified file 'src/ubuntu/device/container/ubuntulocalrunconfiguration.h'
349--- src/ubuntu/device/container/ubuntulocalrunconfiguration.h 2016-07-22 10:17:50 +0000
350+++ src/ubuntu/device/container/ubuntulocalrunconfiguration.h 2016-08-24 15:35:12 +0000
351@@ -20,7 +20,7 @@
352 #define UBUNTURUNCONFIGURATION_H
353
354 #include <QObject>
355-#include <remotelinux/abstractremotelinuxrunconfiguration.h>
356+#include <projectexplorer/runconfiguration.h>
357 #include <projectexplorer/deployconfiguration.h>
358 #include <projectexplorer/applicationlauncher.h>
359 #include <remotelinux/remotelinuxenvironmentaspect.h>
360@@ -46,7 +46,7 @@
361
362 };
363
364-class UbuntuLocalRunConfiguration : public RemoteLinux::AbstractRemoteLinuxRunConfiguration
365+class UbuntuLocalRunConfiguration : public ProjectExplorer::RunConfiguration
366 {
367 Q_OBJECT
368 public:
369@@ -60,16 +60,16 @@
370 QString appId() const;
371 void addToBaseEnvironment(Utils::Environment &env) const;
372
373- // AbstractRemoteLinuxRunConfiguration interface
374- virtual QString localExecutableFilePath() const override;
375- virtual QString remoteExecutableFilePath() const override;
376- virtual QStringList arguments() const override;
377- virtual Utils::Environment environment() const override;
378- virtual QString workingDirectory() const override;
379+ QString localExecutableFilePath() const;
380+ QString remoteExecutableFilePath() const;
381+ QStringList arguments() const;
382+ Utils::Environment environment() const;
383+ QString workingDirectory() const;
384
385 // RunConfiguration interface
386 virtual bool isConfigured () const override;
387 virtual ConfigurationState ensureConfigured(QString *) override;
388+ virtual ProjectExplorer::Runnable runnable() const override;
389
390 //static helpers
391 static QString getDesktopFile (RunConfiguration *config, QString appId, QString *errorMessage = 0);
392
393=== modified file 'src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp'
394--- src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp 2016-04-06 10:52:54 +0000
395+++ src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp 2016-08-24 15:35:12 +0000
396@@ -67,7 +67,7 @@
397 if (isRemote) {
398 //IF we have a remote device we just support a ubuntu toolchain
399 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(parent->kit());
400- if(tc && tc->type() != QLatin1String(Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
401+ if(tc && tc->typeId() != Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
402 return types;
403 }
404
405
406=== modified file 'src/ubuntu/device/container/ubuntulocalruncontrolfactory.cpp'
407--- src/ubuntu/device/container/ubuntulocalruncontrolfactory.cpp 2016-05-23 07:26:49 +0000
408+++ src/ubuntu/device/container/ubuntulocalruncontrolfactory.cpp 2016-08-24 15:35:12 +0000
409@@ -6,14 +6,16 @@
410
411 #include "containerdevice.h"
412
413-#include <analyzerbase/analyzerstartparameters.h>
414-#include <analyzerbase/analyzerruncontrol.h>
415-#include <analyzerbase/analyzermanager.h>
416+#include <debugger/analyzer/analyzermanager.h>
417+#include <debugger/analyzer/analyzerruncontrol.h>
418+#include <debugger/analyzer/analyzerstartparameters.h>
419 #include <projectexplorer/kitinformation.h>
420 #include <projectexplorer/target.h>
421 #include <projectexplorer/abi.h>
422 #include <debugger/debuggerruncontrol.h>
423 #include <debugger/debuggerstartparameters.h>
424+#include <debugger/debuggerrunconfigurationaspect.h>
425+#include <qmldebug/qmldebugcommandlinearguments.h>
426 #include <utils/fileutils.h>
427 #include <utils/portlist.h>
428 #include <qmlprofiler/localqmlprofilerrunner.h>
429@@ -36,10 +38,7 @@
430 if (mode != ProjectExplorer::Constants::NORMAL_RUN_MODE
431 && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE
432 && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN
433- && mode != ProjectExplorer::Constants::QML_PROFILER_RUN_MODE
434- && mode != Valgrind::Internal::CALLGRIND_RUN_MODE
435- && mode != Valgrind::MEMCHECK_RUN_MODE
436- && mode != Valgrind::MEMCHECK_WITH_GDB_RUN_MODE) {
437+ && mode != ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
438 return false;
439 }
440
441@@ -54,7 +53,13 @@
442 if (!ubuntuRC)
443 return 0;
444
445+ if (!ubuntuRC->aboutToStart(errorMessage))
446+ return 0;
447+
448 QTC_ASSERT(canRun(runConfiguration, mode), return 0);
449+ const auto rcRunnable = runConfiguration->runnable();
450+ QTC_ASSERT(rcRunnable.is<ProjectExplorer::StandardRunnable>(), return 0);
451+ const auto stdRunnable = rcRunnable.as<ProjectExplorer::StandardRunnable>();
452
453 ProjectExplorer::IDevice::ConstPtr genericDev = ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit());
454 if (!genericDev || !genericDev->type().toString().startsWith(QLatin1String(Constants::UBUNTU_CONTAINER_DEVICE_TYPE_ID))) {
455@@ -64,7 +69,7 @@
456 }
457
458 ProjectExplorer::ToolChain *genericToolchain = ProjectExplorer::ToolChainKitInformation::toolChain(runConfiguration->target()->kit());
459- if (!genericToolchain || genericToolchain->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
460+ if (!genericToolchain || genericToolchain->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
461 if(!errorMessage)
462 *errorMessage = tr("Wrong toolchain type in runconfiguration.");
463 return 0;
464@@ -73,9 +78,6 @@
465 ContainerDevice::ConstPtr dev = qSharedPointerCast<const ContainerDevice>(genericDev);
466 ClickToolChain *tc = static_cast<ClickToolChain *>(genericToolchain);
467
468- if (!ubuntuRC->aboutToStart(errorMessage))
469- return 0;
470-
471 if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) {
472 RemoteLinux::RemoteLinuxRunControl *runControl = new RemoteLinux::RemoteLinuxRunControl(ubuntuRC);
473 return runControl;
474@@ -89,8 +91,8 @@
475
476 if (isScope) {
477 Debugger::DebuggerStartParameters params;
478- // Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
479- params.workingDirectory = Utils::FileUtils::normalizePathName(ubuntuRC->workingDirectory());
480+
481+ params.inferior = stdRunnable;
482
483 QString triplet = tc->gnutriplet();
484 if (triplet.isEmpty()) {
485@@ -101,12 +103,11 @@
486
487 QString scoperunnerPth = QString::fromLatin1("/usr/lib/%1/unity-scopes/scoperunner")
488 .arg(triplet);
489- params.executable = QString(UbuntuClickTool::targetBasePath(tc->clickTarget())+scoperunnerPth);
490+ params.symbolFile = QString(UbuntuClickTool::targetBasePath(tc->clickTarget())+scoperunnerPth);
491 params.continueAfterAttach = true;
492 params.startMode = Debugger::AttachToRemoteServer;
493 params.remoteSetupNeeded = true;
494 params.connParams.host = dev->sshParameters().host;
495- params.environment = ubuntuRC->environment();
496 params.solibSearchPath.append(ubuntuRC->soLibSearchPaths());
497
498 Debugger::DebuggerRunControl *runControl
499@@ -117,28 +118,59 @@
500
501 return runControl;
502 } else {
503- if (ubuntuRC->portsUsedByDebuggers() > dev->freePorts().count()) {
504+ auto aspect = ubuntuRC->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
505+ if (aspect->portsUsedByDebugger() > dev->freePorts().count()) {
506 *errorMessage = tr("Cannot debug: Not enough free ports available.");
507 return 0;
508 }
509
510- Debugger::DebuggerStartParameters params = RemoteLinux::LinuxDeviceDebugSupport::startParameters(ubuntuRC);
511+ /*
512+ * Taken from remotelinuxruncontrolfactory.cpp and adapted
513+ * to work here.
514+ */
515+ Debugger::DebuggerStartParameters params;
516+ params.startMode = Debugger::AttachToRemoteServer;
517+ params.closeMode = Debugger::KillAndExitMonitorAtClose;
518+ params.remoteSetupNeeded = true;
519+
520+ if (aspect->useQmlDebugger()) {
521+ params.qmlServer.host = dev->sshParameters().host;
522+ params.qmlServer.port = Utils::Port(); // port is selected later on
523+ }
524+ if (aspect->useCppDebugger()) {
525+ aspect->setUseMultiProcess(true);
526+ params.inferior.executable = stdRunnable.executable;
527+ params.inferior.commandLineArguments = stdRunnable.commandLineArguments;
528+ if (aspect->useQmlDebugger()) {
529+ params.inferior.commandLineArguments.prepend(QLatin1Char(' '));
530+ params.inferior.commandLineArguments.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices));
531+ }
532+ params.remoteChannel = dev->sshParameters().host + QLatin1String(":-1");
533+ params.symbolFile = ubuntuRC->localExecutableFilePath();
534+ }
535+
536 params.solibSearchPath.append(ubuntuRC->soLibSearchPaths());
537
538 Debugger::DebuggerRunControl * const runControl = Debugger::createDebuggerRunControl(params, ubuntuRC, errorMessage, mode);
539 if (!runControl)
540 return 0;
541
542- RemoteLinux::LinuxDeviceDebugSupport * const debugSupport =
543- new RemoteLinux::LinuxDeviceDebugSupport(ubuntuRC, runControl);
544- connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished()));
545+ (void) new RemoteLinux::LinuxDeviceDebugSupport(ubuntuRC, runControl);
546 return runControl;
547 }
548 return 0;
549 }
550 else if(mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
551- Analyzer::AnalyzerStartParameters params = RemoteLinux::RemoteLinuxAnalyzeSupport::startParameters(ubuntuRC, mode);
552- Analyzer::AnalyzerRunControl *runControl = Analyzer::AnalyzerManager::createRunControl(params, ubuntuRC);
553+ /*
554+ * Taken from remotelinuxruncontrolfactory.cpp and adapted
555+ * to work here.
556+ */
557+ auto runControl = Debugger::createAnalyzerRunControl(ubuntuRC, mode);
558+ Debugger::AnalyzerConnection connection;
559+ connection.connParams =
560+ ProjectExplorer::DeviceKitInformation::device(ubuntuRC->target()->kit())->sshParameters();
561+ connection.analyzerHost = connection.connParams.host;
562+ runControl->setConnection(connection);
563 (void) new RemoteLinux::RemoteLinuxAnalyzeSupport(ubuntuRC, runControl, mode);
564 return runControl;
565 }
566
567=== modified file 'src/ubuntu/device/container/ubuntulocalscopedebugsupport.cpp'
568--- src/ubuntu/device/container/ubuntulocalscopedebugsupport.cpp 2016-05-23 07:26:49 +0000
569+++ src/ubuntu/device/container/ubuntulocalscopedebugsupport.cpp 2016-08-24 15:35:12 +0000
570@@ -38,7 +38,7 @@
571
572 void UbuntuLocalScopeDebugSupport::startExecution()
573 {
574- QTC_ASSERT(state() == GatheringPorts, return);
575+ QTC_ASSERT(state() == GatheringResources, return);
576
577 setState(StartingRunner);
578 m_gdbserverOutput.clear();
579@@ -47,7 +47,8 @@
580 // as it will stick even for the next non debug run, and even though
581 // we can then start without gdbserver the timouts will be always set
582 // high, because the DebugMode=true setting is still there
583- if(!setPort(m_port)) {
584+ m_port = findPort();
585+ if(!m_port.isValid()) {
586 Debugger::RemoteSetupResult res;
587 res.success = false;
588 res.reason = tr("Could not assign a free port for debugging.");
589@@ -118,7 +119,7 @@
590 }
591
592 args.append(QStringLiteral("--cppdebug"));
593- args.append(QString::number(m_port));
594+ args.append(QString::number(m_port.number()));
595
596
597 setState(StartingRunner);
598@@ -138,9 +139,7 @@
599 connect(m_runControl, &Debugger::DebuggerRunControl::stateChanged,
600 this, &UbuntuLocalScopeDebugSupport::handleStateChanged);
601
602- runner->setEnvironment(environment());
603- runner->setWorkingDirectory(workingDirectory());
604- runner->start(device(), m_executable, args);
605+ runner->start(device(), runnable());
606 }
607
608 void UbuntuLocalScopeDebugSupport::handleRemoteSetupRequested()
609@@ -148,7 +147,7 @@
610 QTC_ASSERT(state() == Inactive, return);
611
612 showMessage(tr("Checking available ports...") + QLatin1Char('\n'), Debugger::LogStatus);
613- AbstractRemoteLinuxRunSupport::handleRemoteSetupRequested();
614+ startPortsGathering();
615 }
616
617 void UbuntuLocalScopeDebugSupport::handleAppRunnerError(const QString &error)
618@@ -171,7 +170,7 @@
619
620 void UbuntuLocalScopeDebugSupport::handleRemoteErrorOutput(const QByteArray &output)
621 {
622- QTC_ASSERT(state() != GatheringPorts, return);
623+ QTC_ASSERT(state() != GatheringResources, return);
624
625 if (!m_runControl)
626 return;
627
628=== modified file 'src/ubuntu/device/container/ubuntulocalscopedebugsupport.h'
629--- src/ubuntu/device/container/ubuntulocalscopedebugsupport.h 2016-05-23 07:26:49 +0000
630+++ src/ubuntu/device/container/ubuntulocalscopedebugsupport.h 2016-08-24 15:35:12 +0000
631@@ -42,7 +42,7 @@
632 void showMessage(const QString &msg, int channel);
633
634 private:
635- int m_port;
636+ Utils::Port m_port;
637 QString m_scopeRunnerPath;
638 QString m_executable;
639 QString m_buildDir;
640
641=== modified file 'src/ubuntu/device/remote/abstractremoterunsupport.cpp'
642--- src/ubuntu/device/remote/abstractremoterunsupport.cpp 2016-03-29 09:41:07 +0000
643+++ src/ubuntu/device/remote/abstractremoterunsupport.cpp 2016-08-24 15:35:12 +0000
644@@ -84,14 +84,15 @@
645 return &d->runner;
646 }
647
648-bool AbstractRemoteRunSupport::assignNextFreePort(int *port)
649+Utils::Port AbstractRemoteRunSupport::findFreePort( )
650 {
651- *port = d->portScanner.getNextFreePort(&d->freePorts);
652- if (*port == -1) {
653+ Utils::Port thePort = d->portScanner.getNextFreePort(&d->freePorts);
654+ if (!thePort.isValid()){
655 handleAdapterSetupFailed(tr("Not enough free ports on device for debugging."));
656- return false;
657+ return Utils::Port();
658 }
659- return true;
660+
661+ return thePort;
662 }
663
664 void AbstractRemoteRunSupport::setFinished()
665
666=== modified file 'src/ubuntu/device/remote/abstractremoterunsupport.h'
667--- src/ubuntu/device/remote/abstractremoterunsupport.h 2016-03-29 09:41:07 +0000
668+++ src/ubuntu/device/remote/abstractremoterunsupport.h 2016-08-24 15:35:12 +0000
669@@ -34,7 +34,7 @@
670 virtual void handleAdapterSetupFailed(const QString &error);
671 virtual void handleAdapterSetupDone();
672
673- bool assignNextFreePort(int *port);
674+ Utils::Port findFreePort();
675 void setFinished ();
676 void reset();
677
678
679=== modified file 'src/ubuntu/device/remote/ubuntudeploystepfactory.cpp'
680--- src/ubuntu/device/remote/ubuntudeploystepfactory.cpp 2016-03-29 10:39:39 +0000
681+++ src/ubuntu/device/remote/ubuntudeploystepfactory.cpp 2016-08-24 15:35:12 +0000
682@@ -6,6 +6,7 @@
683 #include <ubuntu/ubuntupackagestep.h>
684
685 #include <utils/qtcassert.h>
686+#include <utils/algorithm.h>
687
688 #include <projectexplorer/buildstep.h>
689 #include <projectexplorer/buildsteplist.h>
690@@ -23,9 +24,9 @@
691 namespace Ubuntu {
692 namespace Internal {
693
694-QList<Core::Id> UbuntuDeployStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
695+QList<ProjectExplorer::BuildStepInfo> UbuntuDeployStepFactory::availableSteps(ProjectExplorer::BuildStepList *parent) const
696 {
697- QList<Core::Id> types;
698+ QList<ProjectExplorer::BuildStepInfo> types;
699
700 if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
701 return types;
702@@ -43,34 +44,37 @@
703 if (isRemote) {
704 //IF we have a remote device we just support a ubuntu toolchain
705 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(parent->target()->kit());
706- if(tc && tc->type() != QLatin1String(Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
707+ if(tc && tc->typeId() != Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
708 return types;
709 }
710
711- if(isRemote && ( isHTML || isQML || isCMake || isQMake ) )
712- types << Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID
713- << Constants::UBUNTU_CLICK_PACKAGESTEP_ID;
714+ if(isRemote && ( isHTML || isQML || isCMake || isQMake ) ) {
715+
716+ types << ProjectExplorer::BuildStepInfo (Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID,
717+ UbuntuDirectUploadStep::displayName(),
718+ ProjectExplorer::BuildStepInfo::UniqueStep)
719+ << ProjectExplorer::BuildStepInfo (Constants::UBUNTU_CLICK_PACKAGESTEP_ID,
720+ tr("UbuntuSDK create click package", "Display name for UbuntuPackageStep id."),
721+ ProjectExplorer::BuildStepInfo::UniqueStep)
722+ //backwards compatibility to older projects
723+ << ProjectExplorer::BuildStepInfo (Constants::UBUNTU_DEPLOY_MAKESTEP_ID,
724+ tr("UbuntuSDK create click package", "Display name for UbuntuPackageStep id."),
725+ ProjectExplorer::BuildStepInfo::Flags(ProjectExplorer::BuildStepInfo::UniqueStep
726+ | ProjectExplorer::BuildStepInfo::Uncreatable
727+ | ProjectExplorer::BuildStepInfo::Unclonable));
728+ }
729
730 return types;
731 }
732
733-QString UbuntuDeployStepFactory::displayNameForId(const Core::Id id) const
734-{
735- if (id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)
736- return UbuntuDirectUploadStep::displayName();
737- else if (id == Constants::UBUNTU_CLICK_PACKAGESTEP_ID)
738- return tr("UbuntuSDK create click package", "Display name for UbuntuPackageStep id.");
739- return QString();
740-}
741-
742-bool UbuntuDeployStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
743-{
744- return availableCreationIds(parent).contains(id);
745+bool UbuntuDeployStepFactory::canHandle(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
746+{
747+ return Utils::contains(availableSteps(parent), Utils::equal(&ProjectExplorer::BuildStepInfo::id, id));
748 }
749
750 ProjectExplorer::BuildStep *UbuntuDeployStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
751 {
752- if (!canCreate(parent, id))
753+ if (!canHandle(parent, id))
754 return 0;
755
756 if(id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)
757@@ -83,24 +87,12 @@
758 return 0;
759 }
760
761-bool UbuntuDeployStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
762-{
763- Core::Id toRestore = ProjectExplorer::idFromMap(map);
764-
765- //backwards compatibility to older projects
766- if( toRestore == Constants::UBUNTU_DEPLOY_MAKESTEP_ID )
767- return canCreate(parent,Core::Id(Constants::UBUNTU_CLICK_PACKAGESTEP_ID));
768-
769- return canCreate(parent,toRestore);
770-}
771-
772 ProjectExplorer::BuildStep *UbuntuDeployStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
773 {
774 Core::Id id = ProjectExplorer::idFromMap(map);
775- if(!canCreate(parent,id))
776+ if(!canHandle(parent,id))
777 return 0;
778
779- //backwards compatibility to older projects
780 if( id == Constants::UBUNTU_DEPLOY_MAKESTEP_ID ) {
781 UbuntuPackageStep *step = new UbuntuPackageStep(parent);
782 return step;
783@@ -115,14 +107,9 @@
784 return step;
785 }
786
787-bool UbuntuDeployStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
788-{
789- return canCreate(parent,product->id());
790-}
791-
792 ProjectExplorer::BuildStep *UbuntuDeployStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
793 {
794- if (!canClone(parent, product))
795+ if (!canHandle(parent, product->id()))
796 return 0;
797
798 const Core::Id id = product->id();
799
800=== modified file 'src/ubuntu/device/remote/ubuntudeploystepfactory.h'
801--- src/ubuntu/device/remote/ubuntudeploystepfactory.h 2016-03-29 10:39:39 +0000
802+++ src/ubuntu/device/remote/ubuntudeploystepfactory.h 2016-08-24 15:35:12 +0000
803@@ -13,14 +13,13 @@
804
805 public:
806 // IBuildStepFactory interface
807- virtual QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const override;
808- virtual QString displayNameForId(const Core::Id id) const override;
809- virtual bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const override;
810+ virtual QList<ProjectExplorer::BuildStepInfo> availableSteps(ProjectExplorer::BuildStepList *parent) const override;
811 virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) override;
812- virtual bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const override;
813 virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override;
814- virtual bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const override;
815 virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) override;
816+
817+private:
818+ bool canHandle(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
819 };
820
821 } // namespace Internal
822
823=== modified file 'src/ubuntu/device/remote/ubuntudevice.cpp'
824--- src/ubuntu/device/remote/ubuntudevice.cpp 2016-03-29 09:41:07 +0000
825+++ src/ubuntu/device/remote/ubuntudevice.cpp 2016-08-24 15:35:12 +0000
826@@ -28,6 +28,7 @@
827 #include <ubuntu/settings.h>
828
829 #include <projectexplorer/devicesupport/devicemanager.h>
830+#include <projectexplorer/runnables.h>
831 #include <remotelinux/genericlinuxdeviceconfigurationwidget.h>
832 #include <coreplugin/messagemanager.h>
833 #include <ssh/sshconnection.h>
834@@ -744,14 +745,14 @@
835
836 //first port is SSH port
837 QSsh::SshConnectionParameters connParms = m_dev->sshParameters();
838- connParms.port = copy.getNext();
839+ connParms.port = copy.getNext().number();
840 m_dev->setSshParameters(connParms);
841
842 m_dev->setFreePorts(copy);
843
844 QStringList ports;
845 while(copy.hasMore())
846- ports.append(QString::number(copy.getNext()));
847+ ports.append(QString::number(copy.getNext().number()));
848
849 //@TODO per device settings
850 QString deviceSshPort = QString::number(connParms.port);
851@@ -1349,17 +1350,12 @@
852 {
853 }
854
855-void UbuntuDeviceProcess::setWorkingDirectory(const QString &directory)
856-{
857- m_workingDir = directory;
858-}
859-
860 void UbuntuDeviceProcess::terminate()
861 {
862 LinuxDeviceProcess::terminate();
863 }
864
865-QString UbuntuDeviceProcess::fullCommandLine() const
866+QString UbuntuDeviceProcess::fullCommandLine(const ProjectExplorer::StandardRunnable &runnable) const
867 {
868 //return QStringLiteral("%1 %2").arg(quote(executable()),Utils::QtcProcess::joinArgsUnix(arguments()));
869
870@@ -1371,15 +1367,15 @@
871 QString fullCommandLine;
872 foreach (const QString &filePath, rcFiles)
873 fullCommandLine += QString::fromLatin1("test -f %1 && . %1;").arg(filePath);
874- if (!m_workingDir.isEmpty()) {
875- fullCommandLine.append(QLatin1String("cd ")).append(quote(m_workingDir))
876+ if (!runnable.workingDirectory.isEmpty()) {
877+ fullCommandLine.append(QLatin1String("cd ")).append(quote(runnable.workingDirectory))
878 .append(QLatin1String(" && "));
879 }
880
881- fullCommandLine.append(quote(executable()));
882- if (!arguments().isEmpty()) {
883+ fullCommandLine.append(quote(runnable.executable));
884+ if (!runnable.commandLineArguments.isEmpty()) {
885 fullCommandLine.append(QLatin1Char(' '));
886- fullCommandLine.append(Utils::QtcProcess::joinArgs(arguments(),Utils::OsTypeLinux));
887+ fullCommandLine.append(runnable.commandLineArguments);
888 }
889
890 if(debug) qDebug()<<fullCommandLine;
891
892=== modified file 'src/ubuntu/device/remote/ubuntudevice.h'
893--- src/ubuntu/device/remote/ubuntudevice.h 2016-03-29 09:41:07 +0000
894+++ src/ubuntu/device/remote/ubuntudevice.h 2016-08-24 15:35:12 +0000
895@@ -246,16 +246,13 @@
896 explicit UbuntuDeviceProcess(const QSharedPointer<const ProjectExplorer::IDevice> &device,
897 QObject *parent = 0);
898
899- void setWorkingDirectory(const QString &directory) override;
900-
901 // DeviceProcess interface
902 public:
903 virtual void terminate() override;
904
905 private:
906 // SshDeviceProcess interface
907- virtual QString fullCommandLine() const override;
908- QString m_workingDir;
909+ virtual QString fullCommandLine(const ProjectExplorer::StandardRunnable &runnable) const override;
910 };
911
912 } // namespace Internal
913
914=== modified file 'src/ubuntu/device/remote/ubuntudevicesignaloperation.cpp'
915--- src/ubuntu/device/remote/ubuntudevicesignaloperation.cpp 2016-03-29 09:41:07 +0000
916+++ src/ubuntu/device/remote/ubuntudevicesignaloperation.cpp 2016-08-24 15:35:12 +0000
917@@ -10,7 +10,7 @@
918
919 }
920
921-void UbuntuDeviceSignalOperation::killProcess(int pid)
922+void UbuntuDeviceSignalOperation::killProcess(qint64 pid)
923 {
924 sendSignal(pid,9);
925 }
926@@ -21,7 +21,7 @@
927 emit finished(tr("Sending signals to processes by filePath is not supported on Ubuntu Devices"));
928 }
929
930-void UbuntuDeviceSignalOperation::interruptProcess(int pid)
931+void UbuntuDeviceSignalOperation::interruptProcess(qint64 pid)
932 {
933 sendSignal(pid,2);
934 }
935@@ -32,7 +32,7 @@
936 emit finished(tr("Sending signals to processes by filePath is not supported on Ubuntu Devices"));
937 }
938
939-void UbuntuDeviceSignalOperation::sendSignal(int pid, int signal)
940+void UbuntuDeviceSignalOperation::sendSignal(qint64 pid, int signal)
941 {
942 QProcess *proc = new QProcess(this);
943
944
945=== modified file 'src/ubuntu/device/remote/ubuntudevicesignaloperation.h'
946--- src/ubuntu/device/remote/ubuntudevicesignaloperation.h 2016-07-22 10:17:50 +0000
947+++ src/ubuntu/device/remote/ubuntudevicesignaloperation.h 2016-08-24 15:35:12 +0000
948@@ -17,13 +17,13 @@
949 typedef QSharedPointer<UbuntuDeviceSignalOperation> Ptr;
950
951 // DeviceProcessSignalOperation interface
952- virtual void killProcess(int pid) override;
953+ virtual void killProcess(qint64 pid) override;
954 virtual void killProcess(const QString &filePath) override;
955- virtual void interruptProcess(int pid) override;
956+ virtual void interruptProcess(qint64 pid) override;
957 virtual void interruptProcess(const QString &filePath) override;
958
959 private:
960- void sendSignal (int pid, int signal);
961+ void sendSignal (qint64 pid, int signal);
962
963 private slots:
964 void processFinished (int exitCode, QProcess::ExitStatus exitState);
965
966=== modified file 'src/ubuntu/device/remote/ubuntudirectuploadstep.cpp'
967--- src/ubuntu/device/remote/ubuntudirectuploadstep.cpp 2016-03-29 10:39:39 +0000
968+++ src/ubuntu/device/remote/ubuntudirectuploadstep.cpp 2016-08-24 15:35:12 +0000
969@@ -65,12 +65,13 @@
970
971 void UbuntuDirectUploadStep::run(QFutureInterface<bool> &fi)
972 {
973+ m_future = &fi;
974+
975 m_foundClickPackage = false;
976 projectNameChanged();
977 if(!m_foundClickPackage) {
978- emit addOutput(tr("Deploy step failed. No click package was created"), ErrorMessageOutput);
979- fi.reportResult(false);
980- emit finished();
981+ doFail(tr("Deploy step failed. No click package was created"));
982+ m_future = 0;
983 return;
984 }
985
986@@ -80,13 +81,11 @@
987
988 UbuntuDevice::ConstPtr dev = deviceFromTarget(target());
989 if(!dev) {
990- emit addOutput(tr("Deploy step failed. No valid device configured"), ErrorMessageOutput);
991- fi.reportResult(false);
992- emit finished();
993+ doFail(tr("Deploy step failed. No valid device configured"));
994+ m_future = 0;
995 return;
996 }
997
998- m_future = &fi;
999 if(dev->deviceState() != ProjectExplorer::IDevice::DeviceReadyToUse) {
1000 //we are already waiting
1001 if (m_waitDialog)
1002@@ -109,10 +108,8 @@
1003 {
1004 m_waitDialog->deleteLater();
1005
1006- emit addOutput(tr("Deploy step failed"), ErrorMessageOutput);
1007- m_future->reportResult(false);
1008+ doFail(tr("Deploy step failed"));
1009 m_future = 0;
1010- emit finished();
1011 }
1012
1013 void UbuntuDirectUploadStep::handleDeviceReady()
1014@@ -121,10 +118,8 @@
1015
1016 QString whyNot;
1017 if(!deployService()->isDeploymentPossible(&whyNot)) {
1018- emit addOutput(tr("Deploy step failed. %1").arg(whyNot), ErrorMessageOutput);
1019- m_future->reportResult(false);
1020+ doFail(tr("Deploy step failed. %1").arg(whyNot));
1021 m_future = 0;
1022- emit finished();
1023 return;
1024 }
1025
1026@@ -132,6 +127,14 @@
1027 m_future = 0;
1028 }
1029
1030+void UbuntuDirectUploadStep::doFail(const QString &err)
1031+{
1032+ emit addOutput(err, ErrorMessageOutput);
1033+ disconnect(deployService(), 0, this, 0);
1034+ if (m_future)
1035+ reportRunResult(*m_future, false);
1036+}
1037+
1038 ProjectExplorer::BuildStepConfigWidget *UbuntuDirectUploadStep::createConfigWidget()
1039 {
1040 return new ProjectExplorer::SimpleBuildStepConfigWidget(this);
1041
1042=== modified file 'src/ubuntu/device/remote/ubuntudirectuploadstep.h'
1043--- src/ubuntu/device/remote/ubuntudirectuploadstep.h 2016-07-22 10:17:50 +0000
1044+++ src/ubuntu/device/remote/ubuntudirectuploadstep.h 2016-08-24 15:35:12 +0000
1045@@ -39,6 +39,9 @@
1046 void handleDeviceReady ();
1047
1048 private:
1049+ void doFail (const QString &err);
1050+
1051+private:
1052 RemoteLinux::GenericDirectUploadService *m_deployService;
1053 bool m_foundClickPackage;
1054
1055
1056=== modified file 'src/ubuntu/device/remote/ubunturemoteanalyzesupport.cpp'
1057--- src/ubuntu/device/remote/ubunturemoteanalyzesupport.cpp 2016-03-29 09:41:07 +0000
1058+++ src/ubuntu/device/remote/ubunturemoteanalyzesupport.cpp 2016-08-24 15:35:12 +0000
1059@@ -4,7 +4,7 @@
1060 #include <ubuntu/ubuntuconstants.h>
1061
1062 #include <remotelinux/remotelinuxrunconfiguration.h>
1063-#include <analyzerbase/analyzerruncontrol.h>
1064+#include <debugger/analyzer/analyzerruncontrol.h>
1065
1066 #include <projectexplorer/buildconfiguration.h>
1067 #include <projectexplorer/project.h>
1068@@ -14,6 +14,7 @@
1069 #include <projectexplorer/kitinformation.h>
1070
1071 #include <utils/qtcassert.h>
1072+#include <utils/port.h>
1073 #include <qmldebug/qmloutputparser.h>
1074
1075 #include <QPointer>
1076@@ -24,30 +25,31 @@
1077 class UbuntuRemoteAnalyzeSupportPrivate
1078 {
1079 public:
1080- UbuntuRemoteAnalyzeSupportPrivate(Analyzer::AnalyzerRunControl *rc, Core::Id runMode)
1081+ UbuntuRemoteAnalyzeSupportPrivate(Debugger::AnalyzerRunControl *rc, Core::Id runMode)
1082 : runControl(rc),
1083- qmlProfiling(runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE),
1084- qmlPort(-1)
1085+ qmlPort(-1),
1086+ qmlProfiling(runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE)
1087 {
1088 }
1089
1090 QString clickPackage;
1091- const QPointer<Analyzer::AnalyzerRunControl> runControl;
1092+
1093+ const QPointer<Debugger::AnalyzerRunControl> runControl;
1094+ QmlDebug::QmlOutputParser outputParser;
1095+
1096+ Utils::Port qmlPort;
1097 bool qmlProfiling;
1098- int qmlPort;
1099-
1100- QmlDebug::QmlOutputParser outputParser;
1101 };
1102
1103 UbuntuRemoteAnalyzeSupport::UbuntuRemoteAnalyzeSupport(UbuntuRemoteRunConfiguration *runConfig,
1104- Analyzer::AnalyzerRunControl *engine, Core::Id runMode)
1105+ Debugger::AnalyzerRunControl *engine, Core::Id runMode)
1106 : AbstractRemoteRunSupport(runConfig, engine),
1107 d(new UbuntuRemoteAnalyzeSupportPrivate(engine, runMode))
1108 {
1109 d->clickPackage = runConfig->clickPackage();
1110- connect(d->runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)),
1111- SLOT(handleRemoteSetupRequested()));
1112- connect(&d->outputParser, SIGNAL(waitingForConnectionOnPort(quint16)),
1113+ connect(d->runControl, &Debugger::AnalyzerRunControl::starting,
1114+ this, &UbuntuRemoteAnalyzeSupport::handleRemoteSetupRequested);
1115+ connect(&d->outputParser, SIGNAL(waitingForConnectionOnPort(Utils::Port)),
1116 SLOT(remoteIsRunning()));
1117 }
1118
1119@@ -59,7 +61,7 @@
1120 void UbuntuRemoteAnalyzeSupport::showMessage(const QString &msg, Utils::OutputFormat format)
1121 {
1122 if (state() != Idle && d->runControl)
1123- d->runControl->logApplicationMessage(msg, format);
1124+ d->runControl->appendMessage(msg, format);
1125 d->outputParser.processOutput(msg);
1126 }
1127
1128@@ -78,7 +80,8 @@
1129 // Currently we support only QML profiling
1130 QTC_ASSERT(d->qmlProfiling, return);
1131
1132- if (!assignNextFreePort(&d->qmlPort))
1133+ d->qmlPort = findFreePort();
1134+ if (!d->qmlPort.isValid())
1135 return;
1136
1137 setState(Starting);
1138@@ -91,7 +94,7 @@
1139 connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString)));
1140
1141 runner->setEnv(environment());
1142- runner->setQmlDebugPort(d->qmlPort);
1143+ runner->setQmlDebugPort(d->qmlPort.number());
1144
1145 QTC_ASSERT(device()->type().toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)),return);
1146 runner->start(qSharedPointerCast<const UbuntuDevice>(device()),clickPackage(),hook());
1147
1148=== modified file 'src/ubuntu/device/remote/ubunturemoteanalyzesupport.h'
1149--- src/ubuntu/device/remote/ubunturemoteanalyzesupport.h 2016-03-29 09:41:07 +0000
1150+++ src/ubuntu/device/remote/ubunturemoteanalyzesupport.h 2016-08-24 15:35:12 +0000
1151@@ -3,7 +3,7 @@
1152
1153 #include <QObject>
1154 #include "abstractremoterunsupport.h"
1155-#include <analyzerbase/analyzerruncontrol.h>
1156+#include <debugger/analyzer/analyzerruncontrol.h>
1157
1158 namespace Ubuntu {
1159 namespace Internal {
1160@@ -16,7 +16,7 @@
1161 Q_OBJECT
1162 public:
1163 UbuntuRemoteAnalyzeSupport(UbuntuRemoteRunConfiguration *runConfig,
1164- Analyzer::AnalyzerRunControl *engine, Core::Id runMode);
1165+ Debugger::AnalyzerRunControl *engine, Core::Id runMode);
1166 ~UbuntuRemoteAnalyzeSupport() override;
1167
1168 protected:
1169
1170=== modified file 'src/ubuntu/device/remote/ubunturemotedebugsupport.cpp'
1171--- src/ubuntu/device/remote/ubunturemotedebugsupport.cpp 2016-03-29 09:41:07 +0000
1172+++ src/ubuntu/device/remote/ubunturemotedebugsupport.cpp 2016-08-24 15:35:12 +0000
1173@@ -70,8 +70,8 @@
1174 bool qmlDebugging;
1175 bool cppDebugging;
1176 QByteArray gdbserverOutput;
1177- int gdbServerPort;
1178- int qmlPort;
1179+ Utils::Port gdbServerPort;
1180+ Utils::Port qmlPort;
1181 };
1182
1183 UbuntuRemoteDebugSupport::UbuntuRemoteDebugSupport(UbuntuRemoteRunConfiguration* runConfig,
1184@@ -80,6 +80,8 @@
1185 d(new UbuntuRemoteDebugSupportPrivate(runConfig, runControl))
1186 {
1187 connect(d->runControl, SIGNAL(requestRemoteSetup()), this, SLOT(handleRemoteSetupRequested()));
1188+ connect(d->runControl,&Debugger::DebuggerRunControl::finished,
1189+ this, &UbuntuRemoteDebugSupport::handleDebuggingFinished);
1190 }
1191
1192 UbuntuRemoteDebugSupport::~UbuntuRemoteDebugSupport()
1193@@ -105,10 +107,16 @@
1194
1195 setState(Starting);
1196
1197- if (d->cppDebugging && !assignNextFreePort(&d->gdbServerPort))
1198- return;
1199- if (d->qmlDebugging && !assignNextFreePort(&d->qmlPort))
1200- return;
1201+ if (d->cppDebugging) {
1202+ d->gdbServerPort = findFreePort();
1203+ if (!d->gdbServerPort.isValid())
1204+ return;
1205+ }
1206+ if (d->qmlDebugging) {
1207+ d->qmlPort = findFreePort();
1208+ if (!d->qmlPort.isValid())
1209+ return;
1210+ }
1211
1212 d->gdbserverOutput.clear();
1213
1214@@ -120,9 +128,9 @@
1215 connect(launcher, SIGNAL(clickApplicationStarted(quint16)), SLOT(handleRemoteProcessStarted(quint16)));
1216
1217 if(d->cppDebugging)
1218- launcher->setCppDebugPort(d->gdbServerPort);
1219+ launcher->setCppDebugPort(d->gdbServerPort.number());
1220 if(d->qmlDebugging)
1221- launcher->setQmlDebugPort(d->qmlPort);
1222+ launcher->setQmlDebugPort(d->qmlPort.number());
1223
1224 launcher->setEnv(environment());
1225
1226@@ -222,7 +230,7 @@
1227
1228 Debugger::RemoteSetupResult result;
1229 result.success = true;
1230- result.inferiorPid = d->runControl->startParameters().attachPID;
1231+ //result.inferiorPid = d->runControl->startParameters().attachPID;
1232 result.gdbServerPort = d->gdbServerPort;
1233 result.qmlServerPort = d->qmlPort;
1234 d->runControl->notifyEngineRemoteSetupFinished(result);
1235
1236=== modified file 'src/ubuntu/device/remote/ubunturemoterunconfiguration.cpp'
1237--- src/ubuntu/device/remote/ubunturemoterunconfiguration.cpp 2016-04-06 10:52:54 +0000
1238+++ src/ubuntu/device/remote/ubunturemoterunconfiguration.cpp 2016-08-24 15:35:12 +0000
1239@@ -31,6 +31,7 @@
1240 #include <projectexplorer/target.h>
1241 #include <projectexplorer/project.h>
1242 #include <projectexplorer/buildsteplist.h>
1243+#include <projectexplorer/runnables.h>
1244 #include <remotelinux/remotelinuxenvironmentaspect.h>
1245 #include <utils/qtcprocess.h>
1246 #include <cmakeprojectmanager/cmakeproject.h>
1247@@ -57,7 +58,7 @@
1248 const char UNINSTALL_KEY[]="UbuntuRemoteRunConfiguration.Uninstall";
1249
1250 UbuntuRemoteRunConfiguration::UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, Core::Id id)
1251- : AbstractRemoteLinuxRunConfiguration(parent,id),
1252+ : RunConfiguration(parent,id),
1253 m_running(false),
1254 m_forceInstall(false),
1255 m_uninstall(true)
1256@@ -70,7 +71,7 @@
1257 }
1258
1259 UbuntuRemoteRunConfiguration::UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, UbuntuRemoteRunConfiguration *source)
1260- : AbstractRemoteLinuxRunConfiguration(parent,source),
1261+ : RunConfiguration(parent,source),
1262 m_running(false),
1263 m_forceInstall(false),
1264 m_uninstall(true)
1265@@ -176,6 +177,20 @@
1266 return ProjectExplorer::RunConfiguration::Configured;
1267 }
1268
1269+ProjectExplorer::Runnable UbuntuRemoteRunConfiguration::runnable() const
1270+{
1271+ if (m_remoteExecutable.isEmpty())
1272+ return ProjectExplorer::Runnable();
1273+
1274+ ProjectExplorer::StandardRunnable r;
1275+ r.executable = m_remoteExecutable;
1276+ r.device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
1277+
1278+ r.environment = environment();
1279+
1280+ return r;
1281+}
1282+
1283 /*!
1284 * \brief UbuntuRemoteRunConfiguration::aboutToStart
1285 * Configures the internal parameters and fetched the informations from
1286@@ -225,7 +240,7 @@
1287 }
1288
1289 ProjectExplorer::ToolChain* tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
1290- if(tc->type() != QString::fromLatin1(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
1291+ if(tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
1292 if(errorMessage)
1293 *errorMessage = tr("Wrong toolchain type. Please check your build configuration.");
1294 return false;
1295@@ -407,7 +422,7 @@
1296 {
1297 if(debug) qDebug()<<Q_FUNC_INFO;
1298
1299- if(!AbstractRemoteLinuxRunConfiguration::fromMap(map))
1300+ if(!RunConfiguration::fromMap(map))
1301 return false;
1302
1303 m_uninstall = map.value(QLatin1String(UNINSTALL_KEY),true).toBool();
1304@@ -418,7 +433,7 @@
1305 QVariantMap UbuntuRemoteRunConfiguration::toMap() const
1306 {
1307 if(debug) qDebug()<<Q_FUNC_INFO;
1308- QVariantMap m = AbstractRemoteLinuxRunConfiguration::toMap();
1309+ QVariantMap m = RunConfiguration::toMap();
1310 m.insert(QLatin1String(UNINSTALL_KEY),m_uninstall);
1311 m.insert(QLatin1String(FORCE_INSTALL_KEY),m_forceInstall);
1312 return m;
1313
1314=== modified file 'src/ubuntu/device/remote/ubunturemoterunconfiguration.h'
1315--- src/ubuntu/device/remote/ubunturemoterunconfiguration.h 2016-03-29 09:41:07 +0000
1316+++ src/ubuntu/device/remote/ubunturemoterunconfiguration.h 2016-08-24 15:35:12 +0000
1317@@ -18,7 +18,7 @@
1318 #ifndef UBUNTU_INTERNAL_UBUNTUREMOTERUNCONFIGURATION_H
1319 #define UBUNTU_INTERNAL_UBUNTUREMOTERUNCONFIGURATION_H
1320
1321-#include <remotelinux/abstractremotelinuxrunconfiguration.h>
1322+#include <projectexplorer/runconfiguration.h>
1323 #include <coreplugin/id.h>
1324
1325 namespace Ui {
1326@@ -28,7 +28,7 @@
1327 namespace Ubuntu {
1328 namespace Internal {
1329
1330-class UbuntuRemoteRunConfiguration : public RemoteLinux::AbstractRemoteLinuxRunConfiguration
1331+class UbuntuRemoteRunConfiguration : public ProjectExplorer::RunConfiguration
1332 {
1333 Q_OBJECT
1334 Q_PROPERTY(bool forceInstall READ forceInstall WRITE setForceInstall NOTIFY forceInstallChanged)
1335@@ -38,13 +38,12 @@
1336 UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
1337 UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, UbuntuRemoteRunConfiguration *source);
1338
1339- // AbstractRemoteLinuxRunConfiguration interface
1340 public:
1341- virtual QString localExecutableFilePath() const override;
1342- virtual QString remoteExecutableFilePath() const override;
1343- virtual QStringList arguments() const override;
1344- virtual QString workingDirectory() const override;
1345- virtual Utils::Environment environment() const override;
1346+ QString localExecutableFilePath() const;
1347+ QString remoteExecutableFilePath() const;
1348+ QStringList arguments() const;
1349+ QString workingDirectory() const;
1350+ Utils::Environment environment() const;
1351
1352 virtual QStringList soLibSearchPaths () const;
1353 bool aboutToStart (QString *errorMessage);
1354@@ -55,6 +54,7 @@
1355 virtual QString disabledReason() const override;
1356 virtual bool isConfigured() const override;
1357 virtual ConfigurationState ensureConfigured(QString *) override;
1358+ virtual ProjectExplorer::Runnable runnable ( ) const override;
1359
1360 // ProjectConfiguration interface
1361 virtual bool fromMap(const QVariantMap &map) override;
1362
1363=== modified file 'src/ubuntu/device/remote/ubunturemoteruncontrol.cpp'
1364--- src/ubuntu/device/remote/ubunturemoteruncontrol.cpp 2016-03-29 09:41:07 +0000
1365+++ src/ubuntu/device/remote/ubunturemoteruncontrol.cpp 2016-08-24 15:35:12 +0000
1366@@ -34,12 +34,12 @@
1367 #include "ubuntudevice.h"
1368 #include "ubuntuwaitfordevicedialog.h"
1369
1370-#include <remotelinux/abstractremotelinuxrunconfiguration.h>
1371 #include <projectexplorer/devicesupport/deviceapplicationrunner.h>
1372 #include <projectexplorer/kitinformation.h>
1373 #include <projectexplorer/target.h>
1374 #include <utils/environment.h>
1375 #include <coreplugin/icore.h>
1376+#include <coreplugin/coreicons.h>
1377
1378 #include <QString>
1379 #include <QIcon>
1380@@ -73,7 +73,7 @@
1381 d->environment = d->runConfig->environment();
1382 d->clickPackage = d->runConfig->clickPackage();
1383
1384- setIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));
1385+ setIcon(Core::Icons::RUN_SMALL);
1386 }
1387
1388 UbuntuRemoteRunControl::~UbuntuRemoteRunControl()
1389
1390=== modified file 'src/ubuntu/device/remote/ubunturemoteruncontrolfactory.cpp'
1391--- src/ubuntu/device/remote/ubunturemoteruncontrolfactory.cpp 2016-03-29 09:41:07 +0000
1392+++ src/ubuntu/device/remote/ubunturemoteruncontrolfactory.cpp 2016-08-24 15:35:12 +0000
1393@@ -27,13 +27,13 @@
1394 #include <debugger/debuggerplugin.h>
1395 #include <debugger/debuggerrunconfigurationaspect.h>
1396 #include <debugger/debuggerruncontrol.h>
1397+#include <qmldebug/qmldebugcommandlinearguments.h>
1398 #include <remotelinux/remotelinuxdebugsupport.h>
1399 #include <remotelinux/remotelinuxruncontrol.h>
1400 #include <remotelinux/remotelinuxanalyzesupport.h>
1401-#include <analyzerbase/analyzerstartparameters.h>
1402-#include <analyzerbase/analyzermanager.h>
1403-#include <analyzerbase/analyzerruncontrol.h>
1404-#include <analyzerbase/ianalyzertool.h>
1405+#include <debugger/analyzer/analyzerstartparameters.h>
1406+#include <debugger/analyzer/analyzermanager.h>
1407+#include <debugger/analyzer/analyzerruncontrol.h>
1408 #include <utils/portlist.h>
1409 #include <utils/qtcassert.h>
1410
1411@@ -45,7 +45,6 @@
1412
1413 bool UbuntuRemoteRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration,
1414 Core::Id mode) const {
1415-
1416 if(qobject_cast<UbuntuRemoteRunConfiguration*>(runConfiguration)) {
1417 if (mode != ProjectExplorer::Constants::NORMAL_RUN_MODE
1418 && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE
1419@@ -74,7 +73,11 @@
1420 if (!rc->aboutToStart(errorMessage))
1421 return 0;
1422
1423- QTC_ASSERT(rc, return 0);
1424+ QTC_ASSERT(rc, return 0);
1425+ const auto rcRunnable = runConfiguration->runnable();
1426+ QTC_ASSERT(rcRunnable.is<ProjectExplorer::StandardRunnable>(), return 0);
1427+ const auto stdRunnable = rcRunnable.as<ProjectExplorer::StandardRunnable>();
1428+
1429
1430 if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) {
1431 return new UbuntuRemoteRunControl(rc);
1432@@ -94,34 +97,62 @@
1433 return 0;
1434 }
1435
1436- if (2 > dev->freePorts().count()) {
1437+ auto aspect = rc->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
1438+ if (aspect->portsUsedByDebugger() > dev->freePorts().count()) {
1439 *errorMessage = tr("Cannot debug: Not enough free ports available.");
1440 return 0;
1441 }
1442- Debugger::DebuggerStartParameters params = RemoteLinux::LinuxDeviceDebugSupport::startParameters(rc);
1443+
1444+ /*
1445+ * Taken from remotelinuxruncontrolfactory.cpp and adapted
1446+ * to work here.
1447+ */
1448+ Debugger::DebuggerStartParameters params;
1449+ params.startMode = Debugger::AttachToRemoteServer;
1450+ params.closeMode = Debugger::KillAndExitMonitorAtClose;
1451+ params.remoteSetupNeeded = true;
1452+ params.useContinueInsteadOfRun = true;
1453+
1454+ if (aspect->useQmlDebugger()) {
1455+ params.qmlServer.host = dev->sshParameters().host;
1456+ params.qmlServer.port = Utils::Port(); // port is selected later on
1457+ }
1458+ if (aspect->useCppDebugger()) {
1459+ aspect->setUseMultiProcess(true);
1460+#if 1
1461+ params.inferior.executable = stdRunnable.executable;
1462+ params.inferior.commandLineArguments = stdRunnable.commandLineArguments;
1463+ if (aspect->useQmlDebugger()) {
1464+ params.inferior.commandLineArguments.prepend(QLatin1Char(' '));
1465+ params.inferior.commandLineArguments.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices));
1466+ }
1467+#endif
1468+ params.remoteChannel = dev->sshParameters().host + QLatin1String(":-1");
1469+ params.symbolFile = rc->localExecutableFilePath();
1470+ }
1471
1472 params.solibSearchPath.append(rc->soLibSearchPaths());
1473
1474- //Always leave this empty or the debugger backend tries to execute
1475- //the binary on the phone instead of attaching and continuing the already
1476- //running app
1477- params.remoteExecutable = QString();
1478- //params.expectedSignals.append("SIGTRAP");
1479-
1480- if(debug) qDebug()<<"Solib search path : "<<params.solibSearchPath;
1481-
1482- Debugger::DebuggerRunControl * const runControl
1483- = Debugger::createDebuggerRunControl(params, rc, errorMessage, mode);
1484+ Debugger::DebuggerRunControl * const runControl = Debugger::createDebuggerRunControl(params, rc, errorMessage, mode);
1485 if (!runControl)
1486 return 0;
1487+
1488 UbuntuRemoteDebugSupport * const debugSupport =
1489 new UbuntuRemoteDebugSupport(rc, runControl);
1490 connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished()));
1491 return runControl;
1492
1493 } else if ( mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE ) {
1494- Analyzer::AnalyzerStartParameters params = RemoteLinux::RemoteLinuxAnalyzeSupport::startParameters(rc, mode);
1495- Analyzer::AnalyzerRunControl *runControl = Analyzer::AnalyzerManager::createRunControl(params, runConfiguration);
1496+ /*
1497+ * Taken from remotelinuxruncontrolfactory.cpp and adapted
1498+ * to work here.
1499+ */
1500+ auto runControl = Debugger::createAnalyzerRunControl(rc, mode);
1501+ Debugger::AnalyzerConnection connection;
1502+ connection.connParams =
1503+ ProjectExplorer::DeviceKitInformation::device(rc->target()->kit())->sshParameters();
1504+ connection.analyzerHost = connection.connParams.host;
1505+ runControl->setConnection(connection);
1506 UbuntuRemoteAnalyzeSupport * const analyzeSupport =
1507 new UbuntuRemoteAnalyzeSupport(rc, runControl, mode);
1508 connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
1509
1510=== modified file 'src/ubuntu/device/remote/ubunturemoterunner.cpp'
1511--- src/ubuntu/device/remote/ubunturemoterunner.cpp 2016-03-29 09:41:07 +0000
1512+++ src/ubuntu/device/remote/ubunturemoterunner.cpp 2016-08-24 15:35:12 +0000
1513@@ -19,7 +19,7 @@
1514 const QString SSH_BASE_COMMAND = QStringLiteral("ssh -i %1 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p%2 %3@%4");
1515
1516 enum {
1517- debug = 0
1518+ debug = 1
1519 };
1520
1521 class UbuntuRemoteClickApplicationRunnerPrivate
1522
1523=== modified file 'src/ubuntu/localportsmanager.cpp'
1524--- src/ubuntu/localportsmanager.cpp 2014-11-26 19:45:36 +0000
1525+++ src/ubuntu/localportsmanager.cpp 2016-08-24 15:35:12 +0000
1526@@ -100,13 +100,13 @@
1527 if (serial == device && localPort >= m_instance->m_first && localPort <= m_instance->m_last) {
1528 if(debug) qDebug()<<"Found port already linked to device: "<<localPort<<":"<<remotePort;
1529
1530- freePorts.addPort(localPort);
1531+ freePorts.addPort(Utils::Port(localPort));
1532
1533 if (freePorts.count() == count)
1534 break;
1535 } else {
1536 if(debug) qDebug()<<"Found port in use: "<<localPort<<":"<<remotePort;
1537- usedPorts.addPort(localPort);
1538+ usedPorts.addPort(Utils::Port(localPort));
1539 }
1540 }
1541
1542@@ -116,14 +116,14 @@
1543 int port = firstPort + i;
1544
1545 //is the port in use?
1546- if(usedPorts.contains(port))
1547+ if(usedPorts.contains(Utils::Port(port)))
1548 continue;
1549
1550 //is that port already assigned to us?
1551- if(freePorts.contains(port))
1552+ if(freePorts.contains(Utils::Port(port)))
1553 continue;
1554
1555- freePorts.addPort(port);
1556+ freePorts.addPort(Utils::Port(port));
1557 found++;
1558 if(debug) qDebug()<<"Found free port: "<<port;
1559 }
1560
1561=== modified file 'src/ubuntu/ubuntuabstractguieditordocument.cpp'
1562--- src/ubuntu/ubuntuabstractguieditordocument.cpp 2015-03-06 15:02:08 +0000
1563+++ src/ubuntu/ubuntuabstractguieditordocument.cpp 2016-08-24 15:35:12 +0000
1564@@ -59,16 +59,6 @@
1565 return false;
1566 }
1567
1568-QString UbuntuAbstractGuiEditorDocument::defaultPath() const
1569-{
1570- return filePath().toFileInfo().absolutePath();
1571-}
1572-
1573-QString UbuntuAbstractGuiEditorDocument::suggestedFileName() const
1574-{
1575- return filePath().toFileInfo().fileName();
1576-}
1577-
1578 bool UbuntuAbstractGuiEditorDocument::isModified() const
1579 {
1580 return TextDocument::isModified() || m_editorWidget->isModified();
1581
1582=== modified file 'src/ubuntu/ubuntuabstractguieditordocument.h'
1583--- src/ubuntu/ubuntuabstractguieditordocument.h 2016-07-22 10:17:50 +0000
1584+++ src/ubuntu/ubuntuabstractguieditordocument.h 2016-08-24 15:35:12 +0000
1585@@ -33,10 +33,6 @@
1586 public:
1587 UbuntuAbstractGuiEditorDocument(const QString &mimeType, UbuntuAbstractGuiEditorWidget *editorWidget);
1588 bool save(QString *errorString, const QString &fileName = QString(), bool autoSave = false) override;
1589-
1590- QString defaultPath() const override;
1591- QString suggestedFileName() const override;
1592-
1593 bool isModified() const override;
1594 bool isSaveAsAllowed() const override;
1595 private:
1596
1597=== modified file 'src/ubuntu/ubuntuclickdialog.cpp'
1598--- src/ubuntu/ubuntuclickdialog.cpp 2016-05-17 16:33:36 +0000
1599+++ src/ubuntu/ubuntuclickdialog.cpp 2016-08-24 15:35:12 +0000
1600@@ -113,7 +113,7 @@
1601 int code = runProcessModal(paramList);
1602 if(mode == UbuntuClickTool::Delete) {
1603 //redetect documentation
1604- QtSupport::QtVersionManager::delayedInitialize();
1605+ QtSupport::QtVersionManager::triggerDocumentationUpdate();
1606 }
1607 return code;
1608 }
1609
1610=== modified file 'src/ubuntu/ubuntuclicktool.cpp'
1611--- src/ubuntu/ubuntuclicktool.cpp 2016-07-12 08:47:56 +0000
1612+++ src/ubuntu/ubuntuclicktool.cpp 2016-08-24 15:35:12 +0000
1613@@ -105,7 +105,7 @@
1614 const QMap<QString, QString> &envMap)
1615 {
1616 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target);
1617- if (!tc || tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
1618+ if (!tc || tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
1619 ProjectExplorer::ProcessParameters p;
1620 p.setArguments(Utils::QtcProcess::joinArgs(args));
1621 p.setCommand(cmd);
1622@@ -253,6 +253,10 @@
1623
1624 QString UbuntuClickTool::targetBasePath(const UbuntuClickTool::Target &target)
1625 {
1626+ static QMap<QString, QString> basePathCache;
1627+ if (basePathCache.contains(target.containerName))
1628+ return basePathCache.value(target.containerName);
1629+
1630 QProcess sdkTool;
1631 sdkTool.setReadChannel(QProcess::StandardOutput);
1632 sdkTool.setProgram(Constants::UBUNTU_TARGET_TOOL);
1633@@ -264,7 +268,9 @@
1634 return QString();
1635
1636 QTextStream in(&sdkTool);
1637- return in.readAll().trimmed();
1638+ QString basePath = in.readAll().trimmed();
1639+ basePathCache.insert(target.containerName, basePath);
1640+ return basePath;
1641 }
1642
1643 bool UbuntuClickTool::parseContainerName(const QString &name, UbuntuClickTool::Target *target, QStringList *allExt)
1644@@ -292,9 +298,14 @@
1645 */
1646 bool UbuntuClickTool::targetExists(const UbuntuClickTool::Target &target)
1647 {
1648+ return targetExists(target.containerName);
1649+}
1650+
1651+bool UbuntuClickTool::targetExists(const QString &targetName)
1652+{
1653 QProcess proc;
1654 proc.start(Constants::UBUNTU_TARGET_TOOL,
1655- QStringList()<<QStringLiteral("exists")<<target.containerName);
1656+ QStringList()<<QStringLiteral("exists")<<targetName);
1657 if(!proc.waitForFinished(3000)) {
1658 qWarning()<<"usdk-target did not return in time.";
1659 return false;
1660@@ -394,7 +405,7 @@
1661 return nullptr;
1662
1663 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(t->kit());
1664- if(!tc || (tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)))
1665+ if(!tc || (tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
1666 return nullptr;
1667
1668 Internal::ClickToolChain *clickTc = static_cast<Internal::ClickToolChain*>(tc);
1669@@ -460,13 +471,13 @@
1670 return UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("make"),target);
1671 }
1672
1673-QString UbuntuClickTool::mapIncludePathsForCMake(ProjectExplorer::Kit *k, const QString &in)
1674+QString UbuntuClickTool::mapIncludePathsForCMake(const ProjectExplorer::Kit *k, const QString &in)
1675 {
1676 if (in.isEmpty())
1677 return in;
1678
1679 bool canMap = ProjectExplorer::ToolChainKitInformation::toolChain(k)
1680- && ProjectExplorer::ToolChainKitInformation::toolChain(k)->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
1681+ && ProjectExplorer::ToolChainKitInformation::toolChain(k)->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID
1682 && !ProjectExplorer::SysRootKitInformation::sysRoot(k).isEmpty();
1683
1684 if (!canMap)
1685
1686=== modified file 'src/ubuntu/ubuntuclicktool.h'
1687--- src/ubuntu/ubuntuclicktool.h 2016-07-12 08:47:56 +0000
1688+++ src/ubuntu/ubuntuclicktool.h 2016-08-24 15:35:12 +0000
1689@@ -25,6 +25,7 @@
1690 #include <QFutureInterface>
1691 #include <QQueue>
1692 #include <projectexplorer/processparameters.h>
1693+#include <cmakeprojectmanager/cmaketool.h>
1694 #include <utils/qtcprocess.h>
1695 #include <QDebug>
1696
1697@@ -85,11 +86,12 @@
1698 static QString findOrCreateToolWrapper(const QString &tool, const UbuntuClickTool::Target &target);
1699 static QString findOrCreateQMakeWrapper(const UbuntuClickTool::Target &target);
1700 static QString findOrCreateMakeWrapper(const UbuntuClickTool::Target &target);
1701- static QString mapIncludePathsForCMake(ProjectExplorer::Kit *k, const QString &in);
1702+ static QString mapIncludePathsForCMake(const ProjectExplorer::Kit *k, const QString &in);
1703 static QString hostArchitecture ();
1704 static bool compatibleWithHostArchitecture (const QString &targetArch);
1705
1706 static bool targetExists (const Target& target);
1707+ static bool targetExists (const QString& targetName);
1708 static QList<Target> listAvailableTargets (const QString &framework=QString());
1709 static QList<Target> listPossibleDeviceContainers ();
1710 static const Target *clickTargetFromTarget(ProjectExplorer::Target *t);
1711
1712=== modified file 'src/ubuntu/ubuntucmakecache.cpp'
1713--- src/ubuntu/ubuntucmakecache.cpp 2014-11-14 11:12:31 +0000
1714+++ src/ubuntu/ubuntucmakecache.cpp 2016-08-24 15:35:12 +0000
1715@@ -8,6 +8,7 @@
1716
1717 #include <QRegularExpression>
1718 #include <QDir>
1719+#include <QDebug>
1720
1721 namespace Ubuntu{
1722 namespace Internal {
1723
1724=== modified file 'src/ubuntu/ubuntuconstants.h'
1725--- src/ubuntu/ubuntuconstants.h 2016-07-06 09:18:16 +0000
1726+++ src/ubuntu/ubuntuconstants.h 2016-08-24 15:35:12 +0000
1727@@ -251,6 +251,7 @@
1728
1729 const char UBUNTU_ICON[] = ":/ubuntu/images/ubuntu-32.png";
1730
1731+/*
1732 const char FEATURE_UNITY_SCOPE[] = "Ubuntu.Wizards.FeatureUnityScope";
1733 const char FEATURE_UBUNTU_PRECISE[] = "Ubuntu.Wizards.FeatureUbuntuPrecise";
1734 const char FEATURE_UBUNTU_QUANTAL[] = "Ubuntu.Wizards.FeatureUbuntuQuantal";
1735@@ -274,6 +275,7 @@
1736
1737 const char PLATFORM_DESKTOP[] = "Desktop";
1738 const char PLATFORM_DESKTOP_DISPLAYNAME[] = "Ubuntu %0";
1739+*/
1740
1741 const char TASK_DEVICE_SCRIPT[] = "Ubuntu.Task.DeviceScript";
1742
1743
1744=== modified file 'src/ubuntu/ubuntudevicemode.cpp'
1745--- src/ubuntu/ubuntudevicemode.cpp 2015-06-19 07:13:13 +0000
1746+++ src/ubuntu/ubuntudevicemode.cpp 2016-08-24 15:35:12 +0000
1747@@ -85,7 +85,6 @@
1748 m_modeView->rootContext()->setContextProperty(QLatin1String("resourceRoot") ,Constants::UBUNTU_DEVICESCREEN_ROOT);
1749 m_modeView->setSource(QUrl::fromLocalFile(Constants::UBUNTU_DEVICESCREEN_QML));
1750
1751- connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), SLOT(modeChanged(Core::IMode*)));
1752 setWidget(m_modeWidget);
1753 }
1754
1755@@ -113,11 +112,6 @@
1756 m_qmlControl->showAddEmulatorDialog();
1757 }
1758
1759-void UbuntuDeviceMode::modeChanged(Core::IMode *mode)
1760-{
1761- Q_UNUSED(mode);
1762-}
1763-
1764 void UbuntuDeviceMode::initialize() {
1765
1766 }
1767
1768=== modified file 'src/ubuntu/ubuntudevicemode.h'
1769--- src/ubuntu/ubuntudevicemode.h 2016-03-29 09:41:07 +0000
1770+++ src/ubuntu/ubuntudevicemode.h 2016-08-24 15:35:12 +0000
1771@@ -73,9 +73,6 @@
1772 signals:
1773 void updateDeviceActions ();
1774
1775-protected slots:
1776- void modeChanged(Core::IMode*);
1777-
1778 protected:
1779 static UbuntuDeviceMode *m_instance;
1780 UbuntuDevicesModel *m_devicesModel;
1781
1782=== modified file 'src/ubuntu/ubuntudevicesmodel.cpp'
1783--- src/ubuntu/ubuntudevicesmodel.cpp 2015-11-11 14:50:13 +0000
1784+++ src/ubuntu/ubuntudevicesmodel.cpp 2016-08-24 15:35:12 +0000
1785@@ -209,7 +209,7 @@
1786 case Qt::EditRole:
1787 return m_knownDevices[index.row()]->device()->displayName();
1788 case UniqueIdRole:
1789- return m_knownDevices[index.row()]->id().uniqueIdentifier();
1790+ return qVariantFromValue(m_knownDevices[index.row()]->id());
1791 case DetectionStateRole:
1792 return m_knownDevices[index.row()]->device()->detectionState();
1793 case DetectionStateStringRole:
1794@@ -294,62 +294,62 @@
1795 return QAbstractListModel::flags(index) | Qt::ItemIsEditable;
1796 }
1797
1798-void UbuntuDevicesModel::triggerPortForwarding(const int devId)
1799+void UbuntuDevicesModel::triggerPortForwarding(const QVariant &devId)
1800 {
1801- int row = findDevice(devId);
1802+ int row = findDevice(devId.value<Core::Id>());
1803 if(row < 0)
1804 return;
1805 m_knownDevices[row]->device()->enablePortForward();
1806 }
1807
1808-void UbuntuDevicesModel::triggerSSHSetup(const int devId)
1809+void UbuntuDevicesModel::triggerSSHSetup(const QVariant &devId)
1810 {
1811- int row = findDevice(devId);
1812+ int row = findDevice(devId.value<Core::Id>());
1813 if(row < 0)
1814 return;
1815 m_knownDevices[row]->device()->deployPublicKey();
1816 }
1817
1818-void UbuntuDevicesModel::triggerSSHConnection(const int devId)
1819+void UbuntuDevicesModel::triggerSSHConnection(const QVariant &devId)
1820 {
1821- int row = findDevice(devId);
1822+ int row = findDevice(devId.value<Core::Id>());
1823 if(row < 0)
1824 return;
1825 m_knownDevices[row]->device()->openTerminal();
1826 }
1827
1828-void UbuntuDevicesModel::triggerKitAutocreate(const int devId)
1829+void UbuntuDevicesModel::triggerKitAutocreate(const QVariant &devId)
1830 {
1831- int row = findDevice(devId);
1832+ int row = findDevice(devId.value<Core::Id>());
1833 if(row < 0)
1834 return;
1835 UbuntuKitManager::autoCreateKit(m_knownDevices[row]->device());
1836 }
1837
1838-void UbuntuDevicesModel::triggerKitRemove(const int devId, const QVariant &kitid)
1839+void UbuntuDevicesModel::triggerKitRemove(const QVariant &devId, const QVariant &kitid)
1840 {
1841- int row = findDevice(devId);
1842+ int row = findDevice(devId.value<Core::Id>());
1843 if(row < 0)
1844 return;
1845
1846 ProjectExplorer::Kit* k = ProjectExplorer::KitManager::find(Core::Id::fromSetting(kitid));
1847- if(ProjectExplorer::DeviceKitInformation::deviceId(k) == Core::Id::fromUniqueIdentifier(devId)) {
1848+ if(ProjectExplorer::DeviceKitInformation::deviceId(k) == devId.value<Core::Id>()) {
1849 //completely delete the kit
1850 ProjectExplorer::KitManager::deregisterKit(k);
1851 }
1852 }
1853
1854-void UbuntuDevicesModel::triggerRedetect(const int devId)
1855+void UbuntuDevicesModel::triggerRedetect(const QVariant &devId)
1856 {
1857- int row = findDevice(devId);
1858+ int row = findDevice(devId.value<Core::Id>());
1859 if(row < 0)
1860 return;
1861 m_knownDevices[row]->device()->helper()->refresh();
1862 }
1863
1864-void UbuntuDevicesModel::deleteDevice(const int devId)
1865+void UbuntuDevicesModel::deleteDevice(const QVariant &devId)
1866 {
1867- int index = findDevice(devId);
1868+ int index = findDevice(devId.value<Core::Id>());
1869 if(index < 0) {
1870 QMessageBox::critical(Core::ICore::mainWindow(),tr("Could not delete device"),tr("The device ID is unknown, please press the refresh button and try again."));
1871 return;
1872@@ -374,18 +374,18 @@
1873 }
1874 }
1875
1876-int UbuntuDevicesModel::findDevice(int uniqueIdentifier) const
1877+int UbuntuDevicesModel::findDevice(const Core::Id &devId) const
1878 {
1879 for ( int i = 0; i < m_knownDevices.size(); i++ ) {
1880- if(m_knownDevices[i]->id().uniqueIdentifier() == uniqueIdentifier)
1881+ if(m_knownDevices[i]->id() == devId)
1882 return i;
1883 }
1884 return -1;
1885 }
1886
1887-bool UbuntuDevicesModel::hasDevice(int uniqueIdentifier) const
1888+bool UbuntuDevicesModel::hasDevice(const Core::Id &devId) const
1889 {
1890- return findDevice(uniqueIdentifier) >= 0;
1891+ return findDevice(devId) >= 0;
1892 }
1893
1894 UbuntuDevice::ConstPtr UbuntuDevicesModel::device(const int index)
1895@@ -415,7 +415,7 @@
1896 {
1897 UbuntuDevicesItem* hlpr = qobject_cast<UbuntuDevicesItem*>(possibleHelper);
1898 if(!hlpr) return -1;
1899- return findDevice(hlpr->id().uniqueIdentifier());
1900+ return findDevice(hlpr->id());
1901 }
1902
1903 void UbuntuDevicesModel::deviceChanged(QObject *possibleHelper, const QVector<int> &relatedRoles)
1904@@ -529,7 +529,7 @@
1905
1906 if(debug) qDebug()<<"Device Manager reports device added: "<<id.toString();
1907
1908- if (hasDevice(id.uniqueIdentifier()))
1909+ if (hasDevice(id))
1910 return;
1911
1912 Ubuntu::Internal::UbuntuDevice::ConstPtr ubuntuDev
1913@@ -550,7 +550,7 @@
1914 */
1915 void UbuntuDevicesModel::deviceRemoved(const Core::Id &id)
1916 {
1917- int index = findDevice(id.uniqueIdentifier());
1918+ int index = findDevice(id);
1919 if(index < 0)
1920 return;
1921
1922@@ -573,7 +573,7 @@
1923 << Qt::DisplayRole << Qt::EditRole
1924 << ConnectionStateRole << ConnectionStateStringRole;
1925
1926- int index = findDevice(id.uniqueIdentifier());
1927+ int index = findDevice(id);
1928 if(index >= 0) {
1929 QModelIndex changed = createIndex(index,0);
1930 emit dataChanged(changed, changed,relatedRoles);
1931@@ -582,7 +582,7 @@
1932
1933 void UbuntuDevicesModel::deviceConnected(const QString &id)
1934 {
1935- int idx = findDevice(Core::Id::fromSetting(id).uniqueIdentifier());
1936+ int idx = findDevice(Core::Id::fromSetting(id));
1937 if(idx >= 0)
1938 return;
1939
1940@@ -599,7 +599,7 @@
1941 */
1942 void UbuntuDevicesModel::registerNewDevice(const QString &serial, const QString &arch)
1943 {
1944- if(findDevice(Core::Id::fromSetting(serial).uniqueIdentifier()) >= 0)
1945+ if(findDevice(Core::Id::fromSetting(serial)) >= 0)
1946 return;
1947
1948 if(!ClickToolChain::supportedArchitectures().contains(arch)) {
1949@@ -650,30 +650,24 @@
1950 switch(m_state) {
1951 case CheckEmulatorInstalled: {
1952 return tr("Checking if emulator tool is installed");
1953- break;
1954 }
1955 case InstallEmulator: {
1956 return tr("Installing emulator tool");
1957- break;
1958 }
1959 case CreateEmulatorImage: {
1960 return tr("Creating emulator image");
1961- break;
1962 }
1963 case ReadFromSettings:{
1964 return tr("Reading settings");
1965 }
1966 case FindImages:{
1967 return tr("Searching for emulator images");
1968- break;
1969 }
1970 case AdbList:{
1971 return tr("Querying ADB");
1972- break;
1973 }
1974 default:
1975 return QString();
1976- break;
1977 }
1978 }
1979
1980@@ -816,7 +810,7 @@
1981
1982 void UbuntuDevicesModel::startEmulator(const QString &name)
1983 {
1984- int idx = findDevice(Core::Id::fromSetting(name).uniqueIdentifier());
1985+ int idx = findDevice(Core::Id::fromSetting(name));
1986 if(idx < 0)
1987 return;
1988
1989@@ -828,7 +822,7 @@
1990
1991 void UbuntuDevicesModel::stopEmulator(const QString &name)
1992 {
1993- int idx = findDevice(Core::Id::fromSetting(name).uniqueIdentifier());
1994+ int idx = findDevice(Core::Id::fromSetting(name));
1995 if(idx < 0)
1996 return;
1997
1998@@ -841,7 +835,7 @@
1999
2000 void UbuntuDevicesModel::deleteEmulator(const QString &name)
2001 {
2002- int index = findDevice(Core::Id::fromSetting(name).uniqueIdentifier());
2003+ int index = findDevice(Core::Id::fromSetting(name));
2004 if(index < 0)
2005 return;
2006
2007@@ -865,7 +859,9 @@
2008 QVariant UbuntuDevicesModel::validateEmulatorName(const QString &name)
2009 {
2010 QString error;
2011- bool result = Utils::ProjectIntroPage::validateProjectName(name,&error);
2012+
2013+ QRegularExpression exp(QStringLiteral("^[a-zA-Z][a-zA-Z0-9]+"));
2014+ bool result = exp.match(name).hasMatch();
2015
2016 if(result) {
2017 foreach (UbuntuDevicesItem *item, m_knownDevices) {
2018@@ -877,6 +873,8 @@
2019 }
2020 }
2021 }
2022+ } else {
2023+ error = tr("Emulator names can only contain letters and numbers.");
2024 }
2025
2026 QVariantMap m;
2027@@ -966,10 +964,10 @@
2028 case FindImages: {
2029 QStringList lines = m_reply.trimmed().split(QLatin1String(Constants::LINEFEED));
2030
2031- QSet<int> notFoundImages;
2032+ QSet<Core::Id> notFoundImages;
2033 foreach(UbuntuDevicesItem *item, m_knownDevices) {
2034 if(item->device()->machineType() == ProjectExplorer::IDevice::Emulator)
2035- notFoundImages.insert(item->device()->id().uniqueIdentifier());
2036+ notFoundImages.insert(item->device()->id());
2037 }
2038
2039 QMutableStringListIterator iter(lines);
2040@@ -1021,10 +1019,10 @@
2041 bool addToManager = false;
2042 Ubuntu::Internal::UbuntuDevice::Ptr dev;
2043 Core::Id devId = Core::Id::fromSetting(deviceSerial);
2044- int index = findDevice(devId.uniqueIdentifier());
2045+ int index = findDevice(devId);
2046
2047 if(index >= 0) {
2048- notFoundImages.remove(devId.uniqueIdentifier());
2049+ notFoundImages.remove(devId);
2050 dev = m_knownDevices[index]->device();
2051 } else {
2052 dev = Ubuntu::Internal::UbuntuDevice::create(
2053@@ -1046,8 +1044,12 @@
2054 }
2055
2056 //remove all ubuntu emulators that are in the settings but don't exist in the system
2057- foreach(int curr,notFoundImages) {
2058- ProjectExplorer::DeviceManager::instance()->removeDevice(Core::Id::fromUniqueIdentifier(curr));
2059+ foreach(const Core::Id &curr,notFoundImages) {
2060+ int row = findDevice(curr);
2061+ if (row < 0 || row >= rowCount())
2062+ continue;
2063+
2064+ ProjectExplorer::DeviceManager::instance()->removeDevice(m_knownDevices.at(row)->id());
2065 }
2066
2067 queryAdb();
2068@@ -1069,7 +1071,7 @@
2069 continue;
2070 }
2071
2072- QRegularExpression exp(QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_ADB_REGEX));
2073+ QRegularExpression exp((QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_ADB_REGEX)));
2074 QRegularExpressionMatch match = exp.match(line);
2075
2076 if(match.hasMatch()) {
2077@@ -1231,4 +1233,3 @@
2078
2079 }
2080 }
2081-
2082
2083=== modified file 'src/ubuntu/ubuntudevicesmodel.h'
2084--- src/ubuntu/ubuntudevicesmodel.h 2016-07-22 10:17:50 +0000
2085+++ src/ubuntu/ubuntudevicesmodel.h 2016-08-24 15:35:12 +0000
2086@@ -88,8 +88,8 @@
2087
2088 Q_INVOKABLE bool set(int index, const QString &role, const QVariant &value);
2089
2090- int findDevice(int uniqueIdentifier) const;
2091- bool hasDevice (int uniqueIdentifier) const;
2092+ int findDevice(const Core::Id &devId) const;
2093+ bool hasDevice (const Core::Id &devId) const;
2094 UbuntuDevice::ConstPtr device ( const int index );
2095
2096 // QAbstractItemModel interface
2097@@ -116,13 +116,13 @@
2098 void stateChanged(QString arg);
2099
2100 public slots:
2101- void triggerPortForwarding ( const int devId );
2102- void triggerSSHSetup ( const int devId );
2103- void triggerSSHConnection ( const int devId );
2104- void triggerKitAutocreate ( const int devId );
2105- void triggerKitRemove ( const int devId, const QVariant &kitid );
2106- void triggerRedetect ( const int devId );
2107- void deleteDevice ( const int devId );
2108+ void triggerPortForwarding ( const QVariant &devId );
2109+ void triggerSSHSetup ( const QVariant &devId );
2110+ void triggerSSHConnection ( const QVariant &devId );
2111+ void triggerKitAutocreate ( const QVariant &devId );
2112+ void triggerKitRemove ( const QVariant &devId, const QVariant &kitid );
2113+ void triggerRedetect ( const QVariant &devId );
2114+ void deleteDevice ( const QVariant &devId );
2115 void createEmulatorImage ( const QString &name, const QString &arch, const QString &channel, const QString &passwd );
2116 void startEmulator ( const QString &name );
2117 void stopEmulator ( const QString &name );
2118
2119=== modified file 'src/ubuntu/ubuntufixmanifeststep.cpp'
2120--- src/ubuntu/ubuntufixmanifeststep.cpp 2015-02-16 12:27:25 +0000
2121+++ src/ubuntu/ubuntufixmanifeststep.cpp 2016-08-24 15:35:12 +0000
2122@@ -42,8 +42,9 @@
2123 m_packageDir = packageDir;
2124 }
2125
2126-bool UbuntuFixManifestStep::init()
2127+bool UbuntuFixManifestStep::init(QList<const BuildStep *> &earlierSteps)
2128 {
2129+ Q_UNUSED(earlierSteps);
2130 return true;
2131 }
2132
2133
2134=== modified file 'src/ubuntu/ubuntufixmanifeststep.h'
2135--- src/ubuntu/ubuntufixmanifeststep.h 2016-07-22 10:17:50 +0000
2136+++ src/ubuntu/ubuntufixmanifeststep.h 2016-08-24 15:35:12 +0000
2137@@ -18,7 +18,7 @@
2138 void setPackageDir(const QString &packageDir);
2139
2140 // BuildStep interface
2141- virtual bool init() override;
2142+ virtual bool init(QList<const BuildStep *> &earlierSteps) override;
2143 virtual void run(QFutureInterface<bool> &fi) override;
2144 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
2145
2146
2147=== modified file 'src/ubuntu/ubuntuhtmlbuildconfiguration.cpp'
2148--- src/ubuntu/ubuntuhtmlbuildconfiguration.cpp 2015-04-28 14:32:58 +0000
2149+++ src/ubuntu/ubuntuhtmlbuildconfiguration.cpp 2016-08-24 15:35:12 +0000
2150@@ -162,7 +162,8 @@
2151 QList<ProjectExplorer::BuildInfo *> builds;
2152
2153 ProjectExplorer::BuildInfo *info = new ProjectExplorer::BuildInfo(this);
2154- info->buildDirectory = Utils::FileName::fromString(UbuntuProject::shadowBuildDirectory(projectDir,k,QStringLiteral("default")));
2155+ QString sBd = UbuntuProject::shadowBuildDirectory(projectDir,k,QStringLiteral("default"), ProjectExplorer::BuildConfiguration::Unknown);
2156+ info->buildDirectory = Utils::FileName::fromString(sBd);
2157 info->typeName = tr("Html5");
2158 info->kitId = k->id();
2159 info->displayName = tr("Default");
2160
2161=== modified file 'src/ubuntu/ubuntukitmanager.cpp'
2162--- src/ubuntu/ubuntukitmanager.cpp 2016-05-17 16:33:36 +0000
2163+++ src/ubuntu/ubuntukitmanager.cpp 2016-08-24 15:35:12 +0000
2164@@ -20,7 +20,9 @@
2165 #include <qtsupport/qtkitinformation.h>
2166
2167 #include <cmakeprojectmanager/cmaketoolmanager.h>
2168+#include <cmakeprojectmanager/cmaketool.h>
2169 #include <cmakeprojectmanager/cmakekitinformation.h>
2170+#include <cmakeprojectmanager/cmakeconfigitem.h>
2171 #include <qtsupport/qtversionmanager.h>
2172
2173 #include <QMessageBox>
2174@@ -86,7 +88,7 @@
2175 if(tc) {
2176 if (!tc->isAutoDetected())
2177 continue;
2178- if (tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
2179+ if (tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
2180 continue;
2181 toolchains << static_cast<ClickToolChain *>(tc);
2182 }
2183@@ -101,7 +103,7 @@
2184 if (!tc)
2185 return false;
2186
2187- if (tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
2188+ if (tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
2189 return false;
2190
2191 ClickToolChain *cTc = static_cast<ClickToolChain *>(tc);
2192@@ -127,7 +129,7 @@
2193 }
2194 }
2195
2196- UbuntuQtVersion *qtVersion = new UbuntuQtVersion(Utils::FileName::fromString(qmakePath),false);
2197+ UbuntuQtVersion *qtVersion = new UbuntuQtVersion(tc->clickTarget().containerName, Utils::FileName::fromString(qmakePath),false);
2198 QtSupport::QtVersionManager::addVersion(qtVersion);
2199 return qtVersion;
2200 }
2201@@ -159,7 +161,8 @@
2202 {
2203 QString cmakePathStr = UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("cmake"), target);
2204 Utils::FileName cmakePath = Utils::FileName::fromString(cmakePathStr);
2205- CMakeProjectManager::CMakeTool *cmake = new CMakeProjectManager::CMakeTool(CMakeProjectManager::CMakeTool::AutoDetection);
2206+ CMakeProjectManager::CMakeTool *cmake = new CMakeProjectManager::CMakeTool(CMakeProjectManager::CMakeTool::AutoDetection,
2207+ CMakeProjectManager::CMakeTool::createId());
2208
2209 cmake->setCMakeExecutable(cmakePath);
2210 cmake->setDisplayName(tr("Ubuntu SDK cmake (%1-%2-%3)")
2211@@ -322,7 +325,7 @@
2212 continue;
2213
2214 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
2215- if (tc && tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
2216+ if (tc && tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
2217 continue;
2218
2219 //@TODO check for ubuntu device information
2220@@ -364,7 +367,7 @@
2221 foreach (ProjectExplorer::Kit *k, existingKits) {
2222 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
2223 CMakeProjectManager::CMakeTool* cmake = CMakeProjectManager::CMakeKitInformation::cmakeTool(k);
2224- if (tc && tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
2225+ if (tc && tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID
2226 && cmake
2227 && cmake->isValid()) {
2228 fixKit(k);
2229@@ -562,13 +565,20 @@
2230 k->setMutable(ProjectExplorer::SysRootKitInformation::id(),false);
2231
2232 //make sure we use a ubuntu Qt version
2233- QtSupport::QtKitInformation::setQtVersion(k, createOrFindQtVersion(tc));
2234+ UbuntuQtVersion *qtVer = createOrFindQtVersion(tc);
2235+ QtSupport::QtKitInformation::setQtVersion(k, qtVer);
2236
2237 //make sure we use a ubuntu cmake
2238 CMakeProjectManager::CMakeTool *cmake = createOrFindCMakeTool(tc);
2239 if(cmake) {
2240+ CMakeProjectManager::CMakeConfig conf{
2241+ CMakeProjectManager::CMakeConfigItem("QT_QMAKE_EXECUTABLE", qtVer->remoteQMakeCommand().toUtf8()),
2242+ CMakeProjectManager::CMakeConfigItem("CMAKE_CXX_COMPILER", tc->remoteCompilerCommand().toUtf8())
2243+ };
2244+
2245 cmake->setPathMapper(&UbuntuClickTool::mapIncludePathsForCMake);
2246 CMakeProjectManager::CMakeKitInformation::setCMakeTool(k, cmake->id());
2247+ CMakeProjectManager::CMakeConfigurationKitInformation::setConfiguration(k , conf);
2248 }
2249
2250 }
2251
2252=== modified file 'src/ubuntu/ubuntumenu.cpp'
2253--- src/ubuntu/ubuntumenu.cpp 2016-03-29 09:41:07 +0000
2254+++ src/ubuntu/ubuntumenu.cpp 2016-08-24 15:35:12 +0000
2255@@ -116,7 +116,7 @@
2256 isClickTarget = startupProject->activeTarget()
2257 && startupProject->activeTarget()->kit()
2258 && ProjectExplorer::ToolChainKitInformation::toolChain(startupProject->activeTarget()->kit())
2259- && ProjectExplorer::ToolChainKitInformation::toolChain(startupProject->activeTarget()->kit())->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID);
2260+ && ProjectExplorer::ToolChainKitInformation::toolChain(startupProject->activeTarget()->kit())->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID;
2261 }
2262
2263 //bool canRun = projectExplorerInstance->canRun(startupProject,ProjectExplorer::NormalRunMode);
2264
2265=== modified file 'src/ubuntu/ubuntupackagestep.cpp'
2266--- src/ubuntu/ubuntupackagestep.cpp 2015-11-27 10:06:33 +0000
2267+++ src/ubuntu/ubuntupackagestep.cpp 2016-08-24 15:35:12 +0000
2268@@ -77,8 +77,9 @@
2269 cleanup();
2270 }
2271
2272-bool UbuntuPackageStep::init()
2273+bool UbuntuPackageStep::init(QList<const BuildStep *> &earlierSteps)
2274 {
2275+ Q_UNUSED(earlierSteps);
2276 //initialization happens in internalInit,
2277 //because it requires informations that are only available at this
2278 //time
2279@@ -277,8 +278,9 @@
2280 }
2281 emit addOutput(tr("Configuration is invalid. Aborting build")
2282 ,ProjectExplorer::BuildStep::MessageOutput);
2283- fi.reportResult(false);
2284- emit finished();
2285+
2286+ reportRunResult(fi, false);
2287+ cleanup();
2288 return;
2289 }
2290
2291@@ -487,9 +489,9 @@
2292
2293 //the process failed, lets clean up
2294 if (!success) {
2295- m_futureInterface->reportResult(false);
2296+ if(m_futureInterface)
2297+ reportRunResult(*m_futureInterface, false);
2298 cleanup();
2299- emit finished();
2300 }
2301 return success;
2302 }
2303@@ -572,9 +574,9 @@
2304 .arg(m_deployDir),
2305 BuildStep::ErrorMessageOutput);
2306
2307- m_futureInterface->reportResult(false);
2308+ if(m_futureInterface)
2309+ reportRunResult(*m_futureInterface, false);
2310 cleanup();
2311- emit finished();
2312 return;
2313 }
2314
2315@@ -584,9 +586,9 @@
2316 .arg(err),
2317 BuildStep::ErrorMessageOutput);
2318
2319- m_futureInterface->reportResult(false);
2320+ if(m_futureInterface)
2321+ reportRunResult(*m_futureInterface, false);
2322 cleanup();
2323- emit finished();
2324 return;
2325 }
2326
2327@@ -623,7 +625,7 @@
2328 continue;
2329
2330 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
2331- if(!tc || tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
2332+ if(!tc || tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
2333 qWarning()<<"Incompatible Toolchain for hook"<<hook.appId;
2334 continue;
2335 }
2336@@ -745,9 +747,9 @@
2337
2338 if (m_packageMode == OnlyMakeInstall) {
2339
2340- m_futureInterface->reportResult(true);
2341+ if(m_futureInterface)
2342+ reportRunResult(*m_futureInterface, true);
2343 cleanup();
2344- emit finished();
2345
2346 return;
2347 }
2348@@ -772,7 +774,7 @@
2349 if (!processFinished())
2350 return;
2351
2352- QRegularExpression exp(QLatin1String(Constants::UBUNTU_CLICK_SUCCESS_PACKAGE_REGEX));
2353+ QRegularExpression exp((QLatin1String(Constants::UBUNTU_CLICK_SUCCESS_PACKAGE_REGEX)));
2354 QRegularExpressionMatch m = exp.match(m_lastLine);
2355 if(m.hasMatch()) {
2356 m_clickPackageName = m.captured(1);
2357@@ -794,9 +796,9 @@
2358 if (!processFinished(IgnoreReturnCode))
2359 return;
2360
2361- m_futureInterface->reportResult(true);
2362+ if(m_futureInterface)
2363+ reportRunResult(*m_futureInterface, true);
2364 cleanup();
2365- emit finished();
2366 }
2367
2368 default:
2369@@ -824,7 +826,8 @@
2370
2371 void UbuntuPackageStep::onProcessFailedToStart()
2372 {
2373- m_futureInterface->reportResult(false);
2374+ if(m_futureInterface)
2375+ reportRunResult(*m_futureInterface, false);
2376
2377 ProjectExplorer::ProcessParameters *params;
2378 if (m_state == MakeInstall)
2379@@ -837,7 +840,6 @@
2380 params->prettyArguments()),
2381 BuildStep::ErrorMessageOutput);
2382
2383- emit finished();
2384 cleanup();
2385
2386 }
2387
2388=== modified file 'src/ubuntu/ubuntupackagestep.h'
2389--- src/ubuntu/ubuntupackagestep.h 2015-07-08 15:38:37 +0000
2390+++ src/ubuntu/ubuntupackagestep.h 2016-08-24 15:35:12 +0000
2391@@ -55,7 +55,7 @@
2392
2393 public:
2394 // BuildStep interface
2395- virtual bool init() override;
2396+ virtual bool init(QList<const ProjectExplorer::BuildStep *> &earlierSteps) override;
2397 virtual void run(QFutureInterface<bool> &fi) override;
2398 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
2399 virtual bool immutable() const override;
2400
2401=== modified file 'src/ubuntu/ubuntupackagingmode.cpp'
2402--- src/ubuntu/ubuntupackagingmode.cpp 2015-03-03 17:23:52 +0000
2403+++ src/ubuntu/ubuntupackagingmode.cpp 2016-08-24 15:35:12 +0000
2404@@ -80,8 +80,6 @@
2405 m_modeView->rootContext()->setContextProperty(QLatin1String("resourceRoot") ,Constants::UBUNTU_DEVICESCREEN_ROOT);
2406 m_modeView->setSource(QUrl::fromLocalFile(Constants::UBUNTU_PUBLISHSCREEN_QML));
2407
2408- connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), SLOT(modeChanged(Core::IMode*)));
2409-
2410 QObject* sessionManager = ProjectExplorer::SessionManager::instance();
2411 connect(sessionManager,SIGNAL(projectAdded(ProjectExplorer::Project*)),SLOT(on_projectAdded(ProjectExplorer::Project*)));
2412 connect(sessionManager,SIGNAL(projectRemoved(ProjectExplorer::Project*)),SLOT(on_projectRemoved(ProjectExplorer::Project*)));
2413@@ -95,10 +93,6 @@
2414
2415 }
2416
2417-void UbuntuPackagingMode::modeChanged(Core::IMode* currentMode) {
2418- previousMode = currentMode->id();
2419-}
2420-
2421 void UbuntuPackagingMode::updateModeState() {
2422 ProjectExplorer::Project* startupProject = ProjectExplorer::SessionManager::startupProject();
2423
2424
2425=== modified file 'src/ubuntu/ubuntupackagingmode.h'
2426--- src/ubuntu/ubuntupackagingmode.h 2015-01-29 07:49:13 +0000
2427+++ src/ubuntu/ubuntupackagingmode.h 2016-08-24 15:35:12 +0000
2428@@ -40,15 +40,12 @@
2429 void initialize();
2430
2431 protected slots:
2432- void modeChanged(Core::IMode*);
2433-
2434 void on_projectAdded(ProjectExplorer::Project *project);
2435 void on_projectRemoved(ProjectExplorer::Project *project);
2436 void updateModeState();
2437
2438 protected:
2439 QWidget* m_modeWidget;
2440- Core::Id previousMode;
2441
2442 private:
2443 static UbuntuPackagingMode* m_instance;
2444
2445=== modified file 'src/ubuntu/ubuntupackagingmodel.cpp'
2446--- src/ubuntu/ubuntupackagingmodel.cpp 2016-07-06 09:18:16 +0000
2447+++ src/ubuntu/ubuntupackagingmodel.cpp 2016-08-24 15:35:12 +0000
2448@@ -404,7 +404,7 @@
2449 p->activeTarget() &&
2450 p->activeTarget()->kit() &&
2451 ProjectExplorer::ToolChainKitInformation::toolChain(p->activeTarget()->kit()) &&
2452- (ProjectExplorer::ToolChainKitInformation::toolChain(p->activeTarget()->kit())->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
2453+ (ProjectExplorer::ToolChainKitInformation::toolChain(p->activeTarget()->kit())->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID
2454 || p->projectManager()->mimeType() == QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE));
2455
2456 setCanBuild(buildButtonsEnabled);
2457@@ -467,7 +467,7 @@
2458 m_packageBuildSteps.append(QSharedPointer<ProjectExplorer::BuildStepList> (new ProjectExplorer::BuildStepList(b,ProjectExplorer::Constants::BUILDSTEPS_BUILD)));
2459
2460 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(b->target()->kit());
2461- if(tc && tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)){
2462+ if(tc && tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID){
2463 ClickToolChain *cTc = static_cast<ClickToolChain *>(tc);
2464 usedArchitectures << cTc->clickTarget().architecture;
2465 }
2466
2467=== modified file 'src/ubuntu/ubuntuplugin.cpp'
2468--- src/ubuntu/ubuntuplugin.cpp 2016-07-07 09:11:32 +0000
2469+++ src/ubuntu/ubuntuplugin.cpp 2016-08-24 15:35:12 +0000
2470@@ -161,8 +161,8 @@
2471 addAutoReleasedObject(new UbuntuSettingsProjectDefaultsPage);
2472 addAutoReleasedObject(new UbuntuSettingsDeviceConnectivityPage);
2473
2474- addAutoReleasedObject(new UbuntuVersionManager);
2475- Core::IWizardFactory::registerFeatureProvider(new UbuntuFeatureProvider);
2476+ //addAutoReleasedObject(new UbuntuVersionManager);
2477+ //Core::IWizardFactory::registerFeatureProvider(new UbuntuFeatureProvider);
2478
2479 // welcome page plugin
2480 addAutoReleasedObject(new UbuntuWelcomePage);
2481
2482=== modified file 'src/ubuntu/ubuntuplugin.h'
2483--- src/ubuntu/ubuntuplugin.h 2016-05-30 08:28:41 +0000
2484+++ src/ubuntu/ubuntuplugin.h 2016-08-24 15:35:12 +0000
2485@@ -24,7 +24,6 @@
2486 #include "ubuntudevicemode.h"
2487 #include "ubuntumenu.h"
2488 #include "ubuntuprojectmanager.h"
2489-#include "ubuntufeatureprovider.h"
2490 #include "ubuntuversionmanager.h"
2491 #include "ubuntupackagingmode.h"
2492 #include "ubuntusettingsdeviceconnectivitypage.h"
2493
2494=== modified file 'src/ubuntu/ubuntuproject.cpp'
2495--- src/ubuntu/ubuntuproject.cpp 2016-05-12 06:50:19 +0000
2496+++ src/ubuntu/ubuntuproject.cpp 2016-08-24 15:35:12 +0000
2497@@ -36,7 +36,6 @@
2498
2499 setId(Constants::UBUNTUPROJECT_ID);
2500 setRequiredKitMatcher(UbuntuKitMatcher());
2501- setPreferredKitMatcher(QtSupport::QtKitInformation::qtVersionMatcher(Core::FeatureSet(QtSupport::Constants::FEATURE_DESKTOP)));
2502
2503 setProjectContext(Core::Context(Constants::UBUNTUPROJECT_PROJECTCONTEXT));
2504
2505@@ -46,6 +45,7 @@
2506 m_file = QSharedPointer<UbuntuProjectFile>(new UbuntuProjectFile(this, fileName));
2507
2508 Core::DocumentManager::addDocument(m_file.data(), true);
2509+ setDocument(m_file.data());
2510
2511 m_rootNode = QSharedPointer<UbuntuProjectNode>(new UbuntuProjectNode(this, m_file.data()));
2512 m_manager->registerProject(this);
2513@@ -82,10 +82,6 @@
2514 return m_projectName;
2515 }
2516
2517-Core::IDocument *UbuntuProject::document() const {
2518- return m_file.data();
2519-}
2520-
2521 ProjectExplorer::IProjectManager *UbuntuProject::projectManager() const {
2522 return m_manager;
2523 }
2524@@ -137,7 +133,10 @@
2525 return true;
2526 }
2527
2528-QString UbuntuProject::shadowBuildDirectory(const QString &proFilePath, const ProjectExplorer::Kit *k, const QString &suffix)
2529+QString UbuntuProject::shadowBuildDirectory(const QString &proFilePath
2530+ , const ProjectExplorer::Kit *k
2531+ , const QString &suffix
2532+ , const ProjectExplorer::BuildConfiguration::BuildType buildType)
2533 {
2534 if (proFilePath.isEmpty())
2535 return QString();
2536@@ -149,7 +148,7 @@
2537 return info.absolutePath();
2538
2539 const QString projectName = QFileInfo(proFilePath).completeBaseName();
2540- ProjectExplorer::ProjectMacroExpander expander(projectName, k, suffix);
2541+ ProjectExplorer::ProjectMacroExpander expander(proFilePath, projectName, k, suffix, buildType);
2542 QDir projectDir = QDir(projectDirectory(Utils::FileName::fromString(proFilePath)).toString());
2543 QString buildPath = expander.expand(Core::DocumentManager::buildDirectory());
2544 return QDir::cleanPath(projectDir.absoluteFilePath(buildPath));
2545@@ -164,7 +163,7 @@
2546 bool UbuntuKitMatcher::matches(const ProjectExplorer::Kit *k)
2547 {
2548 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
2549- if (tc->type() == QLatin1String(Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
2550+ if (tc->typeId() == Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
2551 return true;
2552
2553 return false;
2554
2555=== modified file 'src/ubuntu/ubuntuproject.h'
2556--- src/ubuntu/ubuntuproject.h 2015-03-03 17:23:52 +0000
2557+++ src/ubuntu/ubuntuproject.h 2016-08-24 15:35:12 +0000
2558@@ -42,6 +42,7 @@
2559 #include <projectexplorer/session.h>
2560 #include <projectexplorer/runconfiguration.h>
2561 #include <projectexplorer/applicationlauncher.h>
2562+#include <projectexplorer/buildconfiguration.h>
2563
2564 namespace Ubuntu {
2565 namespace Internal {
2566@@ -65,7 +66,6 @@
2567 UbuntuProject(UbuntuProjectManager *manager, const QString &fileName);
2568
2569 QString displayName() const override;
2570- Core::IDocument *document() const override;
2571 ProjectExplorer::IProjectManager *projectManager() const override;
2572
2573 ProjectExplorer::ProjectNode *rootProjectNode() const override;
2574@@ -88,7 +88,9 @@
2575 bool needsConfiguration() const override;
2576 bool requiresTargetPanel() const override;
2577
2578- static QString shadowBuildDirectory(const QString &proFilePath, const ProjectExplorer::Kit *k, const QString &suffix = QString());
2579+ static QString shadowBuildDirectory(const QString &proFilePath, const ProjectExplorer::Kit *k,
2580+ const QString &suffix = QString(),
2581+ const ProjectExplorer::BuildConfiguration::BuildType buildType = ProjectExplorer::BuildConfiguration::Unknown);
2582 private:
2583 void extractProjectFileData(const QString& filename);
2584
2585
2586=== modified file 'src/ubuntu/ubuntuprojectfile.cpp'
2587--- src/ubuntu/ubuntuprojectfile.cpp 2015-03-03 17:23:52 +0000
2588+++ src/ubuntu/ubuntuprojectfile.cpp 2016-08-24 15:35:12 +0000
2589@@ -34,14 +34,6 @@
2590 return false;
2591 }
2592
2593-QString UbuntuProjectFile::defaultPath() const {
2594- return QString();
2595-}
2596-
2597-QString UbuntuProjectFile::suggestedFileName() const {
2598- return QString();
2599-}
2600-
2601 bool UbuntuProjectFile::isModified() const {
2602 return false;
2603 }
2604
2605=== modified file 'src/ubuntu/ubuntuprojectfile.h'
2606--- src/ubuntu/ubuntuprojectfile.h 2015-03-03 17:23:52 +0000
2607+++ src/ubuntu/ubuntuprojectfile.h 2016-08-24 15:35:12 +0000
2608@@ -47,10 +47,6 @@
2609 ~UbuntuProjectFile() {}
2610
2611 bool save(QString *errorString, const QString &fileName, bool autoSave) override;
2612-
2613- QString defaultPath() const override;
2614- QString suggestedFileName() const override;
2615-
2616 bool isModified() const override;
2617 bool isSaveAsAllowed() const override;
2618
2619
2620=== modified file 'src/ubuntu/ubuntuprojectnode.cpp'
2621--- src/ubuntu/ubuntuprojectnode.cpp 2015-03-03 17:23:52 +0000
2622+++ src/ubuntu/ubuntuprojectnode.cpp 2016-08-24 15:35:12 +0000
2623@@ -87,7 +87,7 @@
2624 if (! end)
2625 return 0;
2626
2627- QString baseDir = path().toFileInfo().path();
2628+ QString baseDir = filePath().toFileInfo().path();
2629
2630 QString folderName;
2631 for (int i = 0; i < end; ++i) {
2632
2633=== modified file 'src/ubuntu/ubuntuqmlbuildconfiguration.cpp'
2634--- src/ubuntu/ubuntuqmlbuildconfiguration.cpp 2015-04-28 14:47:49 +0000
2635+++ src/ubuntu/ubuntuqmlbuildconfiguration.cpp 2016-08-24 15:35:12 +0000
2636@@ -11,6 +11,7 @@
2637 #include <projectexplorer/kitinformation.h>
2638 #include <projectexplorer/buildsteplist.h>
2639 #include <utils/fancylineedit.h>
2640+#include <utils/algorithm.h>
2641 #include <utils/mimetypes/mimedatabase.h>
2642 #include <qmlprojectmanager/qmlprojectconstants.h>
2643
2644@@ -184,7 +185,11 @@
2645 QList<ProjectExplorer::BuildInfo *> builds;
2646
2647 ProjectExplorer::BuildInfo *info = new ProjectExplorer::BuildInfo(this);
2648- info->buildDirectory = Utils::FileName::fromString(UbuntuProject::shadowBuildDirectory(projectDir,k,QStringLiteral("default")));
2649+ info->buildDirectory = Utils::FileName::fromString(UbuntuProject::shadowBuildDirectory(
2650+ projectDir,
2651+ k,
2652+ QStringLiteral("default"),
2653+ ProjectExplorer::BuildConfiguration::Unknown));
2654 info->typeName = tr("Qml");
2655 info->kitId = k->id();
2656 info->displayName = tr("Default");
2657@@ -231,8 +236,9 @@
2658 : AbstractProcessStep(bsl,bs)
2659 {}
2660
2661-bool UbuntuQmlUpdateTranslationTemplateStep::init()
2662+bool UbuntuQmlUpdateTranslationTemplateStep::init(QList<const BuildStep *> &earlierSteps)
2663 {
2664+ Q_UNUSED(earlierSteps);
2665 QString projectDir = target()->project()->projectDirectory().toString();
2666
2667 ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();
2668@@ -269,9 +275,9 @@
2669 : UbuntuQmlUpdateTranslationTemplateStep(bsl,bs)
2670 {}
2671
2672-bool UbuntuQmlBuildTranslationStep::init()
2673+bool UbuntuQmlBuildTranslationStep::init(QList<const BuildStep *> &earlierSteps)
2674 {
2675- if(!UbuntuQmlUpdateTranslationTemplateStep::init())
2676+ if(!UbuntuQmlUpdateTranslationTemplateStep::init(earlierSteps))
2677 return false;
2678
2679 ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();
2680@@ -303,36 +309,35 @@
2681 return UbuntuQmlUpdateTranslationTemplateStep::run(fi);
2682 }
2683
2684-QList<Core::Id> UbuntuQmlBuildStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const
2685-{
2686+bool UbuntuQmlBuildStepFactory::canHandle(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
2687+{
2688+ return Utils::contains(availableSteps(parent), Utils::equal(&ProjectExplorer::BuildStepInfo::id, id));
2689+}
2690+
2691+QList<ProjectExplorer::BuildStepInfo> UbuntuQmlBuildStepFactory::availableSteps(ProjectExplorer::BuildStepList *parent) const
2692+{
2693+ QList<ProjectExplorer::BuildStepInfo> res;
2694+
2695 if(parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD)
2696- return QList<Core::Id>();
2697+ return res;
2698
2699 UbuntuKitMatcher m;
2700 if(!m.matches(parent->target()->kit())
2701 || parent->target()->project()->id() != "QmlProjectManager.QmlProject")
2702- return QList<Core::Id>();
2703-
2704- return QList<Core::Id>()<<Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP<<Constants::UBUNTU_CLICK_QML_UPDATE_TRANSL_MAKESTEP;
2705-}
2706-
2707-QString UbuntuQmlBuildStepFactory::displayNameForId(const Core::Id id) const
2708-{
2709- if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)
2710- return tr("Build translations");
2711- else if(id == Constants::UBUNTU_CLICK_QML_UPDATE_TRANSL_MAKESTEP)
2712- return tr("Update translations template");
2713- return QString();
2714-}
2715-
2716-bool UbuntuQmlBuildStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
2717-{
2718- return availableCreationIds(parent).contains(id);
2719+ return res;
2720+
2721+ res << ProjectExplorer::BuildStepInfo(Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP,
2722+ tr("Build translations"),
2723+ ProjectExplorer::BuildStepInfo::UniqueStep)
2724+ << ProjectExplorer::BuildStepInfo(Constants::UBUNTU_CLICK_QML_UPDATE_TRANSL_MAKESTEP,
2725+ tr("Update translations template"),
2726+ ProjectExplorer::BuildStepInfo::UniqueStep);
2727+ return res;
2728 }
2729
2730 ProjectExplorer::BuildStep *UbuntuQmlBuildStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
2731 {
2732- QTC_ASSERT(canCreate(parent,id),return 0);
2733+ QTC_ASSERT(canHandle(parent,id),return 0);
2734
2735 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)
2736 return new UbuntuQmlBuildTranslationStep(parent);
2737@@ -342,18 +347,13 @@
2738 return nullptr;
2739 }
2740
2741-bool UbuntuQmlBuildStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
2742-{
2743- return availableCreationIds(parent).contains(ProjectExplorer::idFromMap(map));
2744-}
2745-
2746 ProjectExplorer::BuildStep *UbuntuQmlBuildStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
2747 {
2748- QTC_ASSERT(canRestore(parent,map),return 0);
2749-
2750 ProjectExplorer::AbstractProcessStep *step = 0;
2751 Core::Id id = ProjectExplorer::idFromMap(map);
2752
2753+ QTC_ASSERT(canHandle(parent,id),return 0);
2754+
2755 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)
2756 step = new UbuntuQmlBuildTranslationStep(parent);
2757 else if(id == Constants::UBUNTU_CLICK_QML_UPDATE_TRANSL_MAKESTEP)
2758@@ -369,14 +369,9 @@
2759 return step;
2760 }
2761
2762-bool UbuntuQmlBuildStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
2763-{
2764- return availableCreationIds(parent).contains(product->id());
2765-}
2766-
2767 ProjectExplorer::BuildStep *UbuntuQmlBuildStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
2768 {
2769- QTC_ASSERT(canClone(parent,product),return 0);
2770+ QTC_ASSERT(canHandle(parent,product->id()),return 0);
2771
2772 const Core::Id id = product->id();
2773 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)
2774
2775=== modified file 'src/ubuntu/ubuntuqmlbuildconfiguration.h'
2776--- src/ubuntu/ubuntuqmlbuildconfiguration.h 2016-07-22 10:17:50 +0000
2777+++ src/ubuntu/ubuntuqmlbuildconfiguration.h 2016-08-24 15:35:12 +0000
2778@@ -57,7 +57,7 @@
2779 UbuntuQmlUpdateTranslationTemplateStep(ProjectExplorer::BuildStepList *bsl, UbuntuQmlUpdateTranslationTemplateStep *bs);
2780
2781 // BuildStep interface
2782- virtual bool init() override;
2783+ virtual bool init(QList<const BuildStep *> &earlierSteps) override;
2784 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
2785
2786 QString makeCommand(ProjectExplorer::ToolChain *tc, const Utils::Environment &env) const;
2787@@ -71,7 +71,7 @@
2788 UbuntuQmlBuildTranslationStep(ProjectExplorer::BuildStepList *bsl, UbuntuQmlBuildTranslationStep *bs);
2789
2790 // BuildStep interface
2791- virtual bool init() override;
2792+ virtual bool init(QList<const BuildStep *> &earlierSteps) override;
2793 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
2794 void run(QFutureInterface<bool> &fi) override;
2795
2796@@ -107,14 +107,14 @@
2797
2798 public:
2799 // IBuildStepFactory interface
2800- virtual QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const override;
2801- virtual QString displayNameForId(const Core::Id id) const override;
2802- virtual bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const override;
2803+ virtual QList<ProjectExplorer::BuildStepInfo> availableSteps(ProjectExplorer::BuildStepList *parent) const override;
2804 virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) override;
2805- virtual bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const override;
2806 virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override;
2807- virtual bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const override;
2808 virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) override;
2809+
2810+private:
2811+ bool canHandle(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
2812+
2813 };
2814
2815 } // namespace Internal
2816
2817=== modified file 'src/ubuntu/ubuntuqtversion.cpp'
2818--- src/ubuntu/ubuntuqtversion.cpp 2016-03-22 13:32:33 +0000
2819+++ src/ubuntu/ubuntuqtversion.cpp 2016-08-24 15:35:12 +0000
2820@@ -2,16 +2,20 @@
2821 #include "ubuntuconstants.h"
2822 #include "settings.h"
2823
2824+#include <ubuntu/device/container/containerdevice.h>
2825+#include <ubuntu/ubuntuclicktool.h>
2826 #include <qtsupport/qtsupportconstants.h>
2827
2828 #include <QCoreApplication>
2829 #include <QFileInfo>
2830 #include <QDebug>
2831+#include <QDir>
2832
2833 namespace Ubuntu {
2834 namespace Internal {
2835
2836 const char SCRIPT_VERSION_KEY[] = "UbuntuQtVersion.ScriptVersion";
2837+const char CONTAINER_NAME[] = "UbuntuQtVersion.ContainerName";
2838
2839 /*!
2840 * \brief MIN_SCRIPT_VERSION
2841@@ -25,9 +29,10 @@
2842 m_scriptVersion(MIN_SCRIPT_VERSION)
2843 { }
2844
2845-UbuntuQtVersion::UbuntuQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
2846+UbuntuQtVersion::UbuntuQtVersion(const QString &containerName, const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
2847 : BaseQtVersion(path, isAutodetected, autodetectionSource),
2848- m_scriptVersion(MIN_SCRIPT_VERSION)
2849+ m_scriptVersion(MIN_SCRIPT_VERSION),
2850+ m_containerName(containerName)
2851 {
2852 setUnexpandedDisplayName(defaultUnexpandedDisplayName(path, false));
2853 }
2854@@ -39,12 +44,21 @@
2855 {
2856 BaseQtVersion::fromMap(map);
2857 m_scriptVersion = map.value(QLatin1String(SCRIPT_VERSION_KEY),0).toInt();
2858+ m_containerName = map.value(QLatin1String(CONTAINER_NAME),QString()).toString();
2859+
2860+ if (m_containerName.isEmpty()) {
2861+ //ok, this is a old QtVersion, we need to restore the container name from the
2862+ //qmake path
2863+ Utils::FileName command = this->qmakeCommand();
2864+ m_containerName = command.toFileInfo().dir().dirName();
2865+ }
2866 }
2867
2868 QVariantMap UbuntuQtVersion::toMap() const
2869 {
2870 QVariantMap map = BaseQtVersion::toMap();
2871 map.insert(QLatin1String(SCRIPT_VERSION_KEY),m_scriptVersion);
2872+ map.insert(QLatin1String(CONTAINER_NAME), m_containerName);
2873 return map;
2874 }
2875
2876@@ -68,15 +82,23 @@
2877 return QCoreApplication::translate("QtVersion", "Ubuntu Phone", "Qt Version is used for Ubuntu Phone development");
2878 }
2879
2880-QString UbuntuQtVersion::platformName() const
2881-{
2882- return QLatin1String(Constants::UBUNTU_PLATFORM_NAME);
2883-}
2884-
2885-QString UbuntuQtVersion::platformDisplayName() const
2886-{
2887- return QLatin1String(Constants::UBUNTU_PLATFORM_NAME_TR);
2888-}
2889+QSet<Core::Id> UbuntuQtVersion::targetDeviceTypes() const
2890+{
2891+ QSet<Core::Id> set{
2892+ Constants::UBUNTU_DEVICE_TYPE_ID
2893+ };
2894+
2895+ auto hostAbi = ProjectExplorer::Abi::hostAbi();
2896+ for (const ProjectExplorer::Abi &abi : qtAbis()) {
2897+ if (abi.architecture() == hostAbi.architecture() &&
2898+ abi.os() == hostAbi.os()) {
2899+ set << ContainerDevice::createIdForContainer(m_containerName);
2900+ }
2901+ }
2902+
2903+ return set;
2904+}
2905+
2906 int UbuntuQtVersion::scriptVersion() const
2907 {
2908 return m_scriptVersion;
2909@@ -92,6 +114,11 @@
2910 return MIN_SCRIPT_VERSION;
2911 }
2912
2913+QString UbuntuQtVersion::remoteQMakeCommand() const
2914+{
2915+ return QString::fromLatin1("/usr/bin/%2").arg(qmakeCommand().fileName());
2916+}
2917+
2918 bool UbuntuQtVersion::hasQmlDump() const
2919 {
2920 return false;
2921@@ -132,10 +159,18 @@
2922 {
2923 Q_UNUSED(evaluator);
2924 //we only care about our qmakes
2925- if(!qmakePath.toFileInfo().absolutePath().contains(Settings::settingsPath().toString()))
2926- return 0;
2927-
2928- return new UbuntuQtVersion(qmakePath,isAutoDetected,autoDetectionSource);
2929+ QFileInfo qmakeInfo = qmakePath.toFileInfo();
2930+ if(!qmakeInfo.absolutePath().contains(Settings::settingsPath().toString()))
2931+ return 0;
2932+
2933+ if(!qmakeInfo.isSymLink() || qmakeInfo.symLinkTarget() != Constants::UBUNTU_CLICK_TARGET_WRAPPER)
2934+ return 0;
2935+
2936+ QString containerName = qmakePath.toFileInfo().dir().dirName();
2937+ if (!UbuntuClickTool::targetExists(containerName))
2938+ return 0;
2939+
2940+ return new UbuntuQtVersion(containerName, qmakePath,isAutoDetected,autoDetectionSource);
2941 }
2942
2943 } // namespace Internal
2944
2945=== modified file 'src/ubuntu/ubuntuqtversion.h'
2946--- src/ubuntu/ubuntuqtversion.h 2016-03-22 13:32:33 +0000
2947+++ src/ubuntu/ubuntuqtversion.h 2016-08-24 15:35:12 +0000
2948@@ -11,7 +11,7 @@
2949 {
2950 public:
2951 UbuntuQtVersion();
2952- UbuntuQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
2953+ UbuntuQtVersion(const QString &containerName, const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
2954 ~UbuntuQtVersion() override;
2955
2956 // BaseQtVersion interface
2957@@ -26,14 +26,15 @@
2958
2959 QString description() const override;
2960
2961- QString platformName() const override;
2962- QString platformDisplayName() const override;
2963+ virtual QSet<Core::Id> targetDeviceTypes() const override;
2964
2965 int scriptVersion() const;
2966 void setScriptVersion(int scriptVersion);
2967
2968 static int minimalScriptVersion ();
2969
2970+ QString remoteQMakeCommand () const;
2971+
2972 // BaseQtVersion interface
2973 virtual bool hasQmlDump() const override;
2974 virtual bool hasQmlDumpWithRelocatableFlag() const override;
2975@@ -41,6 +42,7 @@
2976
2977 private:
2978 int m_scriptVersion;
2979+ QString m_containerName;
2980 };
2981
2982 class UbuntuQtVersionFactory : public QtSupport::QtVersionFactory
2983
2984=== modified file 'src/ubuntu/ubuntuwelcomemode.cpp'
2985--- src/ubuntu/ubuntuwelcomemode.cpp 2016-04-19 12:09:54 +0000
2986+++ src/ubuntu/ubuntuwelcomemode.cpp 2016-08-24 15:35:12 +0000
2987@@ -24,6 +24,7 @@
2988 #include <QQmlContext>
2989
2990 #include <utils/fileutils.h>
2991+#include <utils/algorithm.h>
2992 #include <coreplugin/iwizardfactory.h>
2993 #include <projectexplorer/projectexplorer.h>
2994
2995@@ -69,7 +70,10 @@
2996
2997 void UbuntuWelcomePage::newProject()
2998 {
2999- Core::ICore::showNewItemDialog(tr("New Project"), Core::IWizardFactory::wizardFactoriesOfKind(Core::IWizardFactory::ProjectWizard));
3000+ Core::ICore::showNewItemDialog(tr("New Project"), Utils::filtered(Core::IWizardFactory::allWizardFactories(),
3001+ [](Core::IWizardFactory *f) {
3002+ return f->kind() == Core::IWizardFactory::ProjectWizard;
3003+ }));
3004 }
3005
3006 void UbuntuWelcomePage::openProject()
3007
3008=== modified file 'src/ubuntu/wizards/createtargetwizard.cpp'
3009--- src/ubuntu/wizards/createtargetwizard.cpp 2016-07-12 08:47:56 +0000
3010+++ src/ubuntu/wizards/createtargetwizard.cpp 2016-08-24 15:35:12 +0000
3011@@ -364,7 +364,7 @@
3012 return true;
3013 });
3014 ui->lineEditName->setPlaceholderText(tr("Please select a name"));
3015- ui->lineEditName->triggerChanged();
3016+ ui->lineEditName->validate();
3017
3018 setTitle(tr("Please type a name:"));
3019 setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Name"));
3020
3021=== modified file 'src/ubuntu/wizards/ubuntufatpackagingwizard.cpp'
3022--- src/ubuntu/wizards/ubuntufatpackagingwizard.cpp 2016-07-06 09:18:16 +0000
3023+++ src/ubuntu/wizards/ubuntufatpackagingwizard.cpp 2016-08-24 15:35:12 +0000
3024@@ -231,7 +231,7 @@
3025 QString fw;
3026 foreach (ProjectExplorer::BuildConfiguration *conf, selectedSuspects()) {
3027 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(conf->target()->kit());
3028- if (tc && tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
3029+ if (tc && tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
3030 ClickToolChain *cTc = static_cast<ClickToolChain *>(tc);
3031 if (fw.isEmpty())
3032 fw = cTc->clickTarget().framework;
3033
3034=== modified file 'src/ubuntu/wizards/ubuntufirstrunwizard.cpp'
3035--- src/ubuntu/wizards/ubuntufirstrunwizard.cpp 2016-05-17 16:33:36 +0000
3036+++ src/ubuntu/wizards/ubuntufirstrunwizard.cpp 2016-08-24 15:35:12 +0000
3037@@ -135,7 +135,7 @@
3038 if (!tc || !QtSupport::QtKitInformation::qtVersion(curr))
3039 continue;
3040
3041- if (tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
3042+ if (tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
3043 found = true;
3044
3045 QTreeWidgetItem* kitItem = new QTreeWidgetItem;
3046
3047=== modified file 'src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp'
3048--- src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp 2016-05-12 06:50:19 +0000
3049+++ src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp 2016-08-24 15:35:12 +0000
3050@@ -33,6 +33,7 @@
3051 #include <extensionsystem/pluginmanager.h>
3052 #include <cmakeprojectmanager/cmakekitinformation.h>
3053 #include <cmakeprojectmanager/cmaketool.h>
3054+#include <coreplugin/id.h>
3055
3056 #include <projectexplorer/kitinformation.h>
3057 #include <projectexplorer/toolchain.h>
3058@@ -141,14 +142,16 @@
3059 }
3060
3061
3062-Core::FeatureSet UbuntuProjectApplicationWizard::requiredFeatures() const
3063+QSet<Core::Id> UbuntuProjectApplicationWizard::requiredFeatures() const
3064 {
3065 #ifdef Q_PROCESSOR_ARM
3066 return CustomProjectWizard::requiredFeatures();
3067 #else
3068- return CustomProjectWizard::requiredFeatures()
3069- | Core::Feature(QtSupport::Constants::FEATURE_QMLPROJECT)
3070- | Core::Feature::versionedFeature(QtSupport::Constants::FEATURE_QT_QUICK_PREFIX, 2);
3071+ QSet<Core::Id> features = CustomProjectWizard::requiredFeatures();
3072+ features << QtSupport::Constants::FEATURE_QMLPROJECT
3073+ << Core::Id::versionedId(QtSupport::Constants::FEATURE_QT_QUICK_PREFIX, 2);
3074+
3075+ return features;
3076 #endif
3077 }
3078
3079@@ -220,7 +223,7 @@
3080 bool found = false;
3081 foreach(ProjectExplorer::Kit *curr, allKits) {
3082 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(curr);
3083- if (tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {
3084+ if (tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
3085 found = true;
3086 break;
3087 }
3088@@ -279,7 +282,7 @@
3089 #endif
3090 //this is just a fallback for now to remove all ubuntu kits until cross compiling is sorted out
3091 //it should not be hit at all but i keep it there just to be safe
3092- m_targetSetupPage->setRequiredKitMatcher(QtSupport::QtKitInformation::platformMatcher(QLatin1String(QtSupport::Constants::DESKTOP_PLATFORM)));
3093+ m_targetSetupPage->setRequiredKitMatcher(QtSupport::QtKitInformation::platformMatcher(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE));
3094 break;
3095 }
3096 case UbuntuProjectApplicationWizard::QMakeProject:
3097
3098=== modified file 'src/ubuntu/wizards/ubuntuprojectapplicationwizard.h'
3099--- src/ubuntu/wizards/ubuntuprojectapplicationwizard.h 2015-06-11 14:03:50 +0000
3100+++ src/ubuntu/wizards/ubuntuprojectapplicationwizard.h 2016-08-24 15:35:12 +0000
3101@@ -58,7 +58,7 @@
3102 bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage) const override;
3103
3104 private:
3105- Core::FeatureSet requiredFeatures() const;
3106+ QSet<Core::Id> requiredFeatures() const;
3107 ProjectType m_type;
3108 };
3109
3110
3111=== modified file 'src/ubuntu/wizards/ubuntuprojectmigrationwizard.cpp'
3112--- src/ubuntu/wizards/ubuntuprojectmigrationwizard.cpp 2015-04-28 14:47:49 +0000
3113+++ src/ubuntu/wizards/ubuntuprojectmigrationwizard.cpp 2016-08-24 15:35:12 +0000
3114@@ -135,7 +135,7 @@
3115 {
3116 UbuntuProjectMigrationWizard wiz(project,parent);
3117 if(wiz.exec() == QDialog::Accepted) {
3118- bool multiTargetProject = project->rootQmakeProjectNode()->projectType() == QmakeProjectManager::SubDirsTemplate;
3119+ bool multiTargetProject = project->rootProjectNode()->projectType() == QmakeProjectManager::SubDirsTemplate;
3120
3121
3122 QMap<QString,QString> base_replacements;
3123@@ -168,7 +168,7 @@
3124 bool canRead = true;
3125 //setup the file reader correctly
3126
3127- if (ProFile *pro = reader->parsedProFile(node->path().toString())) {
3128+ if (ProFile *pro = reader->parsedProFile(node->filePath().toString())) {
3129 if(!reader->accept(pro, QMakeEvaluator::LoadAll)) {
3130 canRead = false;
3131 }
3132@@ -179,7 +179,7 @@
3133
3134
3135 if(!canRead) {
3136- printToOutputPane(tr("Can not parse %1, skipping migration.").arg(node->path().toString()));
3137+ printToOutputPane(tr("Can not parse %1, skipping migration.").arg(node->filePath().toString()));
3138 continue;
3139 }
3140
3141@@ -308,7 +308,7 @@
3142 //now add required files
3143 if(projectType == QmakeProjectManager::ApplicationTemplate) {
3144
3145- QFileInfo proFilePath(node->path().toString());
3146+ QFileInfo proFilePath(node->filePath().toFileInfo());
3147
3148 QmakeProjectManager::TargetInformation targetInfo = node->targetInformation();
3149 if(hookTargets.contains(targetInfo.target)) {
3150@@ -441,7 +441,7 @@
3151 manifestFile.write(doc.toJson());
3152 manifestFile.close();
3153
3154- project->rootQmakeProjectNode()->addSubProjects(QStringList()<<QString::fromLatin1("%1/%2").arg(project->projectDirectory().toString()).arg(QStringLiteral("/manifest.pro")));
3155+ project->rootProjectNode()->addSubProjects(QStringList()<<QString::fromLatin1("%1/%2").arg(project->projectDirectory().toString()).arg(QStringLiteral("/manifest.pro")));
3156 }
3157 }
3158 }

Subscribers

People subscribed via source and target branches