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

Proposed by Benjamin Zeller
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 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

- More fixes
- Upgrading to latest QtC checkout

468. By Benjamin Zeller

Merge trunk

469. By Benjamin Zeller

Fix the profiler

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'UbuntuPlugin.pro'
--- UbuntuPlugin.pro 2016-05-17 16:33:36 +0000
+++ UbuntuPlugin.pro 2016-08-24 15:35:12 +0000
@@ -52,9 +52,9 @@
52 src/ubuntu/ubuntuproject.cpp \52 src/ubuntu/ubuntuproject.cpp \
53 src/ubuntu/ubuntuprojectfile.cpp \53 src/ubuntu/ubuntuprojectfile.cpp \
54 src/ubuntu/ubuntuprojectnode.cpp \54 src/ubuntu/ubuntuprojectnode.cpp \
55 src/ubuntu/ubuntuversion.cpp \55 #src/ubuntu/ubuntuversion.cpp \
56 src/ubuntu/ubuntufeatureprovider.cpp \56 #src/ubuntu/ubuntufeatureprovider.cpp \
57 src/ubuntu/ubuntuversionmanager.cpp \57 #src/ubuntu/ubuntuversionmanager.cpp \
58 src/ubuntu/ubuntupackagingmode.cpp \58 src/ubuntu/ubuntupackagingmode.cpp \
59 src/ubuntu/ubuntubzr.cpp \59 src/ubuntu/ubuntubzr.cpp \
60 src/ubuntu/ubuntuclickmanifest.cpp \60 src/ubuntu/ubuntuclickmanifest.cpp \
@@ -121,9 +121,9 @@
121 src/ubuntu/ubuntuproject.h \121 src/ubuntu/ubuntuproject.h \
122 src/ubuntu/ubuntuprojectfile.h \122 src/ubuntu/ubuntuprojectfile.h \
123 src/ubuntu/ubuntuprojectnode.h \123 src/ubuntu/ubuntuprojectnode.h \
124 src/ubuntu/ubuntuversion.h \124 #src/ubuntu/ubuntuversion.h \
125 src/ubuntu/ubuntufeatureprovider.h \125 #src/ubuntu/ubuntufeatureprovider.h \
126 src/ubuntu/ubuntuversionmanager.h \126 #src/ubuntu/ubuntuversionmanager.h \
127 src/ubuntu/ubuntupackagingmode.h \127 src/ubuntu/ubuntupackagingmode.h \
128 src/ubuntu/ubuntubzr.h \128 src/ubuntu/ubuntubzr.h \
129 src/ubuntu/ubuntuclickmanifest.h \129 src/ubuntu/ubuntuclickmanifest.h \
130130
=== modified file 'src/ubuntu/clicktoolchain.cpp'
--- src/ubuntu/clicktoolchain.cpp 2016-03-18 13:13:22 +0000
+++ src/ubuntu/clicktoolchain.cpp 2016-08-24 15:35:12 +0000
@@ -20,6 +20,7 @@
20#include "ubuntuconstants.h"20#include "ubuntuconstants.h"
2121
22#include <utils/fileutils.h>22#include <utils/fileutils.h>
23#include <utils/algorithm.h>
23#include <projectexplorer/abi.h>24#include <projectexplorer/abi.h>
24#include <QDebug>25#include <QDebug>
25#include <QVariant>26#include <QVariant>
@@ -79,11 +80,6 @@
79 return Utils::FileName::fromString(QLatin1String("/usr/bin/gdb-multiarch"));80 return Utils::FileName::fromString(QLatin1String("/usr/bin/gdb-multiarch"));
80}81}
8182
82QString ClickToolChain::type() const
83{
84 return QString::fromLatin1(Constants::UBUNTU_CLICK_TOOLCHAIN_ID);
85}
86
87QString ClickToolChain::typeDisplayName() const83QString ClickToolChain::typeDisplayName() const
88{84{
89 return ClickToolChainFactory::tr("Ubuntu GCC");85 return ClickToolChainFactory::tr("Ubuntu GCC");
@@ -139,6 +135,11 @@
139 return clickArchitectures.keys();135 return clickArchitectures.keys();
140}136}
141137
138QString ClickToolChain::remoteCompilerCommand() const
139{
140 return QString::fromLatin1("/usr/bin/%1").arg(compilerCommand().fileName());
141}
142
142QVariantMap ClickToolChain::toMap() const143QVariantMap ClickToolChain::toMap() const
143{144{
144 QVariantMap map = GccToolChain::toMap();145 QVariantMap map = GccToolChain::toMap();
@@ -196,7 +197,7 @@
196}197}
197198
198ClickToolChain::ClickToolChain(const UbuntuClickTool::Target &target, Detection d)199ClickToolChain::ClickToolChain(const UbuntuClickTool::Target &target, Detection d)
199 : GccToolChain(QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID), d)200 : GccToolChain(Constants::UBUNTU_CLICK_TOOLCHAIN_ID, d)
200 , m_clickTarget(target)201 , m_clickTarget(target)
201{202{
202 resetToolChain(Utils::FileName::fromString(203 resetToolChain(Utils::FileName::fromString(
@@ -216,24 +217,24 @@
216}217}
217218
218ClickToolChain::ClickToolChain()219ClickToolChain::ClickToolChain()
219 : GccToolChain(QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID),ManualDetection)220 : GccToolChain(Constants::UBUNTU_CLICK_TOOLCHAIN_ID,ManualDetection)
220{221{
221}222}
222223
223ClickToolChainFactory::ClickToolChainFactory()224ClickToolChainFactory::ClickToolChainFactory()
224{225{
225 setId(Constants::UBUNTU_CLICK_TOOLCHAIN_ID);
226 setDisplayName(tr("Ubuntu GCC"));226 setDisplayName(tr("Ubuntu GCC"));
227}227}
228228
229QList<ProjectExplorer::ToolChain *> ClickToolChainFactory::autoDetect()229QList<ProjectExplorer::ToolChain *> ClickToolChainFactory::autoDetect(
230 const QList<ProjectExplorer::ToolChain *> &alreadyKnown)
230{231{
231 return createToolChainsForClickTargets();232 return createToolChainsForClickTargets(alreadyKnown);
232}233}
233234
234bool ClickToolChainFactory::canRestore(const QVariantMap &data)235bool ClickToolChainFactory::canRestore(const QVariantMap &data)
235{236{
236 return idFromMap(data).startsWith(QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID) + QLatin1Char(':'));237 return typeIdFromMap(data) == Constants::UBUNTU_CLICK_TOOLCHAIN_ID;
237}238}
238239
239ProjectExplorer::ToolChain *ClickToolChainFactory::restore(const QVariantMap &data)240ProjectExplorer::ToolChain *ClickToolChainFactory::restore(const QVariantMap &data)
@@ -259,7 +260,7 @@
259 return 0;260 return 0;
260}261}
261262
262QList<ProjectExplorer::ToolChain *> ClickToolChainFactory::createToolChainsForClickTargets()263QList<ProjectExplorer::ToolChain *> ClickToolChainFactory::createToolChainsForClickTargets(const QList<ProjectExplorer::ToolChain *> &alreadyKnown)
263{264{
264 QList<ProjectExplorer::ToolChain*> toolChains;265 QList<ProjectExplorer::ToolChain*> toolChains;
265266
@@ -270,10 +271,20 @@
270 if(!clickArchitectures.contains(target.architecture))271 if(!clickArchitectures.contains(target.architecture))
271 continue;272 continue;
272273
273 if(UbuntuClickTool::findOrCreateGccWrapper(target).isEmpty())274 QString comp = UbuntuClickTool::findOrCreateGccWrapper(target);
275 if(comp.isEmpty())
274 continue;276 continue;
275277
276 ClickToolChain* tc = new ClickToolChain(target, ProjectExplorer::ToolChain::AutoDetection);278 auto predicate = [&](ProjectExplorer::ToolChain *tc) {
279 if (tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
280 return false;
281 auto clickTc = static_cast<ClickToolChain *>(tc);
282 return clickTc->clickTarget().containerName == target.containerName;
283 };
284
285 ProjectExplorer::ToolChain *tc = Utils::findOrDefault(alreadyKnown, predicate);
286 if (!tc)
287 tc = new ClickToolChain(target, ProjectExplorer::ToolChain::AutoDetection);
277 toolChains.append(tc);288 toolChains.append(tc);
278 }289 }
279290
280291
=== modified file 'src/ubuntu/clicktoolchain.h'
--- src/ubuntu/clicktoolchain.h 2015-06-30 13:34:14 +0000
+++ src/ubuntu/clicktoolchain.h 2016-08-24 15:35:12 +0000
@@ -37,7 +37,6 @@
3737
38 virtual QList<Utils::FileName> suggestedMkspecList() const override;38 virtual QList<Utils::FileName> suggestedMkspecList() const override;
39 virtual Utils::FileName suggestedDebugger() const override;39 virtual Utils::FileName suggestedDebugger() const override;
40 virtual QString type() const override;
41 virtual QString typeDisplayName() const override;40 virtual QString typeDisplayName() const override;
42 virtual bool isValid() const override;41 virtual bool isValid() const override;
43 virtual void addToEnvironment(Utils::Environment &env) const override;42 virtual void addToEnvironment(Utils::Environment &env) const override;
@@ -53,6 +52,8 @@
53 static ProjectExplorer::Abi architectureNameToAbi ( const QString &arch );52 static ProjectExplorer::Abi architectureNameToAbi ( const QString &arch );
54 static QList<QString> supportedArchitectures ();53 static QList<QString> supportedArchitectures ();
5554
55 QString remoteCompilerCommand () const;
56
56protected:57protected:
57 virtual bool fromMap(const QVariantMap &data) override;58 virtual bool fromMap(const QVariantMap &data) override;
5859
@@ -75,11 +76,11 @@
7576
76 // ToolChainFactory interface77 // ToolChainFactory interface
77public:78public:
78 virtual QList<ProjectExplorer::ToolChain *> autoDetect() override;79 virtual QList<ProjectExplorer::ToolChain *> autoDetect(const QList<ProjectExplorer::ToolChain *> &alreadyKnown) override;
79 virtual bool canRestore(const QVariantMap &data) override;80 virtual bool canRestore(const QVariantMap &data) override;
80 virtual ProjectExplorer::ToolChain *restore(const QVariantMap &data) override;81 virtual ProjectExplorer::ToolChain *restore(const QVariantMap &data) override;
8182
82 static QList<ProjectExplorer::ToolChain *> createToolChainsForClickTargets();83 static QList<ProjectExplorer::ToolChain *> createToolChainsForClickTargets(const QList<ProjectExplorer::ToolChain *> &alreadyKnown);
83};84};
8485
85} // namespace Internal86} // namespace Internal
8687
=== modified file 'src/ubuntu/device/container/containerdeviceprocess.cpp'
--- src/ubuntu/device/container/containerdeviceprocess.cpp 2016-05-23 07:26:49 +0000
+++ src/ubuntu/device/container/containerdeviceprocess.cpp 2016-08-24 15:35:12 +0000
@@ -3,6 +3,7 @@
33
4#include <utils/qtcassert.h>4#include <utils/qtcassert.h>
5#include <utils/qtcprocess.h>5#include <utils/qtcprocess.h>
6#include <projectexplorer/runnables.h>
67
7#include <QProcess>8#include <QProcess>
8#include <QDebug>9#include <QDebug>
@@ -30,13 +31,11 @@
30 };31 };
3132
32 connect(cleaner, &SshDeviceProcess::finished, callback);33 connect(cleaner, &SshDeviceProcess::finished, callback);
33 cleaner->start(QStringLiteral("rm"), QStringList{m_pidFile});
34}
3534
36void ContainerDeviceProcess::setWorkingDirectory(const QString &directory)35 ProjectExplorer::StandardRunnable r;
37{36 r.executable = QStringLiteral("rm");
38 m_workingDir = directory;37 r.commandLineArguments = m_pidFile;
39 LinuxDeviceProcess::setWorkingDirectory(directory);38 cleaner->start(r);
40}39}
4140
42void ContainerDeviceProcess::doSignal(const int sig)41void ContainerDeviceProcess::doSignal(const int sig)
@@ -50,11 +49,14 @@
50 }49 }
51 signaler->deleteLater();50 signaler->deleteLater();
52 });51 });
53 QString cmd = QString::fromLatin1("kill -%2 `cat %1`").arg(m_pidFile).arg(sig);52
54 signaler->start(cmd, QStringList());53 ProjectExplorer::StandardRunnable r;
54 r.executable = QStringLiteral("kill");
55 r.commandLineArguments = QString::fromLatin1("-%2 `cat %1`").arg(m_pidFile).arg(sig);
56 signaler->start(r);
55}57}
5658
57QString ContainerDeviceProcess::fullCommandLine() const59QString ContainerDeviceProcess::fullCommandLine(const ProjectExplorer::StandardRunnable &runnable) const
58{60{
59 QString fullCommandLine;61 QString fullCommandLine;
60 QStringList rcFiles {62 QStringList rcFiles {
@@ -63,12 +65,12 @@
63 };65 };
64 foreach (const QString &filePath, rcFiles)66 foreach (const QString &filePath, rcFiles)
65 fullCommandLine += QString::fromLatin1("test -f %1 && . %1;").arg(filePath);67 fullCommandLine += QString::fromLatin1("test -f %1 && . %1;").arg(filePath);
66 if (!m_workingDir.isEmpty()) {68 if (runnable.workingDirectory.isEmpty()) {
67 fullCommandLine.append(QLatin1String("cd ")).append(Utils::QtcProcess::quoteArgUnix(m_workingDir))69 fullCommandLine.append(QLatin1String("cd ")).append(Utils::QtcProcess::quoteArgUnix(runnable.workingDirectory))
68 .append(QLatin1String(" && "));70 .append(QLatin1String(" && "));
69 }71 }
70 QString envString;72 QString envString;
71 for (auto it = environment().constBegin(); it != environment().constEnd(); ++it) {73 for (auto it = runnable.environment.constBegin(); it != runnable.environment.constEnd(); ++it) {
72 if (!envString.isEmpty())74 if (!envString.isEmpty())
73 envString += QLatin1Char(' ');75 envString += QLatin1Char(' ');
74 envString.append(it.key()).append(QLatin1String("='")).append(it.value())76 envString.append(it.key()).append(QLatin1String("='")).append(it.value())
@@ -82,10 +84,10 @@
8284
83 fullCommandLine.append(Utils::QtcProcess::quoteArgUnix(QStringLiteral("dbus-run-session")));85 fullCommandLine.append(Utils::QtcProcess::quoteArgUnix(QStringLiteral("dbus-run-session")));
84 fullCommandLine += QString::fromLatin1(" bash -c \"echo \\$\\$ > %1; exec ").arg(m_pidFile);86 fullCommandLine += QString::fromLatin1(" bash -c \"echo \\$\\$ > %1; exec ").arg(m_pidFile);
85 fullCommandLine.append(Utils::QtcProcess::quoteArgUnix(executable()));87 fullCommandLine.append(Utils::QtcProcess::quoteArgUnix(runnable.executable));
86 if (!arguments().isEmpty()) {88 if (!runnable.commandLineArguments.isEmpty()) {
87 fullCommandLine.append(QLatin1Char(' '));89 fullCommandLine.append(QLatin1Char(' '));
88 fullCommandLine.append(Utils::QtcProcess::joinArgs(arguments(), Utils::OsTypeLinux));90 fullCommandLine.append(runnable.commandLineArguments);
89 }91 }
90 fullCommandLine.append(QStringLiteral("\""));92 fullCommandLine.append(QStringLiteral("\""));
91 return fullCommandLine;93 return fullCommandLine;
9294
=== modified file 'src/ubuntu/device/container/containerdeviceprocess.h'
--- src/ubuntu/device/container/containerdeviceprocess.h 2016-04-08 09:01:23 +0000
+++ src/ubuntu/device/container/containerdeviceprocess.h 2016-08-24 15:35:12 +0000
@@ -17,7 +17,6 @@
17public:17public:
18 ContainerDeviceProcess(const QSharedPointer<const ProjectExplorer::IDevice> &device, QObject *parent = 0);18 ContainerDeviceProcess(const QSharedPointer<const ProjectExplorer::IDevice> &device, QObject *parent = 0);
19 ~ContainerDeviceProcess();19 ~ContainerDeviceProcess();
20 virtual void setWorkingDirectory(const QString &directory) override;
2120
22 // DeviceProcess interface21 // DeviceProcess interface
23 virtual void interrupt() override { doSignal(2); }22 virtual void interrupt() override { doSignal(2); }
@@ -27,8 +26,7 @@
27 void doSignal (const int sig);26 void doSignal (const int sig);
28private:27private:
29 // SshDeviceProcess interface28 // SshDeviceProcess interface
30 virtual QString fullCommandLine() const override;29 virtual QString fullCommandLine(const ProjectExplorer::StandardRunnable &) const override;
31 QString m_workingDir;
32 QString m_pidFile;30 QString m_pidFile;
3331
34};32};
3533
=== modified file 'src/ubuntu/device/container/ubuntulocaldeployconfiguration.cpp'
--- src/ubuntu/device/container/ubuntulocaldeployconfiguration.cpp 2016-04-06 09:35:59 +0000
+++ src/ubuntu/device/container/ubuntulocaldeployconfiguration.cpp 2016-08-24 15:35:12 +0000
@@ -134,7 +134,7 @@
134134
135void UbuntuLocalDeployConfiguration::selectAsDefaultHack()135void UbuntuLocalDeployConfiguration::selectAsDefaultHack()
136{136{
137 target()->setActiveDeployConfiguration(this);137 //target()->setActiveDeployConfiguration(this);
138}138}
139139
140} // namespace Internal140} // namespace Internal
141141
=== modified file 'src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp'
--- src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp 2016-07-22 10:17:50 +0000
+++ src/ubuntu/device/container/ubuntulocalrunconfiguration.cpp 2016-08-24 15:35:12 +0000
@@ -30,6 +30,7 @@
30#include <qtsupport/qtkitinformation.h>30#include <qtsupport/qtkitinformation.h>
31#include <projectexplorer/target.h>31#include <projectexplorer/target.h>
32#include <projectexplorer/buildconfiguration.h>32#include <projectexplorer/buildconfiguration.h>
33#include <projectexplorer/runnables.h>
33#include <utils/environment.h>34#include <utils/environment.h>
34#include <utils/qtcprocess.h>35#include <utils/qtcprocess.h>
35#include <cmakeprojectmanager/cmakeproject.h>36#include <cmakeprojectmanager/cmakeproject.h>
@@ -60,14 +61,14 @@
60}61}
6162
62UbuntuLocalRunConfiguration::UbuntuLocalRunConfiguration(ProjectExplorer::Target *parent, Core::Id id)63UbuntuLocalRunConfiguration::UbuntuLocalRunConfiguration(ProjectExplorer::Target *parent, Core::Id id)
63 : RemoteLinux::AbstractRemoteLinuxRunConfiguration(parent, id)64 : ProjectExplorer::RunConfiguration(parent, id)
64{65{
65 setDisplayName(appId());66 setDisplayName(appId());
66 addExtraAspect(new UbuntuLocalEnvironmentAspect(this));67 addExtraAspect(new UbuntuLocalEnvironmentAspect(this));
67}68}
6869
69UbuntuLocalRunConfiguration::UbuntuLocalRunConfiguration(ProjectExplorer::Target *parent, UbuntuLocalRunConfiguration *source)70UbuntuLocalRunConfiguration::UbuntuLocalRunConfiguration(ProjectExplorer::Target *parent, UbuntuLocalRunConfiguration *source)
70 : RemoteLinux::AbstractRemoteLinuxRunConfiguration(parent,source)71 : ProjectExplorer::RunConfiguration(parent,source)
71{72{
72}73}
7374
@@ -126,6 +127,23 @@
126 return Configured;127 return Configured;
127}128}
128129
130ProjectExplorer::Runnable UbuntuLocalRunConfiguration::runnable() const
131{
132 if (m_executable.isEmpty())
133 return ProjectExplorer::Runnable();
134
135 ProjectExplorer::StandardRunnable r;
136 r.executable = remoteExecutableFilePath();
137 r.device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
138 r.commandLineArguments = Utils::QtcProcess::joinArgs(arguments(), Utils::OsTypeLinux);
139
140 // Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
141 r.workingDirectory = Utils::FileUtils::normalizePathName(m_workingDir.toString());
142 r.environment = environment();
143
144 return r;
145}
146
129bool UbuntuLocalRunConfiguration::aboutToStart(QString *errorMessage)147bool UbuntuLocalRunConfiguration::aboutToStart(QString *errorMessage)
130{148{
131 if(target()->project()->id() != Constants::UBUNTUPROJECT_ID) {149 if(target()->project()->id() != Constants::UBUNTUPROJECT_ID) {
@@ -628,7 +646,7 @@
628 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());646 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
629 ClickToolChain *uTc = nullptr;647 ClickToolChain *uTc = nullptr;
630648
631 if (tc && tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))649 if (tc && tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
632 uTc = static_cast<ClickToolChain *>(tc);650 uTc = static_cast<ClickToolChain *>(tc);
633651
634 if (uTc) {652 if (uTc) {
635653
=== modified file 'src/ubuntu/device/container/ubuntulocalrunconfiguration.h'
--- src/ubuntu/device/container/ubuntulocalrunconfiguration.h 2016-07-22 10:17:50 +0000
+++ src/ubuntu/device/container/ubuntulocalrunconfiguration.h 2016-08-24 15:35:12 +0000
@@ -20,7 +20,7 @@
20#define UBUNTURUNCONFIGURATION_H20#define UBUNTURUNCONFIGURATION_H
2121
22#include <QObject>22#include <QObject>
23#include <remotelinux/abstractremotelinuxrunconfiguration.h>23#include <projectexplorer/runconfiguration.h>
24#include <projectexplorer/deployconfiguration.h>24#include <projectexplorer/deployconfiguration.h>
25#include <projectexplorer/applicationlauncher.h>25#include <projectexplorer/applicationlauncher.h>
26#include <remotelinux/remotelinuxenvironmentaspect.h>26#include <remotelinux/remotelinuxenvironmentaspect.h>
@@ -46,7 +46,7 @@
4646
47};47};
4848
49class UbuntuLocalRunConfiguration : public RemoteLinux::AbstractRemoteLinuxRunConfiguration49class UbuntuLocalRunConfiguration : public ProjectExplorer::RunConfiguration
50{50{
51 Q_OBJECT51 Q_OBJECT
52public:52public:
@@ -60,16 +60,16 @@
60 QString appId() const;60 QString appId() const;
61 void addToBaseEnvironment(Utils::Environment &env) const;61 void addToBaseEnvironment(Utils::Environment &env) const;
6262
63 // AbstractRemoteLinuxRunConfiguration interface63 QString localExecutableFilePath() const;
64 virtual QString localExecutableFilePath() const override;64 QString remoteExecutableFilePath() const;
65 virtual QString remoteExecutableFilePath() const override;65 QStringList arguments() const;
66 virtual QStringList arguments() const override;66 Utils::Environment environment() const;
67 virtual Utils::Environment environment() const override;67 QString workingDirectory() const;
68 virtual QString workingDirectory() const override;
6968
70 // RunConfiguration interface69 // RunConfiguration interface
71 virtual bool isConfigured () const override;70 virtual bool isConfigured () const override;
72 virtual ConfigurationState ensureConfigured(QString *) override;71 virtual ConfigurationState ensureConfigured(QString *) override;
72 virtual ProjectExplorer::Runnable runnable() const override;
7373
74 //static helpers74 //static helpers
75 static QString getDesktopFile (RunConfiguration *config, QString appId, QString *errorMessage = 0);75 static QString getDesktopFile (RunConfiguration *config, QString appId, QString *errorMessage = 0);
7676
=== modified file 'src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp'
--- src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp 2016-04-06 10:52:54 +0000
+++ src/ubuntu/device/container/ubuntulocalrunconfigurationfactory.cpp 2016-08-24 15:35:12 +0000
@@ -67,7 +67,7 @@
67 if (isRemote) {67 if (isRemote) {
68 //IF we have a remote device we just support a ubuntu toolchain68 //IF we have a remote device we just support a ubuntu toolchain
69 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(parent->kit());69 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(parent->kit());
70 if(tc && tc->type() != QLatin1String(Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID))70 if(tc && tc->typeId() != Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
71 return types;71 return types;
72 }72 }
7373
7474
=== modified file 'src/ubuntu/device/container/ubuntulocalruncontrolfactory.cpp'
--- src/ubuntu/device/container/ubuntulocalruncontrolfactory.cpp 2016-05-23 07:26:49 +0000
+++ src/ubuntu/device/container/ubuntulocalruncontrolfactory.cpp 2016-08-24 15:35:12 +0000
@@ -6,14 +6,16 @@
66
7#include "containerdevice.h"7#include "containerdevice.h"
88
9#include <analyzerbase/analyzerstartparameters.h>9#include <debugger/analyzer/analyzermanager.h>
10#include <analyzerbase/analyzerruncontrol.h>10#include <debugger/analyzer/analyzerruncontrol.h>
11#include <analyzerbase/analyzermanager.h>11#include <debugger/analyzer/analyzerstartparameters.h>
12#include <projectexplorer/kitinformation.h>12#include <projectexplorer/kitinformation.h>
13#include <projectexplorer/target.h>13#include <projectexplorer/target.h>
14#include <projectexplorer/abi.h>14#include <projectexplorer/abi.h>
15#include <debugger/debuggerruncontrol.h>15#include <debugger/debuggerruncontrol.h>
16#include <debugger/debuggerstartparameters.h>16#include <debugger/debuggerstartparameters.h>
17#include <debugger/debuggerrunconfigurationaspect.h>
18#include <qmldebug/qmldebugcommandlinearguments.h>
17#include <utils/fileutils.h>19#include <utils/fileutils.h>
18#include <utils/portlist.h>20#include <utils/portlist.h>
19#include <qmlprofiler/localqmlprofilerrunner.h>21#include <qmlprofiler/localqmlprofilerrunner.h>
@@ -36,10 +38,7 @@
36 if (mode != ProjectExplorer::Constants::NORMAL_RUN_MODE38 if (mode != ProjectExplorer::Constants::NORMAL_RUN_MODE
37 && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE39 && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE
38 && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN40 && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE_WITH_BREAK_ON_MAIN
39 && mode != ProjectExplorer::Constants::QML_PROFILER_RUN_MODE41 && mode != ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
40 && mode != Valgrind::Internal::CALLGRIND_RUN_MODE
41 && mode != Valgrind::MEMCHECK_RUN_MODE
42 && mode != Valgrind::MEMCHECK_WITH_GDB_RUN_MODE) {
43 return false;42 return false;
44 }43 }
4544
@@ -54,7 +53,13 @@
54 if (!ubuntuRC)53 if (!ubuntuRC)
55 return 0;54 return 0;
5655
56 if (!ubuntuRC->aboutToStart(errorMessage))
57 return 0;
58
57 QTC_ASSERT(canRun(runConfiguration, mode), return 0);59 QTC_ASSERT(canRun(runConfiguration, mode), return 0);
60 const auto rcRunnable = runConfiguration->runnable();
61 QTC_ASSERT(rcRunnable.is<ProjectExplorer::StandardRunnable>(), return 0);
62 const auto stdRunnable = rcRunnable.as<ProjectExplorer::StandardRunnable>();
5863
59 ProjectExplorer::IDevice::ConstPtr genericDev = ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit());64 ProjectExplorer::IDevice::ConstPtr genericDev = ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit());
60 if (!genericDev || !genericDev->type().toString().startsWith(QLatin1String(Constants::UBUNTU_CONTAINER_DEVICE_TYPE_ID))) {65 if (!genericDev || !genericDev->type().toString().startsWith(QLatin1String(Constants::UBUNTU_CONTAINER_DEVICE_TYPE_ID))) {
@@ -64,7 +69,7 @@
64 }69 }
6570
66 ProjectExplorer::ToolChain *genericToolchain = ProjectExplorer::ToolChainKitInformation::toolChain(runConfiguration->target()->kit());71 ProjectExplorer::ToolChain *genericToolchain = ProjectExplorer::ToolChainKitInformation::toolChain(runConfiguration->target()->kit());
67 if (!genericToolchain || genericToolchain->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {72 if (!genericToolchain || genericToolchain->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
68 if(!errorMessage)73 if(!errorMessage)
69 *errorMessage = tr("Wrong toolchain type in runconfiguration.");74 *errorMessage = tr("Wrong toolchain type in runconfiguration.");
70 return 0;75 return 0;
@@ -73,9 +78,6 @@
73 ContainerDevice::ConstPtr dev = qSharedPointerCast<const ContainerDevice>(genericDev);78 ContainerDevice::ConstPtr dev = qSharedPointerCast<const ContainerDevice>(genericDev);
74 ClickToolChain *tc = static_cast<ClickToolChain *>(genericToolchain);79 ClickToolChain *tc = static_cast<ClickToolChain *>(genericToolchain);
7580
76 if (!ubuntuRC->aboutToStart(errorMessage))
77 return 0;
78
79 if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) {81 if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) {
80 RemoteLinux::RemoteLinuxRunControl *runControl = new RemoteLinux::RemoteLinuxRunControl(ubuntuRC);82 RemoteLinux::RemoteLinuxRunControl *runControl = new RemoteLinux::RemoteLinuxRunControl(ubuntuRC);
81 return runControl;83 return runControl;
@@ -89,8 +91,8 @@
8991
90 if (isScope) {92 if (isScope) {
91 Debugger::DebuggerStartParameters params;93 Debugger::DebuggerStartParameters params;
92 // Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)94
93 params.workingDirectory = Utils::FileUtils::normalizePathName(ubuntuRC->workingDirectory());95 params.inferior = stdRunnable;
9496
95 QString triplet = tc->gnutriplet();97 QString triplet = tc->gnutriplet();
96 if (triplet.isEmpty()) {98 if (triplet.isEmpty()) {
@@ -101,12 +103,11 @@
101103
102 QString scoperunnerPth = QString::fromLatin1("/usr/lib/%1/unity-scopes/scoperunner")104 QString scoperunnerPth = QString::fromLatin1("/usr/lib/%1/unity-scopes/scoperunner")
103 .arg(triplet);105 .arg(triplet);
104 params.executable = QString(UbuntuClickTool::targetBasePath(tc->clickTarget())+scoperunnerPth);106 params.symbolFile = QString(UbuntuClickTool::targetBasePath(tc->clickTarget())+scoperunnerPth);
105 params.continueAfterAttach = true;107 params.continueAfterAttach = true;
106 params.startMode = Debugger::AttachToRemoteServer;108 params.startMode = Debugger::AttachToRemoteServer;
107 params.remoteSetupNeeded = true;109 params.remoteSetupNeeded = true;
108 params.connParams.host = dev->sshParameters().host;110 params.connParams.host = dev->sshParameters().host;
109 params.environment = ubuntuRC->environment();
110 params.solibSearchPath.append(ubuntuRC->soLibSearchPaths());111 params.solibSearchPath.append(ubuntuRC->soLibSearchPaths());
111112
112 Debugger::DebuggerRunControl *runControl113 Debugger::DebuggerRunControl *runControl
@@ -117,28 +118,59 @@
117118
118 return runControl;119 return runControl;
119 } else {120 } else {
120 if (ubuntuRC->portsUsedByDebuggers() > dev->freePorts().count()) {121 auto aspect = ubuntuRC->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
122 if (aspect->portsUsedByDebugger() > dev->freePorts().count()) {
121 *errorMessage = tr("Cannot debug: Not enough free ports available.");123 *errorMessage = tr("Cannot debug: Not enough free ports available.");
122 return 0;124 return 0;
123 }125 }
124126
125 Debugger::DebuggerStartParameters params = RemoteLinux::LinuxDeviceDebugSupport::startParameters(ubuntuRC);127 /*
128 * Taken from remotelinuxruncontrolfactory.cpp and adapted
129 * to work here.
130 */
131 Debugger::DebuggerStartParameters params;
132 params.startMode = Debugger::AttachToRemoteServer;
133 params.closeMode = Debugger::KillAndExitMonitorAtClose;
134 params.remoteSetupNeeded = true;
135
136 if (aspect->useQmlDebugger()) {
137 params.qmlServer.host = dev->sshParameters().host;
138 params.qmlServer.port = Utils::Port(); // port is selected later on
139 }
140 if (aspect->useCppDebugger()) {
141 aspect->setUseMultiProcess(true);
142 params.inferior.executable = stdRunnable.executable;
143 params.inferior.commandLineArguments = stdRunnable.commandLineArguments;
144 if (aspect->useQmlDebugger()) {
145 params.inferior.commandLineArguments.prepend(QLatin1Char(' '));
146 params.inferior.commandLineArguments.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices));
147 }
148 params.remoteChannel = dev->sshParameters().host + QLatin1String(":-1");
149 params.symbolFile = ubuntuRC->localExecutableFilePath();
150 }
151
126 params.solibSearchPath.append(ubuntuRC->soLibSearchPaths());152 params.solibSearchPath.append(ubuntuRC->soLibSearchPaths());
127153
128 Debugger::DebuggerRunControl * const runControl = Debugger::createDebuggerRunControl(params, ubuntuRC, errorMessage, mode);154 Debugger::DebuggerRunControl * const runControl = Debugger::createDebuggerRunControl(params, ubuntuRC, errorMessage, mode);
129 if (!runControl)155 if (!runControl)
130 return 0;156 return 0;
131157
132 RemoteLinux::LinuxDeviceDebugSupport * const debugSupport =158 (void) new RemoteLinux::LinuxDeviceDebugSupport(ubuntuRC, runControl);
133 new RemoteLinux::LinuxDeviceDebugSupport(ubuntuRC, runControl);
134 connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished()));
135 return runControl;159 return runControl;
136 }160 }
137 return 0;161 return 0;
138 }162 }
139 else if(mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {163 else if(mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE) {
140 Analyzer::AnalyzerStartParameters params = RemoteLinux::RemoteLinuxAnalyzeSupport::startParameters(ubuntuRC, mode);164 /*
141 Analyzer::AnalyzerRunControl *runControl = Analyzer::AnalyzerManager::createRunControl(params, ubuntuRC);165 * Taken from remotelinuxruncontrolfactory.cpp and adapted
166 * to work here.
167 */
168 auto runControl = Debugger::createAnalyzerRunControl(ubuntuRC, mode);
169 Debugger::AnalyzerConnection connection;
170 connection.connParams =
171 ProjectExplorer::DeviceKitInformation::device(ubuntuRC->target()->kit())->sshParameters();
172 connection.analyzerHost = connection.connParams.host;
173 runControl->setConnection(connection);
142 (void) new RemoteLinux::RemoteLinuxAnalyzeSupport(ubuntuRC, runControl, mode);174 (void) new RemoteLinux::RemoteLinuxAnalyzeSupport(ubuntuRC, runControl, mode);
143 return runControl;175 return runControl;
144 }176 }
145177
=== modified file 'src/ubuntu/device/container/ubuntulocalscopedebugsupport.cpp'
--- src/ubuntu/device/container/ubuntulocalscopedebugsupport.cpp 2016-05-23 07:26:49 +0000
+++ src/ubuntu/device/container/ubuntulocalscopedebugsupport.cpp 2016-08-24 15:35:12 +0000
@@ -38,7 +38,7 @@
3838
39void UbuntuLocalScopeDebugSupport::startExecution()39void UbuntuLocalScopeDebugSupport::startExecution()
40{40{
41 QTC_ASSERT(state() == GatheringPorts, return);41 QTC_ASSERT(state() == GatheringResources, return);
4242
43 setState(StartingRunner);43 setState(StartingRunner);
44 m_gdbserverOutput.clear();44 m_gdbserverOutput.clear();
@@ -47,7 +47,8 @@
47 // as it will stick even for the next non debug run, and even though47 // as it will stick even for the next non debug run, and even though
48 // we can then start without gdbserver the timouts will be always set48 // we can then start without gdbserver the timouts will be always set
49 // high, because the DebugMode=true setting is still there49 // high, because the DebugMode=true setting is still there
50 if(!setPort(m_port)) {50 m_port = findPort();
51 if(!m_port.isValid()) {
51 Debugger::RemoteSetupResult res;52 Debugger::RemoteSetupResult res;
52 res.success = false;53 res.success = false;
53 res.reason = tr("Could not assign a free port for debugging.");54 res.reason = tr("Could not assign a free port for debugging.");
@@ -118,7 +119,7 @@
118 }119 }
119120
120 args.append(QStringLiteral("--cppdebug"));121 args.append(QStringLiteral("--cppdebug"));
121 args.append(QString::number(m_port));122 args.append(QString::number(m_port.number()));
122123
123124
124 setState(StartingRunner);125 setState(StartingRunner);
@@ -138,9 +139,7 @@
138 connect(m_runControl, &Debugger::DebuggerRunControl::stateChanged,139 connect(m_runControl, &Debugger::DebuggerRunControl::stateChanged,
139 this, &UbuntuLocalScopeDebugSupport::handleStateChanged);140 this, &UbuntuLocalScopeDebugSupport::handleStateChanged);
140141
141 runner->setEnvironment(environment());142 runner->start(device(), runnable());
142 runner->setWorkingDirectory(workingDirectory());
143 runner->start(device(), m_executable, args);
144}143}
145144
146void UbuntuLocalScopeDebugSupport::handleRemoteSetupRequested()145void UbuntuLocalScopeDebugSupport::handleRemoteSetupRequested()
@@ -148,7 +147,7 @@
148 QTC_ASSERT(state() == Inactive, return);147 QTC_ASSERT(state() == Inactive, return);
149148
150 showMessage(tr("Checking available ports...") + QLatin1Char('\n'), Debugger::LogStatus);149 showMessage(tr("Checking available ports...") + QLatin1Char('\n'), Debugger::LogStatus);
151 AbstractRemoteLinuxRunSupport::handleRemoteSetupRequested();150 startPortsGathering();
152}151}
153152
154void UbuntuLocalScopeDebugSupport::handleAppRunnerError(const QString &error)153void UbuntuLocalScopeDebugSupport::handleAppRunnerError(const QString &error)
@@ -171,7 +170,7 @@
171170
172void UbuntuLocalScopeDebugSupport::handleRemoteErrorOutput(const QByteArray &output)171void UbuntuLocalScopeDebugSupport::handleRemoteErrorOutput(const QByteArray &output)
173{172{
174 QTC_ASSERT(state() != GatheringPorts, return);173 QTC_ASSERT(state() != GatheringResources, return);
175174
176 if (!m_runControl)175 if (!m_runControl)
177 return;176 return;
178177
=== modified file 'src/ubuntu/device/container/ubuntulocalscopedebugsupport.h'
--- src/ubuntu/device/container/ubuntulocalscopedebugsupport.h 2016-05-23 07:26:49 +0000
+++ src/ubuntu/device/container/ubuntulocalscopedebugsupport.h 2016-08-24 15:35:12 +0000
@@ -42,7 +42,7 @@
42 void showMessage(const QString &msg, int channel);42 void showMessage(const QString &msg, int channel);
4343
44private:44private:
45 int m_port;45 Utils::Port m_port;
46 QString m_scopeRunnerPath;46 QString m_scopeRunnerPath;
47 QString m_executable;47 QString m_executable;
48 QString m_buildDir;48 QString m_buildDir;
4949
=== modified file 'src/ubuntu/device/remote/abstractremoterunsupport.cpp'
--- src/ubuntu/device/remote/abstractremoterunsupport.cpp 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/abstractremoterunsupport.cpp 2016-08-24 15:35:12 +0000
@@ -84,14 +84,15 @@
84 return &d->runner;84 return &d->runner;
85}85}
8686
87bool AbstractRemoteRunSupport::assignNextFreePort(int *port)87Utils::Port AbstractRemoteRunSupport::findFreePort( )
88{88{
89 *port = d->portScanner.getNextFreePort(&d->freePorts);89 Utils::Port thePort = d->portScanner.getNextFreePort(&d->freePorts);
90 if (*port == -1) {90 if (!thePort.isValid()){
91 handleAdapterSetupFailed(tr("Not enough free ports on device for debugging."));91 handleAdapterSetupFailed(tr("Not enough free ports on device for debugging."));
92 return false;92 return Utils::Port();
93 }93 }
94 return true;94
95 return thePort;
95}96}
9697
97void AbstractRemoteRunSupport::setFinished()98void AbstractRemoteRunSupport::setFinished()
9899
=== modified file 'src/ubuntu/device/remote/abstractremoterunsupport.h'
--- src/ubuntu/device/remote/abstractremoterunsupport.h 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/abstractremoterunsupport.h 2016-08-24 15:35:12 +0000
@@ -34,7 +34,7 @@
34 virtual void handleAdapterSetupFailed(const QString &error);34 virtual void handleAdapterSetupFailed(const QString &error);
35 virtual void handleAdapterSetupDone();35 virtual void handleAdapterSetupDone();
3636
37 bool assignNextFreePort(int *port);37 Utils::Port findFreePort();
38 void setFinished ();38 void setFinished ();
39 void reset();39 void reset();
4040
4141
=== modified file 'src/ubuntu/device/remote/ubuntudeploystepfactory.cpp'
--- src/ubuntu/device/remote/ubuntudeploystepfactory.cpp 2016-03-29 10:39:39 +0000
+++ src/ubuntu/device/remote/ubuntudeploystepfactory.cpp 2016-08-24 15:35:12 +0000
@@ -6,6 +6,7 @@
6#include <ubuntu/ubuntupackagestep.h>6#include <ubuntu/ubuntupackagestep.h>
77
8#include <utils/qtcassert.h>8#include <utils/qtcassert.h>
9#include <utils/algorithm.h>
910
10#include <projectexplorer/buildstep.h>11#include <projectexplorer/buildstep.h>
11#include <projectexplorer/buildsteplist.h>12#include <projectexplorer/buildsteplist.h>
@@ -23,9 +24,9 @@
23namespace Ubuntu {24namespace Ubuntu {
24namespace Internal {25namespace Internal {
2526
26QList<Core::Id> UbuntuDeployStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const27QList<ProjectExplorer::BuildStepInfo> UbuntuDeployStepFactory::availableSteps(ProjectExplorer::BuildStepList *parent) const
27{28{
28 QList<Core::Id> types;29 QList<ProjectExplorer::BuildStepInfo> types;
2930
30 if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)31 if (parent->id() != ProjectExplorer::Constants::BUILDSTEPS_DEPLOY)
31 return types;32 return types;
@@ -43,34 +44,37 @@
43 if (isRemote) {44 if (isRemote) {
44 //IF we have a remote device we just support a ubuntu toolchain45 //IF we have a remote device we just support a ubuntu toolchain
45 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(parent->target()->kit());46 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(parent->target()->kit());
46 if(tc && tc->type() != QLatin1String(Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID))47 if(tc && tc->typeId() != Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
47 return types;48 return types;
48 }49 }
4950
50 if(isRemote && ( isHTML || isQML || isCMake || isQMake ) )51 if(isRemote && ( isHTML || isQML || isCMake || isQMake ) ) {
51 types << Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID52
52 << Constants::UBUNTU_CLICK_PACKAGESTEP_ID;53 types << ProjectExplorer::BuildStepInfo (Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID,
54 UbuntuDirectUploadStep::displayName(),
55 ProjectExplorer::BuildStepInfo::UniqueStep)
56 << ProjectExplorer::BuildStepInfo (Constants::UBUNTU_CLICK_PACKAGESTEP_ID,
57 tr("UbuntuSDK create click package", "Display name for UbuntuPackageStep id."),
58 ProjectExplorer::BuildStepInfo::UniqueStep)
59 //backwards compatibility to older projects
60 << ProjectExplorer::BuildStepInfo (Constants::UBUNTU_DEPLOY_MAKESTEP_ID,
61 tr("UbuntuSDK create click package", "Display name for UbuntuPackageStep id."),
62 ProjectExplorer::BuildStepInfo::Flags(ProjectExplorer::BuildStepInfo::UniqueStep
63 | ProjectExplorer::BuildStepInfo::Uncreatable
64 | ProjectExplorer::BuildStepInfo::Unclonable));
65 }
5366
54 return types;67 return types;
55}68}
5669
57QString UbuntuDeployStepFactory::displayNameForId(const Core::Id id) const70bool UbuntuDeployStepFactory::canHandle(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
58{71{
59 if (id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)72 return Utils::contains(availableSteps(parent), Utils::equal(&ProjectExplorer::BuildStepInfo::id, id));
60 return UbuntuDirectUploadStep::displayName();
61 else if (id == Constants::UBUNTU_CLICK_PACKAGESTEP_ID)
62 return tr("UbuntuSDK create click package", "Display name for UbuntuPackageStep id.");
63 return QString();
64}
65
66bool UbuntuDeployStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
67{
68 return availableCreationIds(parent).contains(id);
69}73}
7074
71ProjectExplorer::BuildStep *UbuntuDeployStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)75ProjectExplorer::BuildStep *UbuntuDeployStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
72{76{
73 if (!canCreate(parent, id))77 if (!canHandle(parent, id))
74 return 0;78 return 0;
7579
76 if(id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)80 if(id == Constants::UBUNTU_DEPLOY_UPLOADSTEP_ID)
@@ -83,24 +87,12 @@
83 return 0;87 return 0;
84}88}
8589
86bool UbuntuDeployStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
87{
88 Core::Id toRestore = ProjectExplorer::idFromMap(map);
89
90 //backwards compatibility to older projects
91 if( toRestore == Constants::UBUNTU_DEPLOY_MAKESTEP_ID )
92 return canCreate(parent,Core::Id(Constants::UBUNTU_CLICK_PACKAGESTEP_ID));
93
94 return canCreate(parent,toRestore);
95}
96
97ProjectExplorer::BuildStep *UbuntuDeployStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)90ProjectExplorer::BuildStep *UbuntuDeployStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
98{91{
99 Core::Id id = ProjectExplorer::idFromMap(map);92 Core::Id id = ProjectExplorer::idFromMap(map);
100 if(!canCreate(parent,id))93 if(!canHandle(parent,id))
101 return 0;94 return 0;
10295
103 //backwards compatibility to older projects
104 if( id == Constants::UBUNTU_DEPLOY_MAKESTEP_ID ) {96 if( id == Constants::UBUNTU_DEPLOY_MAKESTEP_ID ) {
105 UbuntuPackageStep *step = new UbuntuPackageStep(parent);97 UbuntuPackageStep *step = new UbuntuPackageStep(parent);
106 return step;98 return step;
@@ -115,14 +107,9 @@
115 return step;107 return step;
116}108}
117109
118bool UbuntuDeployStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
119{
120 return canCreate(parent,product->id());
121}
122
123ProjectExplorer::BuildStep *UbuntuDeployStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)110ProjectExplorer::BuildStep *UbuntuDeployStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
124{111{
125 if (!canClone(parent, product))112 if (!canHandle(parent, product->id()))
126 return 0;113 return 0;
127114
128 const Core::Id id = product->id();115 const Core::Id id = product->id();
129116
=== modified file 'src/ubuntu/device/remote/ubuntudeploystepfactory.h'
--- src/ubuntu/device/remote/ubuntudeploystepfactory.h 2016-03-29 10:39:39 +0000
+++ src/ubuntu/device/remote/ubuntudeploystepfactory.h 2016-08-24 15:35:12 +0000
@@ -13,14 +13,13 @@
1313
14public:14public:
15 // IBuildStepFactory interface15 // IBuildStepFactory interface
16 virtual QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const override;16 virtual QList<ProjectExplorer::BuildStepInfo> availableSteps(ProjectExplorer::BuildStepList *parent) const override;
17 virtual QString displayNameForId(const Core::Id id) const override;
18 virtual bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const override;
19 virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) override;17 virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) override;
20 virtual bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const override;
21 virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override;18 virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override;
22 virtual bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const override;
23 virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) override;19 virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) override;
20
21private:
22 bool canHandle(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
24};23};
2524
26} // namespace Internal25} // namespace Internal
2726
=== modified file 'src/ubuntu/device/remote/ubuntudevice.cpp'
--- src/ubuntu/device/remote/ubuntudevice.cpp 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubuntudevice.cpp 2016-08-24 15:35:12 +0000
@@ -28,6 +28,7 @@
28#include <ubuntu/settings.h>28#include <ubuntu/settings.h>
2929
30#include <projectexplorer/devicesupport/devicemanager.h>30#include <projectexplorer/devicesupport/devicemanager.h>
31#include <projectexplorer/runnables.h>
31#include <remotelinux/genericlinuxdeviceconfigurationwidget.h>32#include <remotelinux/genericlinuxdeviceconfigurationwidget.h>
32#include <coreplugin/messagemanager.h>33#include <coreplugin/messagemanager.h>
33#include <ssh/sshconnection.h>34#include <ssh/sshconnection.h>
@@ -744,14 +745,14 @@
744745
745 //first port is SSH port746 //first port is SSH port
746 QSsh::SshConnectionParameters connParms = m_dev->sshParameters();747 QSsh::SshConnectionParameters connParms = m_dev->sshParameters();
747 connParms.port = copy.getNext();748 connParms.port = copy.getNext().number();
748 m_dev->setSshParameters(connParms);749 m_dev->setSshParameters(connParms);
749750
750 m_dev->setFreePorts(copy);751 m_dev->setFreePorts(copy);
751752
752 QStringList ports;753 QStringList ports;
753 while(copy.hasMore())754 while(copy.hasMore())
754 ports.append(QString::number(copy.getNext()));755 ports.append(QString::number(copy.getNext().number()));
755756
756 //@TODO per device settings757 //@TODO per device settings
757 QString deviceSshPort = QString::number(connParms.port);758 QString deviceSshPort = QString::number(connParms.port);
@@ -1349,17 +1350,12 @@
1349{1350{
1350}1351}
13511352
1352void UbuntuDeviceProcess::setWorkingDirectory(const QString &directory)
1353{
1354 m_workingDir = directory;
1355}
1356
1357void UbuntuDeviceProcess::terminate()1353void UbuntuDeviceProcess::terminate()
1358{1354{
1359 LinuxDeviceProcess::terminate();1355 LinuxDeviceProcess::terminate();
1360}1356}
13611357
1362QString UbuntuDeviceProcess::fullCommandLine() const1358QString UbuntuDeviceProcess::fullCommandLine(const ProjectExplorer::StandardRunnable &runnable) const
1363{1359{
1364 //return QStringLiteral("%1 %2").arg(quote(executable()),Utils::QtcProcess::joinArgsUnix(arguments()));1360 //return QStringLiteral("%1 %2").arg(quote(executable()),Utils::QtcProcess::joinArgsUnix(arguments()));
13651361
@@ -1371,15 +1367,15 @@
1371 QString fullCommandLine;1367 QString fullCommandLine;
1372 foreach (const QString &filePath, rcFiles)1368 foreach (const QString &filePath, rcFiles)
1373 fullCommandLine += QString::fromLatin1("test -f %1 && . %1;").arg(filePath);1369 fullCommandLine += QString::fromLatin1("test -f %1 && . %1;").arg(filePath);
1374 if (!m_workingDir.isEmpty()) {1370 if (!runnable.workingDirectory.isEmpty()) {
1375 fullCommandLine.append(QLatin1String("cd ")).append(quote(m_workingDir))1371 fullCommandLine.append(QLatin1String("cd ")).append(quote(runnable.workingDirectory))
1376 .append(QLatin1String(" && "));1372 .append(QLatin1String(" && "));
1377 }1373 }
13781374
1379 fullCommandLine.append(quote(executable()));1375 fullCommandLine.append(quote(runnable.executable));
1380 if (!arguments().isEmpty()) {1376 if (!runnable.commandLineArguments.isEmpty()) {
1381 fullCommandLine.append(QLatin1Char(' '));1377 fullCommandLine.append(QLatin1Char(' '));
1382 fullCommandLine.append(Utils::QtcProcess::joinArgs(arguments(),Utils::OsTypeLinux));1378 fullCommandLine.append(runnable.commandLineArguments);
1383 }1379 }
13841380
1385 if(debug) qDebug()<<fullCommandLine;1381 if(debug) qDebug()<<fullCommandLine;
13861382
=== modified file 'src/ubuntu/device/remote/ubuntudevice.h'
--- src/ubuntu/device/remote/ubuntudevice.h 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubuntudevice.h 2016-08-24 15:35:12 +0000
@@ -246,16 +246,13 @@
246 explicit UbuntuDeviceProcess(const QSharedPointer<const ProjectExplorer::IDevice> &device,246 explicit UbuntuDeviceProcess(const QSharedPointer<const ProjectExplorer::IDevice> &device,
247 QObject *parent = 0);247 QObject *parent = 0);
248248
249 void setWorkingDirectory(const QString &directory) override;
250
251 // DeviceProcess interface249 // DeviceProcess interface
252public:250public:
253 virtual void terminate() override;251 virtual void terminate() override;
254252
255private:253private:
256 // SshDeviceProcess interface254 // SshDeviceProcess interface
257 virtual QString fullCommandLine() const override;255 virtual QString fullCommandLine(const ProjectExplorer::StandardRunnable &runnable) const override;
258 QString m_workingDir;
259};256};
260257
261} // namespace Internal258} // namespace Internal
262259
=== modified file 'src/ubuntu/device/remote/ubuntudevicesignaloperation.cpp'
--- src/ubuntu/device/remote/ubuntudevicesignaloperation.cpp 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubuntudevicesignaloperation.cpp 2016-08-24 15:35:12 +0000
@@ -10,7 +10,7 @@
1010
11}11}
1212
13void UbuntuDeviceSignalOperation::killProcess(int pid)13void UbuntuDeviceSignalOperation::killProcess(qint64 pid)
14{14{
15 sendSignal(pid,9);15 sendSignal(pid,9);
16}16}
@@ -21,7 +21,7 @@
21 emit finished(tr("Sending signals to processes by filePath is not supported on Ubuntu Devices"));21 emit finished(tr("Sending signals to processes by filePath is not supported on Ubuntu Devices"));
22}22}
2323
24void UbuntuDeviceSignalOperation::interruptProcess(int pid)24void UbuntuDeviceSignalOperation::interruptProcess(qint64 pid)
25{25{
26 sendSignal(pid,2);26 sendSignal(pid,2);
27}27}
@@ -32,7 +32,7 @@
32 emit finished(tr("Sending signals to processes by filePath is not supported on Ubuntu Devices"));32 emit finished(tr("Sending signals to processes by filePath is not supported on Ubuntu Devices"));
33}33}
3434
35void UbuntuDeviceSignalOperation::sendSignal(int pid, int signal)35void UbuntuDeviceSignalOperation::sendSignal(qint64 pid, int signal)
36{36{
37 QProcess *proc = new QProcess(this);37 QProcess *proc = new QProcess(this);
3838
3939
=== modified file 'src/ubuntu/device/remote/ubuntudevicesignaloperation.h'
--- src/ubuntu/device/remote/ubuntudevicesignaloperation.h 2016-07-22 10:17:50 +0000
+++ src/ubuntu/device/remote/ubuntudevicesignaloperation.h 2016-08-24 15:35:12 +0000
@@ -17,13 +17,13 @@
17 typedef QSharedPointer<UbuntuDeviceSignalOperation> Ptr;17 typedef QSharedPointer<UbuntuDeviceSignalOperation> Ptr;
1818
19 // DeviceProcessSignalOperation interface19 // DeviceProcessSignalOperation interface
20 virtual void killProcess(int pid) override;20 virtual void killProcess(qint64 pid) override;
21 virtual void killProcess(const QString &filePath) override;21 virtual void killProcess(const QString &filePath) override;
22 virtual void interruptProcess(int pid) override;22 virtual void interruptProcess(qint64 pid) override;
23 virtual void interruptProcess(const QString &filePath) override;23 virtual void interruptProcess(const QString &filePath) override;
2424
25private:25private:
26 void sendSignal (int pid, int signal);26 void sendSignal (qint64 pid, int signal);
2727
28private slots:28private slots:
29 void processFinished (int exitCode, QProcess::ExitStatus exitState);29 void processFinished (int exitCode, QProcess::ExitStatus exitState);
3030
=== modified file 'src/ubuntu/device/remote/ubuntudirectuploadstep.cpp'
--- src/ubuntu/device/remote/ubuntudirectuploadstep.cpp 2016-03-29 10:39:39 +0000
+++ src/ubuntu/device/remote/ubuntudirectuploadstep.cpp 2016-08-24 15:35:12 +0000
@@ -65,12 +65,13 @@
6565
66void UbuntuDirectUploadStep::run(QFutureInterface<bool> &fi)66void UbuntuDirectUploadStep::run(QFutureInterface<bool> &fi)
67{67{
68 m_future = &fi;
69
68 m_foundClickPackage = false;70 m_foundClickPackage = false;
69 projectNameChanged();71 projectNameChanged();
70 if(!m_foundClickPackage) {72 if(!m_foundClickPackage) {
71 emit addOutput(tr("Deploy step failed. No click package was created"), ErrorMessageOutput);73 doFail(tr("Deploy step failed. No click package was created"));
72 fi.reportResult(false);74 m_future = 0;
73 emit finished();
74 return;75 return;
75 }76 }
7677
@@ -80,13 +81,11 @@
8081
81 UbuntuDevice::ConstPtr dev = deviceFromTarget(target());82 UbuntuDevice::ConstPtr dev = deviceFromTarget(target());
82 if(!dev) {83 if(!dev) {
83 emit addOutput(tr("Deploy step failed. No valid device configured"), ErrorMessageOutput);84 doFail(tr("Deploy step failed. No valid device configured"));
84 fi.reportResult(false);85 m_future = 0;
85 emit finished();
86 return;86 return;
87 }87 }
8888
89 m_future = &fi;
90 if(dev->deviceState() != ProjectExplorer::IDevice::DeviceReadyToUse) {89 if(dev->deviceState() != ProjectExplorer::IDevice::DeviceReadyToUse) {
91 //we are already waiting90 //we are already waiting
92 if (m_waitDialog)91 if (m_waitDialog)
@@ -109,10 +108,8 @@
109{108{
110 m_waitDialog->deleteLater();109 m_waitDialog->deleteLater();
111110
112 emit addOutput(tr("Deploy step failed"), ErrorMessageOutput);111 doFail(tr("Deploy step failed"));
113 m_future->reportResult(false);
114 m_future = 0;112 m_future = 0;
115 emit finished();
116}113}
117114
118void UbuntuDirectUploadStep::handleDeviceReady()115void UbuntuDirectUploadStep::handleDeviceReady()
@@ -121,10 +118,8 @@
121118
122 QString whyNot;119 QString whyNot;
123 if(!deployService()->isDeploymentPossible(&whyNot)) {120 if(!deployService()->isDeploymentPossible(&whyNot)) {
124 emit addOutput(tr("Deploy step failed. %1").arg(whyNot), ErrorMessageOutput);121 doFail(tr("Deploy step failed. %1").arg(whyNot));
125 m_future->reportResult(false);
126 m_future = 0;122 m_future = 0;
127 emit finished();
128 return;123 return;
129 }124 }
130125
@@ -132,6 +127,14 @@
132 m_future = 0;127 m_future = 0;
133}128}
134129
130void UbuntuDirectUploadStep::doFail(const QString &err)
131{
132 emit addOutput(err, ErrorMessageOutput);
133 disconnect(deployService(), 0, this, 0);
134 if (m_future)
135 reportRunResult(*m_future, false);
136}
137
135ProjectExplorer::BuildStepConfigWidget *UbuntuDirectUploadStep::createConfigWidget()138ProjectExplorer::BuildStepConfigWidget *UbuntuDirectUploadStep::createConfigWidget()
136{139{
137 return new ProjectExplorer::SimpleBuildStepConfigWidget(this);140 return new ProjectExplorer::SimpleBuildStepConfigWidget(this);
138141
=== modified file 'src/ubuntu/device/remote/ubuntudirectuploadstep.h'
--- src/ubuntu/device/remote/ubuntudirectuploadstep.h 2016-07-22 10:17:50 +0000
+++ src/ubuntu/device/remote/ubuntudirectuploadstep.h 2016-08-24 15:35:12 +0000
@@ -39,6 +39,9 @@
39 void handleDeviceReady ();39 void handleDeviceReady ();
4040
41private:41private:
42 void doFail (const QString &err);
43
44private:
42 RemoteLinux::GenericDirectUploadService *m_deployService;45 RemoteLinux::GenericDirectUploadService *m_deployService;
43 bool m_foundClickPackage;46 bool m_foundClickPackage;
4447
4548
=== modified file 'src/ubuntu/device/remote/ubunturemoteanalyzesupport.cpp'
--- src/ubuntu/device/remote/ubunturemoteanalyzesupport.cpp 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubunturemoteanalyzesupport.cpp 2016-08-24 15:35:12 +0000
@@ -4,7 +4,7 @@
4#include <ubuntu/ubuntuconstants.h>4#include <ubuntu/ubuntuconstants.h>
55
6#include <remotelinux/remotelinuxrunconfiguration.h>6#include <remotelinux/remotelinuxrunconfiguration.h>
7#include <analyzerbase/analyzerruncontrol.h>7#include <debugger/analyzer/analyzerruncontrol.h>
88
9#include <projectexplorer/buildconfiguration.h>9#include <projectexplorer/buildconfiguration.h>
10#include <projectexplorer/project.h>10#include <projectexplorer/project.h>
@@ -14,6 +14,7 @@
14#include <projectexplorer/kitinformation.h>14#include <projectexplorer/kitinformation.h>
1515
16#include <utils/qtcassert.h>16#include <utils/qtcassert.h>
17#include <utils/port.h>
17#include <qmldebug/qmloutputparser.h>18#include <qmldebug/qmloutputparser.h>
1819
19#include <QPointer>20#include <QPointer>
@@ -24,30 +25,31 @@
24class UbuntuRemoteAnalyzeSupportPrivate25class UbuntuRemoteAnalyzeSupportPrivate
25{26{
26public:27public:
27 UbuntuRemoteAnalyzeSupportPrivate(Analyzer::AnalyzerRunControl *rc, Core::Id runMode)28 UbuntuRemoteAnalyzeSupportPrivate(Debugger::AnalyzerRunControl *rc, Core::Id runMode)
28 : runControl(rc),29 : runControl(rc),
29 qmlProfiling(runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE),30 qmlPort(-1),
30 qmlPort(-1)31 qmlProfiling(runMode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE)
31 {32 {
32 }33 }
3334
34 QString clickPackage;35 QString clickPackage;
35 const QPointer<Analyzer::AnalyzerRunControl> runControl;36
37 const QPointer<Debugger::AnalyzerRunControl> runControl;
38 QmlDebug::QmlOutputParser outputParser;
39
40 Utils::Port qmlPort;
36 bool qmlProfiling;41 bool qmlProfiling;
37 int qmlPort;
38
39 QmlDebug::QmlOutputParser outputParser;
40};42};
4143
42UbuntuRemoteAnalyzeSupport::UbuntuRemoteAnalyzeSupport(UbuntuRemoteRunConfiguration *runConfig,44UbuntuRemoteAnalyzeSupport::UbuntuRemoteAnalyzeSupport(UbuntuRemoteRunConfiguration *runConfig,
43 Analyzer::AnalyzerRunControl *engine, Core::Id runMode)45 Debugger::AnalyzerRunControl *engine, Core::Id runMode)
44 : AbstractRemoteRunSupport(runConfig, engine),46 : AbstractRemoteRunSupport(runConfig, engine),
45 d(new UbuntuRemoteAnalyzeSupportPrivate(engine, runMode))47 d(new UbuntuRemoteAnalyzeSupportPrivate(engine, runMode))
46{48{
47 d->clickPackage = runConfig->clickPackage();49 d->clickPackage = runConfig->clickPackage();
48 connect(d->runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)),50 connect(d->runControl, &Debugger::AnalyzerRunControl::starting,
49 SLOT(handleRemoteSetupRequested()));51 this, &UbuntuRemoteAnalyzeSupport::handleRemoteSetupRequested);
50 connect(&d->outputParser, SIGNAL(waitingForConnectionOnPort(quint16)),52 connect(&d->outputParser, SIGNAL(waitingForConnectionOnPort(Utils::Port)),
51 SLOT(remoteIsRunning()));53 SLOT(remoteIsRunning()));
52}54}
5355
@@ -59,7 +61,7 @@
59void UbuntuRemoteAnalyzeSupport::showMessage(const QString &msg, Utils::OutputFormat format)61void UbuntuRemoteAnalyzeSupport::showMessage(const QString &msg, Utils::OutputFormat format)
60{62{
61 if (state() != Idle && d->runControl)63 if (state() != Idle && d->runControl)
62 d->runControl->logApplicationMessage(msg, format);64 d->runControl->appendMessage(msg, format);
63 d->outputParser.processOutput(msg);65 d->outputParser.processOutput(msg);
64}66}
6567
@@ -78,7 +80,8 @@
78 // Currently we support only QML profiling80 // Currently we support only QML profiling
79 QTC_ASSERT(d->qmlProfiling, return);81 QTC_ASSERT(d->qmlProfiling, return);
8082
81 if (!assignNextFreePort(&d->qmlPort))83 d->qmlPort = findFreePort();
84 if (!d->qmlPort.isValid())
82 return;85 return;
8386
84 setState(Starting);87 setState(Starting);
@@ -91,7 +94,7 @@
91 connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString)));94 connect(runner, SIGNAL(reportError(QString)), SLOT(handleAppRunnerError(QString)));
9295
93 runner->setEnv(environment());96 runner->setEnv(environment());
94 runner->setQmlDebugPort(d->qmlPort);97 runner->setQmlDebugPort(d->qmlPort.number());
9598
96 QTC_ASSERT(device()->type().toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)),return);99 QTC_ASSERT(device()->type().toString().startsWith(QLatin1String(Constants::UBUNTU_DEVICE_TYPE_ID)),return);
97 runner->start(qSharedPointerCast<const UbuntuDevice>(device()),clickPackage(),hook());100 runner->start(qSharedPointerCast<const UbuntuDevice>(device()),clickPackage(),hook());
98101
=== modified file 'src/ubuntu/device/remote/ubunturemoteanalyzesupport.h'
--- src/ubuntu/device/remote/ubunturemoteanalyzesupport.h 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubunturemoteanalyzesupport.h 2016-08-24 15:35:12 +0000
@@ -3,7 +3,7 @@
33
4#include <QObject>4#include <QObject>
5#include "abstractremoterunsupport.h"5#include "abstractremoterunsupport.h"
6#include <analyzerbase/analyzerruncontrol.h>6#include <debugger/analyzer/analyzerruncontrol.h>
77
8namespace Ubuntu {8namespace Ubuntu {
9namespace Internal {9namespace Internal {
@@ -16,7 +16,7 @@
16 Q_OBJECT16 Q_OBJECT
17public:17public:
18 UbuntuRemoteAnalyzeSupport(UbuntuRemoteRunConfiguration *runConfig,18 UbuntuRemoteAnalyzeSupport(UbuntuRemoteRunConfiguration *runConfig,
19 Analyzer::AnalyzerRunControl *engine, Core::Id runMode);19 Debugger::AnalyzerRunControl *engine, Core::Id runMode);
20 ~UbuntuRemoteAnalyzeSupport() override;20 ~UbuntuRemoteAnalyzeSupport() override;
2121
22protected:22protected:
2323
=== modified file 'src/ubuntu/device/remote/ubunturemotedebugsupport.cpp'
--- src/ubuntu/device/remote/ubunturemotedebugsupport.cpp 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubunturemotedebugsupport.cpp 2016-08-24 15:35:12 +0000
@@ -70,8 +70,8 @@
70 bool qmlDebugging;70 bool qmlDebugging;
71 bool cppDebugging;71 bool cppDebugging;
72 QByteArray gdbserverOutput;72 QByteArray gdbserverOutput;
73 int gdbServerPort;73 Utils::Port gdbServerPort;
74 int qmlPort;74 Utils::Port qmlPort;
75};75};
7676
77UbuntuRemoteDebugSupport::UbuntuRemoteDebugSupport(UbuntuRemoteRunConfiguration* runConfig,77UbuntuRemoteDebugSupport::UbuntuRemoteDebugSupport(UbuntuRemoteRunConfiguration* runConfig,
@@ -80,6 +80,8 @@
80 d(new UbuntuRemoteDebugSupportPrivate(runConfig, runControl))80 d(new UbuntuRemoteDebugSupportPrivate(runConfig, runControl))
81{81{
82 connect(d->runControl, SIGNAL(requestRemoteSetup()), this, SLOT(handleRemoteSetupRequested()));82 connect(d->runControl, SIGNAL(requestRemoteSetup()), this, SLOT(handleRemoteSetupRequested()));
83 connect(d->runControl,&Debugger::DebuggerRunControl::finished,
84 this, &UbuntuRemoteDebugSupport::handleDebuggingFinished);
83}85}
8486
85UbuntuRemoteDebugSupport::~UbuntuRemoteDebugSupport()87UbuntuRemoteDebugSupport::~UbuntuRemoteDebugSupport()
@@ -105,10 +107,16 @@
105107
106 setState(Starting);108 setState(Starting);
107109
108 if (d->cppDebugging && !assignNextFreePort(&d->gdbServerPort))110 if (d->cppDebugging) {
109 return;111 d->gdbServerPort = findFreePort();
110 if (d->qmlDebugging && !assignNextFreePort(&d->qmlPort))112 if (!d->gdbServerPort.isValid())
111 return;113 return;
114 }
115 if (d->qmlDebugging) {
116 d->qmlPort = findFreePort();
117 if (!d->qmlPort.isValid())
118 return;
119 }
112120
113 d->gdbserverOutput.clear();121 d->gdbserverOutput.clear();
114122
@@ -120,9 +128,9 @@
120 connect(launcher, SIGNAL(clickApplicationStarted(quint16)), SLOT(handleRemoteProcessStarted(quint16)));128 connect(launcher, SIGNAL(clickApplicationStarted(quint16)), SLOT(handleRemoteProcessStarted(quint16)));
121129
122 if(d->cppDebugging)130 if(d->cppDebugging)
123 launcher->setCppDebugPort(d->gdbServerPort);131 launcher->setCppDebugPort(d->gdbServerPort.number());
124 if(d->qmlDebugging)132 if(d->qmlDebugging)
125 launcher->setQmlDebugPort(d->qmlPort);133 launcher->setQmlDebugPort(d->qmlPort.number());
126134
127 launcher->setEnv(environment());135 launcher->setEnv(environment());
128136
@@ -222,7 +230,7 @@
222230
223 Debugger::RemoteSetupResult result;231 Debugger::RemoteSetupResult result;
224 result.success = true;232 result.success = true;
225 result.inferiorPid = d->runControl->startParameters().attachPID;233 //result.inferiorPid = d->runControl->startParameters().attachPID;
226 result.gdbServerPort = d->gdbServerPort;234 result.gdbServerPort = d->gdbServerPort;
227 result.qmlServerPort = d->qmlPort;235 result.qmlServerPort = d->qmlPort;
228 d->runControl->notifyEngineRemoteSetupFinished(result);236 d->runControl->notifyEngineRemoteSetupFinished(result);
229237
=== modified file 'src/ubuntu/device/remote/ubunturemoterunconfiguration.cpp'
--- src/ubuntu/device/remote/ubunturemoterunconfiguration.cpp 2016-04-06 10:52:54 +0000
+++ src/ubuntu/device/remote/ubunturemoterunconfiguration.cpp 2016-08-24 15:35:12 +0000
@@ -31,6 +31,7 @@
31#include <projectexplorer/target.h>31#include <projectexplorer/target.h>
32#include <projectexplorer/project.h>32#include <projectexplorer/project.h>
33#include <projectexplorer/buildsteplist.h>33#include <projectexplorer/buildsteplist.h>
34#include <projectexplorer/runnables.h>
34#include <remotelinux/remotelinuxenvironmentaspect.h>35#include <remotelinux/remotelinuxenvironmentaspect.h>
35#include <utils/qtcprocess.h>36#include <utils/qtcprocess.h>
36#include <cmakeprojectmanager/cmakeproject.h>37#include <cmakeprojectmanager/cmakeproject.h>
@@ -57,7 +58,7 @@
57const char UNINSTALL_KEY[]="UbuntuRemoteRunConfiguration.Uninstall";58const char UNINSTALL_KEY[]="UbuntuRemoteRunConfiguration.Uninstall";
5859
59UbuntuRemoteRunConfiguration::UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, Core::Id id)60UbuntuRemoteRunConfiguration::UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, Core::Id id)
60 : AbstractRemoteLinuxRunConfiguration(parent,id),61 : RunConfiguration(parent,id),
61 m_running(false),62 m_running(false),
62 m_forceInstall(false),63 m_forceInstall(false),
63 m_uninstall(true)64 m_uninstall(true)
@@ -70,7 +71,7 @@
70}71}
7172
72UbuntuRemoteRunConfiguration::UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, UbuntuRemoteRunConfiguration *source)73UbuntuRemoteRunConfiguration::UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, UbuntuRemoteRunConfiguration *source)
73 : AbstractRemoteLinuxRunConfiguration(parent,source),74 : RunConfiguration(parent,source),
74 m_running(false),75 m_running(false),
75 m_forceInstall(false),76 m_forceInstall(false),
76 m_uninstall(true)77 m_uninstall(true)
@@ -176,6 +177,20 @@
176 return ProjectExplorer::RunConfiguration::Configured;177 return ProjectExplorer::RunConfiguration::Configured;
177}178}
178179
180ProjectExplorer::Runnable UbuntuRemoteRunConfiguration::runnable() const
181{
182 if (m_remoteExecutable.isEmpty())
183 return ProjectExplorer::Runnable();
184
185 ProjectExplorer::StandardRunnable r;
186 r.executable = m_remoteExecutable;
187 r.device = ProjectExplorer::DeviceKitInformation::device(target()->kit());
188
189 r.environment = environment();
190
191 return r;
192}
193
179/*!194/*!
180 * \brief UbuntuRemoteRunConfiguration::aboutToStart195 * \brief UbuntuRemoteRunConfiguration::aboutToStart
181 * Configures the internal parameters and fetched the informations from196 * Configures the internal parameters and fetched the informations from
@@ -225,7 +240,7 @@
225 }240 }
226241
227 ProjectExplorer::ToolChain* tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());242 ProjectExplorer::ToolChain* tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
228 if(tc->type() != QString::fromLatin1(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {243 if(tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
229 if(errorMessage)244 if(errorMessage)
230 *errorMessage = tr("Wrong toolchain type. Please check your build configuration.");245 *errorMessage = tr("Wrong toolchain type. Please check your build configuration.");
231 return false;246 return false;
@@ -407,7 +422,7 @@
407{422{
408 if(debug) qDebug()<<Q_FUNC_INFO;423 if(debug) qDebug()<<Q_FUNC_INFO;
409424
410 if(!AbstractRemoteLinuxRunConfiguration::fromMap(map))425 if(!RunConfiguration::fromMap(map))
411 return false;426 return false;
412427
413 m_uninstall = map.value(QLatin1String(UNINSTALL_KEY),true).toBool();428 m_uninstall = map.value(QLatin1String(UNINSTALL_KEY),true).toBool();
@@ -418,7 +433,7 @@
418QVariantMap UbuntuRemoteRunConfiguration::toMap() const433QVariantMap UbuntuRemoteRunConfiguration::toMap() const
419{434{
420 if(debug) qDebug()<<Q_FUNC_INFO;435 if(debug) qDebug()<<Q_FUNC_INFO;
421 QVariantMap m = AbstractRemoteLinuxRunConfiguration::toMap();436 QVariantMap m = RunConfiguration::toMap();
422 m.insert(QLatin1String(UNINSTALL_KEY),m_uninstall);437 m.insert(QLatin1String(UNINSTALL_KEY),m_uninstall);
423 m.insert(QLatin1String(FORCE_INSTALL_KEY),m_forceInstall);438 m.insert(QLatin1String(FORCE_INSTALL_KEY),m_forceInstall);
424 return m;439 return m;
425440
=== modified file 'src/ubuntu/device/remote/ubunturemoterunconfiguration.h'
--- src/ubuntu/device/remote/ubunturemoterunconfiguration.h 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubunturemoterunconfiguration.h 2016-08-24 15:35:12 +0000
@@ -18,7 +18,7 @@
18#ifndef UBUNTU_INTERNAL_UBUNTUREMOTERUNCONFIGURATION_H18#ifndef UBUNTU_INTERNAL_UBUNTUREMOTERUNCONFIGURATION_H
19#define UBUNTU_INTERNAL_UBUNTUREMOTERUNCONFIGURATION_H19#define UBUNTU_INTERNAL_UBUNTUREMOTERUNCONFIGURATION_H
2020
21#include <remotelinux/abstractremotelinuxrunconfiguration.h>21#include <projectexplorer/runconfiguration.h>
22#include <coreplugin/id.h>22#include <coreplugin/id.h>
2323
24namespace Ui {24namespace Ui {
@@ -28,7 +28,7 @@
28namespace Ubuntu {28namespace Ubuntu {
29namespace Internal {29namespace Internal {
3030
31class UbuntuRemoteRunConfiguration : public RemoteLinux::AbstractRemoteLinuxRunConfiguration31class UbuntuRemoteRunConfiguration : public ProjectExplorer::RunConfiguration
32{32{
33 Q_OBJECT33 Q_OBJECT
34 Q_PROPERTY(bool forceInstall READ forceInstall WRITE setForceInstall NOTIFY forceInstallChanged)34 Q_PROPERTY(bool forceInstall READ forceInstall WRITE setForceInstall NOTIFY forceInstallChanged)
@@ -38,13 +38,12 @@
38 UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);38 UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, Core::Id id);
39 UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, UbuntuRemoteRunConfiguration *source);39 UbuntuRemoteRunConfiguration(ProjectExplorer::Target *parent, UbuntuRemoteRunConfiguration *source);
4040
41 // AbstractRemoteLinuxRunConfiguration interface
42public:41public:
43 virtual QString localExecutableFilePath() const override;42 QString localExecutableFilePath() const;
44 virtual QString remoteExecutableFilePath() const override;43 QString remoteExecutableFilePath() const;
45 virtual QStringList arguments() const override;44 QStringList arguments() const;
46 virtual QString workingDirectory() const override;45 QString workingDirectory() const;
47 virtual Utils::Environment environment() const override;46 Utils::Environment environment() const;
4847
49 virtual QStringList soLibSearchPaths () const;48 virtual QStringList soLibSearchPaths () const;
50 bool aboutToStart (QString *errorMessage);49 bool aboutToStart (QString *errorMessage);
@@ -55,6 +54,7 @@
55 virtual QString disabledReason() const override;54 virtual QString disabledReason() const override;
56 virtual bool isConfigured() const override;55 virtual bool isConfigured() const override;
57 virtual ConfigurationState ensureConfigured(QString *) override;56 virtual ConfigurationState ensureConfigured(QString *) override;
57 virtual ProjectExplorer::Runnable runnable ( ) const override;
5858
59 // ProjectConfiguration interface59 // ProjectConfiguration interface
60 virtual bool fromMap(const QVariantMap &map) override;60 virtual bool fromMap(const QVariantMap &map) override;
6161
=== modified file 'src/ubuntu/device/remote/ubunturemoteruncontrol.cpp'
--- src/ubuntu/device/remote/ubunturemoteruncontrol.cpp 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubunturemoteruncontrol.cpp 2016-08-24 15:35:12 +0000
@@ -34,12 +34,12 @@
34#include "ubuntudevice.h"34#include "ubuntudevice.h"
35#include "ubuntuwaitfordevicedialog.h"35#include "ubuntuwaitfordevicedialog.h"
3636
37#include <remotelinux/abstractremotelinuxrunconfiguration.h>
38#include <projectexplorer/devicesupport/deviceapplicationrunner.h>37#include <projectexplorer/devicesupport/deviceapplicationrunner.h>
39#include <projectexplorer/kitinformation.h>38#include <projectexplorer/kitinformation.h>
40#include <projectexplorer/target.h>39#include <projectexplorer/target.h>
41#include <utils/environment.h>40#include <utils/environment.h>
42#include <coreplugin/icore.h>41#include <coreplugin/icore.h>
42#include <coreplugin/coreicons.h>
4343
44#include <QString>44#include <QString>
45#include <QIcon>45#include <QIcon>
@@ -73,7 +73,7 @@
73 d->environment = d->runConfig->environment();73 d->environment = d->runConfig->environment();
74 d->clickPackage = d->runConfig->clickPackage();74 d->clickPackage = d->runConfig->clickPackage();
7575
76 setIcon(QLatin1String(ProjectExplorer::Constants::ICON_RUN_SMALL));76 setIcon(Core::Icons::RUN_SMALL);
77}77}
7878
79UbuntuRemoteRunControl::~UbuntuRemoteRunControl()79UbuntuRemoteRunControl::~UbuntuRemoteRunControl()
8080
=== modified file 'src/ubuntu/device/remote/ubunturemoteruncontrolfactory.cpp'
--- src/ubuntu/device/remote/ubunturemoteruncontrolfactory.cpp 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubunturemoteruncontrolfactory.cpp 2016-08-24 15:35:12 +0000
@@ -27,13 +27,13 @@
27#include <debugger/debuggerplugin.h>27#include <debugger/debuggerplugin.h>
28#include <debugger/debuggerrunconfigurationaspect.h>28#include <debugger/debuggerrunconfigurationaspect.h>
29#include <debugger/debuggerruncontrol.h>29#include <debugger/debuggerruncontrol.h>
30#include <qmldebug/qmldebugcommandlinearguments.h>
30#include <remotelinux/remotelinuxdebugsupport.h>31#include <remotelinux/remotelinuxdebugsupport.h>
31#include <remotelinux/remotelinuxruncontrol.h>32#include <remotelinux/remotelinuxruncontrol.h>
32#include <remotelinux/remotelinuxanalyzesupport.h>33#include <remotelinux/remotelinuxanalyzesupport.h>
33#include <analyzerbase/analyzerstartparameters.h>34#include <debugger/analyzer/analyzerstartparameters.h>
34#include <analyzerbase/analyzermanager.h>35#include <debugger/analyzer/analyzermanager.h>
35#include <analyzerbase/analyzerruncontrol.h>36#include <debugger/analyzer/analyzerruncontrol.h>
36#include <analyzerbase/ianalyzertool.h>
37#include <utils/portlist.h>37#include <utils/portlist.h>
38#include <utils/qtcassert.h>38#include <utils/qtcassert.h>
3939
@@ -45,7 +45,6 @@
4545
46bool UbuntuRemoteRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration,46bool UbuntuRemoteRunControlFactory::canRun(ProjectExplorer::RunConfiguration *runConfiguration,
47 Core::Id mode) const {47 Core::Id mode) const {
48
49 if(qobject_cast<UbuntuRemoteRunConfiguration*>(runConfiguration)) {48 if(qobject_cast<UbuntuRemoteRunConfiguration*>(runConfiguration)) {
50 if (mode != ProjectExplorer::Constants::NORMAL_RUN_MODE49 if (mode != ProjectExplorer::Constants::NORMAL_RUN_MODE
51 && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE50 && mode != ProjectExplorer::Constants::DEBUG_RUN_MODE
@@ -74,7 +73,11 @@
74 if (!rc->aboutToStart(errorMessage))73 if (!rc->aboutToStart(errorMessage))
75 return 0;74 return 0;
7675
77 QTC_ASSERT(rc, return 0);76 QTC_ASSERT(rc, return 0);
77 const auto rcRunnable = runConfiguration->runnable();
78 QTC_ASSERT(rcRunnable.is<ProjectExplorer::StandardRunnable>(), return 0);
79 const auto stdRunnable = rcRunnable.as<ProjectExplorer::StandardRunnable>();
80
7881
79 if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) {82 if (mode == ProjectExplorer::Constants::NORMAL_RUN_MODE) {
80 return new UbuntuRemoteRunControl(rc);83 return new UbuntuRemoteRunControl(rc);
@@ -94,34 +97,62 @@
94 return 0;97 return 0;
95 }98 }
9699
97 if (2 > dev->freePorts().count()) {100 auto aspect = rc->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
101 if (aspect->portsUsedByDebugger() > dev->freePorts().count()) {
98 *errorMessage = tr("Cannot debug: Not enough free ports available.");102 *errorMessage = tr("Cannot debug: Not enough free ports available.");
99 return 0;103 return 0;
100 }104 }
101 Debugger::DebuggerStartParameters params = RemoteLinux::LinuxDeviceDebugSupport::startParameters(rc);105
106 /*
107 * Taken from remotelinuxruncontrolfactory.cpp and adapted
108 * to work here.
109 */
110 Debugger::DebuggerStartParameters params;
111 params.startMode = Debugger::AttachToRemoteServer;
112 params.closeMode = Debugger::KillAndExitMonitorAtClose;
113 params.remoteSetupNeeded = true;
114 params.useContinueInsteadOfRun = true;
115
116 if (aspect->useQmlDebugger()) {
117 params.qmlServer.host = dev->sshParameters().host;
118 params.qmlServer.port = Utils::Port(); // port is selected later on
119 }
120 if (aspect->useCppDebugger()) {
121 aspect->setUseMultiProcess(true);
122#if 1
123 params.inferior.executable = stdRunnable.executable;
124 params.inferior.commandLineArguments = stdRunnable.commandLineArguments;
125 if (aspect->useQmlDebugger()) {
126 params.inferior.commandLineArguments.prepend(QLatin1Char(' '));
127 params.inferior.commandLineArguments.prepend(QmlDebug::qmlDebugTcpArguments(QmlDebug::QmlDebuggerServices));
128 }
129#endif
130 params.remoteChannel = dev->sshParameters().host + QLatin1String(":-1");
131 params.symbolFile = rc->localExecutableFilePath();
132 }
102133
103 params.solibSearchPath.append(rc->soLibSearchPaths());134 params.solibSearchPath.append(rc->soLibSearchPaths());
104135
105 //Always leave this empty or the debugger backend tries to execute136 Debugger::DebuggerRunControl * const runControl = Debugger::createDebuggerRunControl(params, rc, errorMessage, mode);
106 //the binary on the phone instead of attaching and continuing the already
107 //running app
108 params.remoteExecutable = QString();
109 //params.expectedSignals.append("SIGTRAP");
110
111 if(debug) qDebug()<<"Solib search path : "<<params.solibSearchPath;
112
113 Debugger::DebuggerRunControl * const runControl
114 = Debugger::createDebuggerRunControl(params, rc, errorMessage, mode);
115 if (!runControl)137 if (!runControl)
116 return 0;138 return 0;
139
117 UbuntuRemoteDebugSupport * const debugSupport =140 UbuntuRemoteDebugSupport * const debugSupport =
118 new UbuntuRemoteDebugSupport(rc, runControl);141 new UbuntuRemoteDebugSupport(rc, runControl);
119 connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished()));142 connect(runControl, SIGNAL(finished()), debugSupport, SLOT(handleDebuggingFinished()));
120 return runControl;143 return runControl;
121144
122 } else if ( mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE ) {145 } else if ( mode == ProjectExplorer::Constants::QML_PROFILER_RUN_MODE ) {
123 Analyzer::AnalyzerStartParameters params = RemoteLinux::RemoteLinuxAnalyzeSupport::startParameters(rc, mode);146 /*
124 Analyzer::AnalyzerRunControl *runControl = Analyzer::AnalyzerManager::createRunControl(params, runConfiguration);147 * Taken from remotelinuxruncontrolfactory.cpp and adapted
148 * to work here.
149 */
150 auto runControl = Debugger::createAnalyzerRunControl(rc, mode);
151 Debugger::AnalyzerConnection connection;
152 connection.connParams =
153 ProjectExplorer::DeviceKitInformation::device(rc->target()->kit())->sshParameters();
154 connection.analyzerHost = connection.connParams.host;
155 runControl->setConnection(connection);
125 UbuntuRemoteAnalyzeSupport * const analyzeSupport =156 UbuntuRemoteAnalyzeSupport * const analyzeSupport =
126 new UbuntuRemoteAnalyzeSupport(rc, runControl, mode);157 new UbuntuRemoteAnalyzeSupport(rc, runControl, mode);
127 connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));158 connect(runControl, SIGNAL(finished()), analyzeSupport, SLOT(handleProfilingFinished()));
128159
=== modified file 'src/ubuntu/device/remote/ubunturemoterunner.cpp'
--- src/ubuntu/device/remote/ubunturemoterunner.cpp 2016-03-29 09:41:07 +0000
+++ src/ubuntu/device/remote/ubunturemoterunner.cpp 2016-08-24 15:35:12 +0000
@@ -19,7 +19,7 @@
19const QString SSH_BASE_COMMAND = QStringLiteral("ssh -i %1 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p%2 %3@%4");19const QString SSH_BASE_COMMAND = QStringLiteral("ssh -i %1 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p%2 %3@%4");
2020
21enum {21enum {
22 debug = 022 debug = 1
23};23};
2424
25class UbuntuRemoteClickApplicationRunnerPrivate25class UbuntuRemoteClickApplicationRunnerPrivate
2626
=== modified file 'src/ubuntu/localportsmanager.cpp'
--- src/ubuntu/localportsmanager.cpp 2014-11-26 19:45:36 +0000
+++ src/ubuntu/localportsmanager.cpp 2016-08-24 15:35:12 +0000
@@ -100,13 +100,13 @@
100 if (serial == device && localPort >= m_instance->m_first && localPort <= m_instance->m_last) {100 if (serial == device && localPort >= m_instance->m_first && localPort <= m_instance->m_last) {
101 if(debug) qDebug()<<"Found port already linked to device: "<<localPort<<":"<<remotePort;101 if(debug) qDebug()<<"Found port already linked to device: "<<localPort<<":"<<remotePort;
102102
103 freePorts.addPort(localPort);103 freePorts.addPort(Utils::Port(localPort));
104104
105 if (freePorts.count() == count)105 if (freePorts.count() == count)
106 break;106 break;
107 } else {107 } else {
108 if(debug) qDebug()<<"Found port in use: "<<localPort<<":"<<remotePort;108 if(debug) qDebug()<<"Found port in use: "<<localPort<<":"<<remotePort;
109 usedPorts.addPort(localPort);109 usedPorts.addPort(Utils::Port(localPort));
110 }110 }
111 }111 }
112112
@@ -116,14 +116,14 @@
116 int port = firstPort + i;116 int port = firstPort + i;
117117
118 //is the port in use?118 //is the port in use?
119 if(usedPorts.contains(port))119 if(usedPorts.contains(Utils::Port(port)))
120 continue;120 continue;
121121
122 //is that port already assigned to us?122 //is that port already assigned to us?
123 if(freePorts.contains(port))123 if(freePorts.contains(Utils::Port(port)))
124 continue;124 continue;
125125
126 freePorts.addPort(port);126 freePorts.addPort(Utils::Port(port));
127 found++;127 found++;
128 if(debug) qDebug()<<"Found free port: "<<port;128 if(debug) qDebug()<<"Found free port: "<<port;
129 }129 }
130130
=== modified file 'src/ubuntu/ubuntuabstractguieditordocument.cpp'
--- src/ubuntu/ubuntuabstractguieditordocument.cpp 2015-03-06 15:02:08 +0000
+++ src/ubuntu/ubuntuabstractguieditordocument.cpp 2016-08-24 15:35:12 +0000
@@ -59,16 +59,6 @@
59 return false;59 return false;
60}60}
6161
62QString UbuntuAbstractGuiEditorDocument::defaultPath() const
63{
64 return filePath().toFileInfo().absolutePath();
65}
66
67QString UbuntuAbstractGuiEditorDocument::suggestedFileName() const
68{
69 return filePath().toFileInfo().fileName();
70}
71
72bool UbuntuAbstractGuiEditorDocument::isModified() const62bool UbuntuAbstractGuiEditorDocument::isModified() const
73{63{
74 return TextDocument::isModified() || m_editorWidget->isModified();64 return TextDocument::isModified() || m_editorWidget->isModified();
7565
=== modified file 'src/ubuntu/ubuntuabstractguieditordocument.h'
--- src/ubuntu/ubuntuabstractguieditordocument.h 2016-07-22 10:17:50 +0000
+++ src/ubuntu/ubuntuabstractguieditordocument.h 2016-08-24 15:35:12 +0000
@@ -33,10 +33,6 @@
33public:33public:
34 UbuntuAbstractGuiEditorDocument(const QString &mimeType, UbuntuAbstractGuiEditorWidget *editorWidget);34 UbuntuAbstractGuiEditorDocument(const QString &mimeType, UbuntuAbstractGuiEditorWidget *editorWidget);
35 bool save(QString *errorString, const QString &fileName = QString(), bool autoSave = false) override;35 bool save(QString *errorString, const QString &fileName = QString(), bool autoSave = false) override;
36
37 QString defaultPath() const override;
38 QString suggestedFileName() const override;
39
40 bool isModified() const override;36 bool isModified() const override;
41 bool isSaveAsAllowed() const override;37 bool isSaveAsAllowed() const override;
42private:38private:
4339
=== modified file 'src/ubuntu/ubuntuclickdialog.cpp'
--- src/ubuntu/ubuntuclickdialog.cpp 2016-05-17 16:33:36 +0000
+++ src/ubuntu/ubuntuclickdialog.cpp 2016-08-24 15:35:12 +0000
@@ -113,7 +113,7 @@
113 int code = runProcessModal(paramList);113 int code = runProcessModal(paramList);
114 if(mode == UbuntuClickTool::Delete) {114 if(mode == UbuntuClickTool::Delete) {
115 //redetect documentation115 //redetect documentation
116 QtSupport::QtVersionManager::delayedInitialize();116 QtSupport::QtVersionManager::triggerDocumentationUpdate();
117 }117 }
118 return code;118 return code;
119}119}
120120
=== modified file 'src/ubuntu/ubuntuclicktool.cpp'
--- src/ubuntu/ubuntuclicktool.cpp 2016-07-12 08:47:56 +0000
+++ src/ubuntu/ubuntuclicktool.cpp 2016-08-24 15:35:12 +0000
@@ -105,7 +105,7 @@
105 const QMap<QString, QString> &envMap)105 const QMap<QString, QString> &envMap)
106{106{
107 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target);107 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target);
108 if (!tc || tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {108 if (!tc || tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
109 ProjectExplorer::ProcessParameters p;109 ProjectExplorer::ProcessParameters p;
110 p.setArguments(Utils::QtcProcess::joinArgs(args));110 p.setArguments(Utils::QtcProcess::joinArgs(args));
111 p.setCommand(cmd);111 p.setCommand(cmd);
@@ -253,6 +253,10 @@
253253
254QString UbuntuClickTool::targetBasePath(const UbuntuClickTool::Target &target)254QString UbuntuClickTool::targetBasePath(const UbuntuClickTool::Target &target)
255{255{
256 static QMap<QString, QString> basePathCache;
257 if (basePathCache.contains(target.containerName))
258 return basePathCache.value(target.containerName);
259
256 QProcess sdkTool;260 QProcess sdkTool;
257 sdkTool.setReadChannel(QProcess::StandardOutput);261 sdkTool.setReadChannel(QProcess::StandardOutput);
258 sdkTool.setProgram(Constants::UBUNTU_TARGET_TOOL);262 sdkTool.setProgram(Constants::UBUNTU_TARGET_TOOL);
@@ -264,7 +268,9 @@
264 return QString();268 return QString();
265269
266 QTextStream in(&sdkTool);270 QTextStream in(&sdkTool);
267 return in.readAll().trimmed();271 QString basePath = in.readAll().trimmed();
272 basePathCache.insert(target.containerName, basePath);
273 return basePath;
268}274}
269275
270bool UbuntuClickTool::parseContainerName(const QString &name, UbuntuClickTool::Target *target, QStringList *allExt)276bool UbuntuClickTool::parseContainerName(const QString &name, UbuntuClickTool::Target *target, QStringList *allExt)
@@ -292,9 +298,14 @@
292 */298 */
293bool UbuntuClickTool::targetExists(const UbuntuClickTool::Target &target)299bool UbuntuClickTool::targetExists(const UbuntuClickTool::Target &target)
294{300{
301 return targetExists(target.containerName);
302}
303
304bool UbuntuClickTool::targetExists(const QString &targetName)
305{
295 QProcess proc;306 QProcess proc;
296 proc.start(Constants::UBUNTU_TARGET_TOOL,307 proc.start(Constants::UBUNTU_TARGET_TOOL,
297 QStringList()<<QStringLiteral("exists")<<target.containerName);308 QStringList()<<QStringLiteral("exists")<<targetName);
298 if(!proc.waitForFinished(3000)) {309 if(!proc.waitForFinished(3000)) {
299 qWarning()<<"usdk-target did not return in time.";310 qWarning()<<"usdk-target did not return in time.";
300 return false;311 return false;
@@ -394,7 +405,7 @@
394 return nullptr;405 return nullptr;
395406
396 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(t->kit());407 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(t->kit());
397 if(!tc || (tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)))408 if(!tc || (tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID))
398 return nullptr;409 return nullptr;
399410
400 Internal::ClickToolChain *clickTc = static_cast<Internal::ClickToolChain*>(tc);411 Internal::ClickToolChain *clickTc = static_cast<Internal::ClickToolChain*>(tc);
@@ -460,13 +471,13 @@
460 return UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("make"),target);471 return UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("make"),target);
461}472}
462473
463QString UbuntuClickTool::mapIncludePathsForCMake(ProjectExplorer::Kit *k, const QString &in)474QString UbuntuClickTool::mapIncludePathsForCMake(const ProjectExplorer::Kit *k, const QString &in)
464{475{
465 if (in.isEmpty())476 if (in.isEmpty())
466 return in;477 return in;
467478
468 bool canMap = ProjectExplorer::ToolChainKitInformation::toolChain(k)479 bool canMap = ProjectExplorer::ToolChainKitInformation::toolChain(k)
469 && ProjectExplorer::ToolChainKitInformation::toolChain(k)->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)480 && ProjectExplorer::ToolChainKitInformation::toolChain(k)->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID
470 && !ProjectExplorer::SysRootKitInformation::sysRoot(k).isEmpty();481 && !ProjectExplorer::SysRootKitInformation::sysRoot(k).isEmpty();
471482
472 if (!canMap)483 if (!canMap)
473484
=== modified file 'src/ubuntu/ubuntuclicktool.h'
--- src/ubuntu/ubuntuclicktool.h 2016-07-12 08:47:56 +0000
+++ src/ubuntu/ubuntuclicktool.h 2016-08-24 15:35:12 +0000
@@ -25,6 +25,7 @@
25#include <QFutureInterface>25#include <QFutureInterface>
26#include <QQueue>26#include <QQueue>
27#include <projectexplorer/processparameters.h>27#include <projectexplorer/processparameters.h>
28#include <cmakeprojectmanager/cmaketool.h>
28#include <utils/qtcprocess.h>29#include <utils/qtcprocess.h>
29#include <QDebug>30#include <QDebug>
3031
@@ -85,11 +86,12 @@
85 static QString findOrCreateToolWrapper(const QString &tool, const UbuntuClickTool::Target &target);86 static QString findOrCreateToolWrapper(const QString &tool, const UbuntuClickTool::Target &target);
86 static QString findOrCreateQMakeWrapper(const UbuntuClickTool::Target &target);87 static QString findOrCreateQMakeWrapper(const UbuntuClickTool::Target &target);
87 static QString findOrCreateMakeWrapper(const UbuntuClickTool::Target &target);88 static QString findOrCreateMakeWrapper(const UbuntuClickTool::Target &target);
88 static QString mapIncludePathsForCMake(ProjectExplorer::Kit *k, const QString &in);89 static QString mapIncludePathsForCMake(const ProjectExplorer::Kit *k, const QString &in);
89 static QString hostArchitecture ();90 static QString hostArchitecture ();
90 static bool compatibleWithHostArchitecture (const QString &targetArch);91 static bool compatibleWithHostArchitecture (const QString &targetArch);
9192
92 static bool targetExists (const Target& target);93 static bool targetExists (const Target& target);
94 static bool targetExists (const QString& targetName);
93 static QList<Target> listAvailableTargets (const QString &framework=QString());95 static QList<Target> listAvailableTargets (const QString &framework=QString());
94 static QList<Target> listPossibleDeviceContainers ();96 static QList<Target> listPossibleDeviceContainers ();
95 static const Target *clickTargetFromTarget(ProjectExplorer::Target *t);97 static const Target *clickTargetFromTarget(ProjectExplorer::Target *t);
9698
=== modified file 'src/ubuntu/ubuntucmakecache.cpp'
--- src/ubuntu/ubuntucmakecache.cpp 2014-11-14 11:12:31 +0000
+++ src/ubuntu/ubuntucmakecache.cpp 2016-08-24 15:35:12 +0000
@@ -8,6 +8,7 @@
88
9#include <QRegularExpression>9#include <QRegularExpression>
10#include <QDir>10#include <QDir>
11#include <QDebug>
1112
12namespace Ubuntu{13namespace Ubuntu{
13namespace Internal {14namespace Internal {
1415
=== modified file 'src/ubuntu/ubuntuconstants.h'
--- src/ubuntu/ubuntuconstants.h 2016-07-06 09:18:16 +0000
+++ src/ubuntu/ubuntuconstants.h 2016-08-24 15:35:12 +0000
@@ -251,6 +251,7 @@
251251
252const char UBUNTU_ICON[] = ":/ubuntu/images/ubuntu-32.png";252const char UBUNTU_ICON[] = ":/ubuntu/images/ubuntu-32.png";
253253
254/*
254const char FEATURE_UNITY_SCOPE[] = "Ubuntu.Wizards.FeatureUnityScope";255const char FEATURE_UNITY_SCOPE[] = "Ubuntu.Wizards.FeatureUnityScope";
255const char FEATURE_UBUNTU_PRECISE[] = "Ubuntu.Wizards.FeatureUbuntuPrecise";256const char FEATURE_UBUNTU_PRECISE[] = "Ubuntu.Wizards.FeatureUbuntuPrecise";
256const char FEATURE_UBUNTU_QUANTAL[] = "Ubuntu.Wizards.FeatureUbuntuQuantal";257const char FEATURE_UBUNTU_QUANTAL[] = "Ubuntu.Wizards.FeatureUbuntuQuantal";
@@ -274,6 +275,7 @@
274275
275const char PLATFORM_DESKTOP[] = "Desktop";276const char PLATFORM_DESKTOP[] = "Desktop";
276const char PLATFORM_DESKTOP_DISPLAYNAME[] = "Ubuntu %0";277const char PLATFORM_DESKTOP_DISPLAYNAME[] = "Ubuntu %0";
278*/
277279
278const char TASK_DEVICE_SCRIPT[] = "Ubuntu.Task.DeviceScript";280const char TASK_DEVICE_SCRIPT[] = "Ubuntu.Task.DeviceScript";
279281
280282
=== modified file 'src/ubuntu/ubuntudevicemode.cpp'
--- src/ubuntu/ubuntudevicemode.cpp 2015-06-19 07:13:13 +0000
+++ src/ubuntu/ubuntudevicemode.cpp 2016-08-24 15:35:12 +0000
@@ -85,7 +85,6 @@
85 m_modeView->rootContext()->setContextProperty(QLatin1String("resourceRoot") ,Constants::UBUNTU_DEVICESCREEN_ROOT);85 m_modeView->rootContext()->setContextProperty(QLatin1String("resourceRoot") ,Constants::UBUNTU_DEVICESCREEN_ROOT);
86 m_modeView->setSource(QUrl::fromLocalFile(Constants::UBUNTU_DEVICESCREEN_QML));86 m_modeView->setSource(QUrl::fromLocalFile(Constants::UBUNTU_DEVICESCREEN_QML));
8787
88 connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), SLOT(modeChanged(Core::IMode*)));
89 setWidget(m_modeWidget);88 setWidget(m_modeWidget);
90}89}
9190
@@ -113,11 +112,6 @@
113 m_qmlControl->showAddEmulatorDialog();112 m_qmlControl->showAddEmulatorDialog();
114}113}
115114
116void UbuntuDeviceMode::modeChanged(Core::IMode *mode)
117{
118 Q_UNUSED(mode);
119}
120
121void UbuntuDeviceMode::initialize() {115void UbuntuDeviceMode::initialize() {
122116
123}117}
124118
=== modified file 'src/ubuntu/ubuntudevicemode.h'
--- src/ubuntu/ubuntudevicemode.h 2016-03-29 09:41:07 +0000
+++ src/ubuntu/ubuntudevicemode.h 2016-08-24 15:35:12 +0000
@@ -73,9 +73,6 @@
73signals:73signals:
74 void updateDeviceActions ();74 void updateDeviceActions ();
7575
76protected slots:
77 void modeChanged(Core::IMode*);
78
79protected:76protected:
80 static UbuntuDeviceMode *m_instance;77 static UbuntuDeviceMode *m_instance;
81 UbuntuDevicesModel *m_devicesModel;78 UbuntuDevicesModel *m_devicesModel;
8279
=== modified file 'src/ubuntu/ubuntudevicesmodel.cpp'
--- src/ubuntu/ubuntudevicesmodel.cpp 2015-11-11 14:50:13 +0000
+++ src/ubuntu/ubuntudevicesmodel.cpp 2016-08-24 15:35:12 +0000
@@ -209,7 +209,7 @@
209 case Qt::EditRole:209 case Qt::EditRole:
210 return m_knownDevices[index.row()]->device()->displayName();210 return m_knownDevices[index.row()]->device()->displayName();
211 case UniqueIdRole:211 case UniqueIdRole:
212 return m_knownDevices[index.row()]->id().uniqueIdentifier();212 return qVariantFromValue(m_knownDevices[index.row()]->id());
213 case DetectionStateRole:213 case DetectionStateRole:
214 return m_knownDevices[index.row()]->device()->detectionState();214 return m_knownDevices[index.row()]->device()->detectionState();
215 case DetectionStateStringRole:215 case DetectionStateStringRole:
@@ -294,62 +294,62 @@
294 return QAbstractListModel::flags(index) | Qt::ItemIsEditable;294 return QAbstractListModel::flags(index) | Qt::ItemIsEditable;
295}295}
296296
297void UbuntuDevicesModel::triggerPortForwarding(const int devId)297void UbuntuDevicesModel::triggerPortForwarding(const QVariant &devId)
298{298{
299 int row = findDevice(devId);299 int row = findDevice(devId.value<Core::Id>());
300 if(row < 0)300 if(row < 0)
301 return;301 return;
302 m_knownDevices[row]->device()->enablePortForward();302 m_knownDevices[row]->device()->enablePortForward();
303}303}
304304
305void UbuntuDevicesModel::triggerSSHSetup(const int devId)305void UbuntuDevicesModel::triggerSSHSetup(const QVariant &devId)
306{306{
307 int row = findDevice(devId);307 int row = findDevice(devId.value<Core::Id>());
308 if(row < 0)308 if(row < 0)
309 return;309 return;
310 m_knownDevices[row]->device()->deployPublicKey();310 m_knownDevices[row]->device()->deployPublicKey();
311}311}
312312
313void UbuntuDevicesModel::triggerSSHConnection(const int devId)313void UbuntuDevicesModel::triggerSSHConnection(const QVariant &devId)
314{314{
315 int row = findDevice(devId);315 int row = findDevice(devId.value<Core::Id>());
316 if(row < 0)316 if(row < 0)
317 return;317 return;
318 m_knownDevices[row]->device()->openTerminal();318 m_knownDevices[row]->device()->openTerminal();
319}319}
320320
321void UbuntuDevicesModel::triggerKitAutocreate(const int devId)321void UbuntuDevicesModel::triggerKitAutocreate(const QVariant &devId)
322{322{
323 int row = findDevice(devId);323 int row = findDevice(devId.value<Core::Id>());
324 if(row < 0)324 if(row < 0)
325 return;325 return;
326 UbuntuKitManager::autoCreateKit(m_knownDevices[row]->device());326 UbuntuKitManager::autoCreateKit(m_knownDevices[row]->device());
327}327}
328328
329void UbuntuDevicesModel::triggerKitRemove(const int devId, const QVariant &kitid)329void UbuntuDevicesModel::triggerKitRemove(const QVariant &devId, const QVariant &kitid)
330{330{
331 int row = findDevice(devId);331 int row = findDevice(devId.value<Core::Id>());
332 if(row < 0)332 if(row < 0)
333 return;333 return;
334334
335 ProjectExplorer::Kit* k = ProjectExplorer::KitManager::find(Core::Id::fromSetting(kitid));335 ProjectExplorer::Kit* k = ProjectExplorer::KitManager::find(Core::Id::fromSetting(kitid));
336 if(ProjectExplorer::DeviceKitInformation::deviceId(k) == Core::Id::fromUniqueIdentifier(devId)) {336 if(ProjectExplorer::DeviceKitInformation::deviceId(k) == devId.value<Core::Id>()) {
337 //completely delete the kit337 //completely delete the kit
338 ProjectExplorer::KitManager::deregisterKit(k);338 ProjectExplorer::KitManager::deregisterKit(k);
339 }339 }
340}340}
341341
342void UbuntuDevicesModel::triggerRedetect(const int devId)342void UbuntuDevicesModel::triggerRedetect(const QVariant &devId)
343{343{
344 int row = findDevice(devId);344 int row = findDevice(devId.value<Core::Id>());
345 if(row < 0)345 if(row < 0)
346 return;346 return;
347 m_knownDevices[row]->device()->helper()->refresh();347 m_knownDevices[row]->device()->helper()->refresh();
348}348}
349349
350void UbuntuDevicesModel::deleteDevice(const int devId)350void UbuntuDevicesModel::deleteDevice(const QVariant &devId)
351{351{
352 int index = findDevice(devId);352 int index = findDevice(devId.value<Core::Id>());
353 if(index < 0) {353 if(index < 0) {
354 QMessageBox::critical(Core::ICore::mainWindow(),tr("Could not delete device"),tr("The device ID is unknown, please press the refresh button and try again."));354 QMessageBox::critical(Core::ICore::mainWindow(),tr("Could not delete device"),tr("The device ID is unknown, please press the refresh button and try again."));
355 return;355 return;
@@ -374,18 +374,18 @@
374 }374 }
375}375}
376376
377int UbuntuDevicesModel::findDevice(int uniqueIdentifier) const377int UbuntuDevicesModel::findDevice(const Core::Id &devId) const
378{378{
379 for ( int i = 0; i < m_knownDevices.size(); i++ ) {379 for ( int i = 0; i < m_knownDevices.size(); i++ ) {
380 if(m_knownDevices[i]->id().uniqueIdentifier() == uniqueIdentifier)380 if(m_knownDevices[i]->id() == devId)
381 return i;381 return i;
382 }382 }
383 return -1;383 return -1;
384}384}
385385
386bool UbuntuDevicesModel::hasDevice(int uniqueIdentifier) const386bool UbuntuDevicesModel::hasDevice(const Core::Id &devId) const
387{387{
388 return findDevice(uniqueIdentifier) >= 0;388 return findDevice(devId) >= 0;
389}389}
390390
391UbuntuDevice::ConstPtr UbuntuDevicesModel::device(const int index)391UbuntuDevice::ConstPtr UbuntuDevicesModel::device(const int index)
@@ -415,7 +415,7 @@
415{415{
416 UbuntuDevicesItem* hlpr = qobject_cast<UbuntuDevicesItem*>(possibleHelper);416 UbuntuDevicesItem* hlpr = qobject_cast<UbuntuDevicesItem*>(possibleHelper);
417 if(!hlpr) return -1;417 if(!hlpr) return -1;
418 return findDevice(hlpr->id().uniqueIdentifier());418 return findDevice(hlpr->id());
419}419}
420420
421void UbuntuDevicesModel::deviceChanged(QObject *possibleHelper, const QVector<int> &relatedRoles)421void UbuntuDevicesModel::deviceChanged(QObject *possibleHelper, const QVector<int> &relatedRoles)
@@ -529,7 +529,7 @@
529529
530 if(debug) qDebug()<<"Device Manager reports device added: "<<id.toString();530 if(debug) qDebug()<<"Device Manager reports device added: "<<id.toString();
531531
532 if (hasDevice(id.uniqueIdentifier()))532 if (hasDevice(id))
533 return;533 return;
534534
535 Ubuntu::Internal::UbuntuDevice::ConstPtr ubuntuDev535 Ubuntu::Internal::UbuntuDevice::ConstPtr ubuntuDev
@@ -550,7 +550,7 @@
550 */550 */
551void UbuntuDevicesModel::deviceRemoved(const Core::Id &id)551void UbuntuDevicesModel::deviceRemoved(const Core::Id &id)
552{552{
553 int index = findDevice(id.uniqueIdentifier());553 int index = findDevice(id);
554 if(index < 0)554 if(index < 0)
555 return;555 return;
556556
@@ -573,7 +573,7 @@
573 << Qt::DisplayRole << Qt::EditRole573 << Qt::DisplayRole << Qt::EditRole
574 << ConnectionStateRole << ConnectionStateStringRole;574 << ConnectionStateRole << ConnectionStateStringRole;
575575
576 int index = findDevice(id.uniqueIdentifier());576 int index = findDevice(id);
577 if(index >= 0) {577 if(index >= 0) {
578 QModelIndex changed = createIndex(index,0);578 QModelIndex changed = createIndex(index,0);
579 emit dataChanged(changed, changed,relatedRoles);579 emit dataChanged(changed, changed,relatedRoles);
@@ -582,7 +582,7 @@
582582
583void UbuntuDevicesModel::deviceConnected(const QString &id)583void UbuntuDevicesModel::deviceConnected(const QString &id)
584{584{
585 int idx = findDevice(Core::Id::fromSetting(id).uniqueIdentifier());585 int idx = findDevice(Core::Id::fromSetting(id));
586 if(idx >= 0)586 if(idx >= 0)
587 return;587 return;
588588
@@ -599,7 +599,7 @@
599 */599 */
600void UbuntuDevicesModel::registerNewDevice(const QString &serial, const QString &arch)600void UbuntuDevicesModel::registerNewDevice(const QString &serial, const QString &arch)
601{601{
602 if(findDevice(Core::Id::fromSetting(serial).uniqueIdentifier()) >= 0)602 if(findDevice(Core::Id::fromSetting(serial)) >= 0)
603 return;603 return;
604604
605 if(!ClickToolChain::supportedArchitectures().contains(arch)) {605 if(!ClickToolChain::supportedArchitectures().contains(arch)) {
@@ -650,30 +650,24 @@
650 switch(m_state) {650 switch(m_state) {
651 case CheckEmulatorInstalled: {651 case CheckEmulatorInstalled: {
652 return tr("Checking if emulator tool is installed");652 return tr("Checking if emulator tool is installed");
653 break;
654 }653 }
655 case InstallEmulator: {654 case InstallEmulator: {
656 return tr("Installing emulator tool");655 return tr("Installing emulator tool");
657 break;
658 }656 }
659 case CreateEmulatorImage: {657 case CreateEmulatorImage: {
660 return tr("Creating emulator image");658 return tr("Creating emulator image");
661 break;
662 }659 }
663 case ReadFromSettings:{660 case ReadFromSettings:{
664 return tr("Reading settings");661 return tr("Reading settings");
665 }662 }
666 case FindImages:{663 case FindImages:{
667 return tr("Searching for emulator images");664 return tr("Searching for emulator images");
668 break;
669 }665 }
670 case AdbList:{666 case AdbList:{
671 return tr("Querying ADB");667 return tr("Querying ADB");
672 break;
673 }668 }
674 default:669 default:
675 return QString();670 return QString();
676 break;
677 }671 }
678}672}
679673
@@ -816,7 +810,7 @@
816810
817void UbuntuDevicesModel::startEmulator(const QString &name)811void UbuntuDevicesModel::startEmulator(const QString &name)
818{812{
819 int idx = findDevice(Core::Id::fromSetting(name).uniqueIdentifier());813 int idx = findDevice(Core::Id::fromSetting(name));
820 if(idx < 0)814 if(idx < 0)
821 return;815 return;
822816
@@ -828,7 +822,7 @@
828822
829void UbuntuDevicesModel::stopEmulator(const QString &name)823void UbuntuDevicesModel::stopEmulator(const QString &name)
830{824{
831 int idx = findDevice(Core::Id::fromSetting(name).uniqueIdentifier());825 int idx = findDevice(Core::Id::fromSetting(name));
832 if(idx < 0)826 if(idx < 0)
833 return;827 return;
834828
@@ -841,7 +835,7 @@
841835
842void UbuntuDevicesModel::deleteEmulator(const QString &name)836void UbuntuDevicesModel::deleteEmulator(const QString &name)
843{837{
844 int index = findDevice(Core::Id::fromSetting(name).uniqueIdentifier());838 int index = findDevice(Core::Id::fromSetting(name));
845 if(index < 0)839 if(index < 0)
846 return;840 return;
847841
@@ -865,7 +859,9 @@
865QVariant UbuntuDevicesModel::validateEmulatorName(const QString &name)859QVariant UbuntuDevicesModel::validateEmulatorName(const QString &name)
866{860{
867 QString error;861 QString error;
868 bool result = Utils::ProjectIntroPage::validateProjectName(name,&error);862
863 QRegularExpression exp(QStringLiteral("^[a-zA-Z][a-zA-Z0-9]+"));
864 bool result = exp.match(name).hasMatch();
869865
870 if(result) {866 if(result) {
871 foreach (UbuntuDevicesItem *item, m_knownDevices) {867 foreach (UbuntuDevicesItem *item, m_knownDevices) {
@@ -877,6 +873,8 @@
877 }873 }
878 }874 }
879 }875 }
876 } else {
877 error = tr("Emulator names can only contain letters and numbers.");
880 }878 }
881879
882 QVariantMap m;880 QVariantMap m;
@@ -966,10 +964,10 @@
966 case FindImages: {964 case FindImages: {
967 QStringList lines = m_reply.trimmed().split(QLatin1String(Constants::LINEFEED));965 QStringList lines = m_reply.trimmed().split(QLatin1String(Constants::LINEFEED));
968966
969 QSet<int> notFoundImages;967 QSet<Core::Id> notFoundImages;
970 foreach(UbuntuDevicesItem *item, m_knownDevices) {968 foreach(UbuntuDevicesItem *item, m_knownDevices) {
971 if(item->device()->machineType() == ProjectExplorer::IDevice::Emulator)969 if(item->device()->machineType() == ProjectExplorer::IDevice::Emulator)
972 notFoundImages.insert(item->device()->id().uniqueIdentifier());970 notFoundImages.insert(item->device()->id());
973 }971 }
974972
975 QMutableStringListIterator iter(lines);973 QMutableStringListIterator iter(lines);
@@ -1021,10 +1019,10 @@
1021 bool addToManager = false;1019 bool addToManager = false;
1022 Ubuntu::Internal::UbuntuDevice::Ptr dev;1020 Ubuntu::Internal::UbuntuDevice::Ptr dev;
1023 Core::Id devId = Core::Id::fromSetting(deviceSerial);1021 Core::Id devId = Core::Id::fromSetting(deviceSerial);
1024 int index = findDevice(devId.uniqueIdentifier());1022 int index = findDevice(devId);
10251023
1026 if(index >= 0) {1024 if(index >= 0) {
1027 notFoundImages.remove(devId.uniqueIdentifier());1025 notFoundImages.remove(devId);
1028 dev = m_knownDevices[index]->device();1026 dev = m_knownDevices[index]->device();
1029 } else {1027 } else {
1030 dev = Ubuntu::Internal::UbuntuDevice::create(1028 dev = Ubuntu::Internal::UbuntuDevice::create(
@@ -1046,8 +1044,12 @@
1046 }1044 }
10471045
1048 //remove all ubuntu emulators that are in the settings but don't exist in the system1046 //remove all ubuntu emulators that are in the settings but don't exist in the system
1049 foreach(int curr,notFoundImages) {1047 foreach(const Core::Id &curr,notFoundImages) {
1050 ProjectExplorer::DeviceManager::instance()->removeDevice(Core::Id::fromUniqueIdentifier(curr));1048 int row = findDevice(curr);
1049 if (row < 0 || row >= rowCount())
1050 continue;
1051
1052 ProjectExplorer::DeviceManager::instance()->removeDevice(m_knownDevices.at(row)->id());
1051 }1053 }
10521054
1053 queryAdb();1055 queryAdb();
@@ -1069,7 +1071,7 @@
1069 continue;1071 continue;
1070 }1072 }
10711073
1072 QRegularExpression exp(QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_ADB_REGEX));1074 QRegularExpression exp((QLatin1String(Constants::UBUNTUDEVICESWIDGET_ONFINISHED_ADB_REGEX)));
1073 QRegularExpressionMatch match = exp.match(line);1075 QRegularExpressionMatch match = exp.match(line);
10741076
1075 if(match.hasMatch()) {1077 if(match.hasMatch()) {
@@ -1231,4 +1233,3 @@
12311233
1232}1234}
1233}1235}
1234
12351236
=== modified file 'src/ubuntu/ubuntudevicesmodel.h'
--- src/ubuntu/ubuntudevicesmodel.h 2016-07-22 10:17:50 +0000
+++ src/ubuntu/ubuntudevicesmodel.h 2016-08-24 15:35:12 +0000
@@ -88,8 +88,8 @@
8888
89 Q_INVOKABLE bool set(int index, const QString &role, const QVariant &value);89 Q_INVOKABLE bool set(int index, const QString &role, const QVariant &value);
9090
91 int findDevice(int uniqueIdentifier) const;91 int findDevice(const Core::Id &devId) const;
92 bool hasDevice (int uniqueIdentifier) const;92 bool hasDevice (const Core::Id &devId) const;
93 UbuntuDevice::ConstPtr device ( const int index );93 UbuntuDevice::ConstPtr device ( const int index );
9494
95 // QAbstractItemModel interface95 // QAbstractItemModel interface
@@ -116,13 +116,13 @@
116 void stateChanged(QString arg);116 void stateChanged(QString arg);
117117
118public slots:118public slots:
119 void triggerPortForwarding ( const int devId );119 void triggerPortForwarding ( const QVariant &devId );
120 void triggerSSHSetup ( const int devId );120 void triggerSSHSetup ( const QVariant &devId );
121 void triggerSSHConnection ( const int devId );121 void triggerSSHConnection ( const QVariant &devId );
122 void triggerKitAutocreate ( const int devId );122 void triggerKitAutocreate ( const QVariant &devId );
123 void triggerKitRemove ( const int devId, const QVariant &kitid );123 void triggerKitRemove ( const QVariant &devId, const QVariant &kitid );
124 void triggerRedetect ( const int devId );124 void triggerRedetect ( const QVariant &devId );
125 void deleteDevice ( const int devId );125 void deleteDevice ( const QVariant &devId );
126 void createEmulatorImage ( const QString &name, const QString &arch, const QString &channel, const QString &passwd );126 void createEmulatorImage ( const QString &name, const QString &arch, const QString &channel, const QString &passwd );
127 void startEmulator ( const QString &name );127 void startEmulator ( const QString &name );
128 void stopEmulator ( const QString &name );128 void stopEmulator ( const QString &name );
129129
=== modified file 'src/ubuntu/ubuntufixmanifeststep.cpp'
--- src/ubuntu/ubuntufixmanifeststep.cpp 2015-02-16 12:27:25 +0000
+++ src/ubuntu/ubuntufixmanifeststep.cpp 2016-08-24 15:35:12 +0000
@@ -42,8 +42,9 @@
42 m_packageDir = packageDir;42 m_packageDir = packageDir;
43}43}
4444
45bool UbuntuFixManifestStep::init()45bool UbuntuFixManifestStep::init(QList<const BuildStep *> &earlierSteps)
46{46{
47 Q_UNUSED(earlierSteps);
47 return true;48 return true;
48}49}
4950
5051
=== modified file 'src/ubuntu/ubuntufixmanifeststep.h'
--- src/ubuntu/ubuntufixmanifeststep.h 2016-07-22 10:17:50 +0000
+++ src/ubuntu/ubuntufixmanifeststep.h 2016-08-24 15:35:12 +0000
@@ -18,7 +18,7 @@
18 void setPackageDir(const QString &packageDir);18 void setPackageDir(const QString &packageDir);
1919
20 // BuildStep interface20 // BuildStep interface
21 virtual bool init() override;21 virtual bool init(QList<const BuildStep *> &earlierSteps) override;
22 virtual void run(QFutureInterface<bool> &fi) override;22 virtual void run(QFutureInterface<bool> &fi) override;
23 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;23 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
2424
2525
=== modified file 'src/ubuntu/ubuntuhtmlbuildconfiguration.cpp'
--- src/ubuntu/ubuntuhtmlbuildconfiguration.cpp 2015-04-28 14:32:58 +0000
+++ src/ubuntu/ubuntuhtmlbuildconfiguration.cpp 2016-08-24 15:35:12 +0000
@@ -162,7 +162,8 @@
162 QList<ProjectExplorer::BuildInfo *> builds;162 QList<ProjectExplorer::BuildInfo *> builds;
163163
164 ProjectExplorer::BuildInfo *info = new ProjectExplorer::BuildInfo(this);164 ProjectExplorer::BuildInfo *info = new ProjectExplorer::BuildInfo(this);
165 info->buildDirectory = Utils::FileName::fromString(UbuntuProject::shadowBuildDirectory(projectDir,k,QStringLiteral("default")));165 QString sBd = UbuntuProject::shadowBuildDirectory(projectDir,k,QStringLiteral("default"), ProjectExplorer::BuildConfiguration::Unknown);
166 info->buildDirectory = Utils::FileName::fromString(sBd);
166 info->typeName = tr("Html5");167 info->typeName = tr("Html5");
167 info->kitId = k->id();168 info->kitId = k->id();
168 info->displayName = tr("Default");169 info->displayName = tr("Default");
169170
=== modified file 'src/ubuntu/ubuntukitmanager.cpp'
--- src/ubuntu/ubuntukitmanager.cpp 2016-05-17 16:33:36 +0000
+++ src/ubuntu/ubuntukitmanager.cpp 2016-08-24 15:35:12 +0000
@@ -20,7 +20,9 @@
20#include <qtsupport/qtkitinformation.h>20#include <qtsupport/qtkitinformation.h>
2121
22#include <cmakeprojectmanager/cmaketoolmanager.h>22#include <cmakeprojectmanager/cmaketoolmanager.h>
23#include <cmakeprojectmanager/cmaketool.h>
23#include <cmakeprojectmanager/cmakekitinformation.h>24#include <cmakeprojectmanager/cmakekitinformation.h>
25#include <cmakeprojectmanager/cmakeconfigitem.h>
24#include <qtsupport/qtversionmanager.h>26#include <qtsupport/qtversionmanager.h>
2527
26#include <QMessageBox>28#include <QMessageBox>
@@ -86,7 +88,7 @@
86 if(tc) {88 if(tc) {
87 if (!tc->isAutoDetected())89 if (!tc->isAutoDetected())
88 continue;90 continue;
89 if (tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))91 if (tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
90 continue;92 continue;
91 toolchains << static_cast<ClickToolChain *>(tc);93 toolchains << static_cast<ClickToolChain *>(tc);
92 }94 }
@@ -101,7 +103,7 @@
101 if (!tc)103 if (!tc)
102 return false;104 return false;
103105
104 if (tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))106 if (tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
105 return false;107 return false;
106108
107 ClickToolChain *cTc = static_cast<ClickToolChain *>(tc);109 ClickToolChain *cTc = static_cast<ClickToolChain *>(tc);
@@ -127,7 +129,7 @@
127 }129 }
128 }130 }
129131
130 UbuntuQtVersion *qtVersion = new UbuntuQtVersion(Utils::FileName::fromString(qmakePath),false);132 UbuntuQtVersion *qtVersion = new UbuntuQtVersion(tc->clickTarget().containerName, Utils::FileName::fromString(qmakePath),false);
131 QtSupport::QtVersionManager::addVersion(qtVersion);133 QtSupport::QtVersionManager::addVersion(qtVersion);
132 return qtVersion;134 return qtVersion;
133}135}
@@ -159,7 +161,8 @@
159{161{
160 QString cmakePathStr = UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("cmake"), target);162 QString cmakePathStr = UbuntuClickTool::findOrCreateToolWrapper(QStringLiteral("cmake"), target);
161 Utils::FileName cmakePath = Utils::FileName::fromString(cmakePathStr);163 Utils::FileName cmakePath = Utils::FileName::fromString(cmakePathStr);
162 CMakeProjectManager::CMakeTool *cmake = new CMakeProjectManager::CMakeTool(CMakeProjectManager::CMakeTool::AutoDetection);164 CMakeProjectManager::CMakeTool *cmake = new CMakeProjectManager::CMakeTool(CMakeProjectManager::CMakeTool::AutoDetection,
165 CMakeProjectManager::CMakeTool::createId());
163166
164 cmake->setCMakeExecutable(cmakePath);167 cmake->setCMakeExecutable(cmakePath);
165 cmake->setDisplayName(tr("Ubuntu SDK cmake (%1-%2-%3)")168 cmake->setDisplayName(tr("Ubuntu SDK cmake (%1-%2-%3)")
@@ -322,7 +325,7 @@
322 continue;325 continue;
323326
324 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);327 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
325 if (tc && tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID))328 if (tc && tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
326 continue;329 continue;
327330
328 //@TODO check for ubuntu device information331 //@TODO check for ubuntu device information
@@ -364,7 +367,7 @@
364 foreach (ProjectExplorer::Kit *k, existingKits) {367 foreach (ProjectExplorer::Kit *k, existingKits) {
365 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);368 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
366 CMakeProjectManager::CMakeTool* cmake = CMakeProjectManager::CMakeKitInformation::cmakeTool(k);369 CMakeProjectManager::CMakeTool* cmake = CMakeProjectManager::CMakeKitInformation::cmakeTool(k);
367 if (tc && tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)370 if (tc && tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID
368 && cmake371 && cmake
369 && cmake->isValid()) {372 && cmake->isValid()) {
370 fixKit(k);373 fixKit(k);
@@ -562,13 +565,20 @@
562 k->setMutable(ProjectExplorer::SysRootKitInformation::id(),false);565 k->setMutable(ProjectExplorer::SysRootKitInformation::id(),false);
563566
564 //make sure we use a ubuntu Qt version567 //make sure we use a ubuntu Qt version
565 QtSupport::QtKitInformation::setQtVersion(k, createOrFindQtVersion(tc));568 UbuntuQtVersion *qtVer = createOrFindQtVersion(tc);
569 QtSupport::QtKitInformation::setQtVersion(k, qtVer);
566570
567 //make sure we use a ubuntu cmake571 //make sure we use a ubuntu cmake
568 CMakeProjectManager::CMakeTool *cmake = createOrFindCMakeTool(tc);572 CMakeProjectManager::CMakeTool *cmake = createOrFindCMakeTool(tc);
569 if(cmake) {573 if(cmake) {
574 CMakeProjectManager::CMakeConfig conf{
575 CMakeProjectManager::CMakeConfigItem("QT_QMAKE_EXECUTABLE", qtVer->remoteQMakeCommand().toUtf8()),
576 CMakeProjectManager::CMakeConfigItem("CMAKE_CXX_COMPILER", tc->remoteCompilerCommand().toUtf8())
577 };
578
570 cmake->setPathMapper(&UbuntuClickTool::mapIncludePathsForCMake);579 cmake->setPathMapper(&UbuntuClickTool::mapIncludePathsForCMake);
571 CMakeProjectManager::CMakeKitInformation::setCMakeTool(k, cmake->id());580 CMakeProjectManager::CMakeKitInformation::setCMakeTool(k, cmake->id());
581 CMakeProjectManager::CMakeConfigurationKitInformation::setConfiguration(k , conf);
572 }582 }
573583
574}584}
575585
=== modified file 'src/ubuntu/ubuntumenu.cpp'
--- src/ubuntu/ubuntumenu.cpp 2016-03-29 09:41:07 +0000
+++ src/ubuntu/ubuntumenu.cpp 2016-08-24 15:35:12 +0000
@@ -116,7 +116,7 @@
116 isClickTarget = startupProject->activeTarget()116 isClickTarget = startupProject->activeTarget()
117 && startupProject->activeTarget()->kit()117 && startupProject->activeTarget()->kit()
118 && ProjectExplorer::ToolChainKitInformation::toolChain(startupProject->activeTarget()->kit())118 && ProjectExplorer::ToolChainKitInformation::toolChain(startupProject->activeTarget()->kit())
119 && ProjectExplorer::ToolChainKitInformation::toolChain(startupProject->activeTarget()->kit())->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID);119 && ProjectExplorer::ToolChainKitInformation::toolChain(startupProject->activeTarget()->kit())->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID;
120 }120 }
121121
122 //bool canRun = projectExplorerInstance->canRun(startupProject,ProjectExplorer::NormalRunMode);122 //bool canRun = projectExplorerInstance->canRun(startupProject,ProjectExplorer::NormalRunMode);
123123
=== modified file 'src/ubuntu/ubuntupackagestep.cpp'
--- src/ubuntu/ubuntupackagestep.cpp 2015-11-27 10:06:33 +0000
+++ src/ubuntu/ubuntupackagestep.cpp 2016-08-24 15:35:12 +0000
@@ -77,8 +77,9 @@
77 cleanup();77 cleanup();
78}78}
7979
80bool UbuntuPackageStep::init()80bool UbuntuPackageStep::init(QList<const BuildStep *> &earlierSteps)
81{81{
82 Q_UNUSED(earlierSteps);
82 //initialization happens in internalInit,83 //initialization happens in internalInit,
83 //because it requires informations that are only available at this84 //because it requires informations that are only available at this
84 //time85 //time
@@ -277,8 +278,9 @@
277 }278 }
278 emit addOutput(tr("Configuration is invalid. Aborting build")279 emit addOutput(tr("Configuration is invalid. Aborting build")
279 ,ProjectExplorer::BuildStep::MessageOutput);280 ,ProjectExplorer::BuildStep::MessageOutput);
280 fi.reportResult(false);281
281 emit finished();282 reportRunResult(fi, false);
283 cleanup();
282 return;284 return;
283 }285 }
284286
@@ -487,9 +489,9 @@
487489
488 //the process failed, lets clean up490 //the process failed, lets clean up
489 if (!success) {491 if (!success) {
490 m_futureInterface->reportResult(false);492 if(m_futureInterface)
493 reportRunResult(*m_futureInterface, false);
491 cleanup();494 cleanup();
492 emit finished();
493 }495 }
494 return success;496 return success;
495}497}
@@ -572,9 +574,9 @@
572 .arg(m_deployDir),574 .arg(m_deployDir),
573 BuildStep::ErrorMessageOutput);575 BuildStep::ErrorMessageOutput);
574576
575 m_futureInterface->reportResult(false);577 if(m_futureInterface)
578 reportRunResult(*m_futureInterface, false);
576 cleanup();579 cleanup();
577 emit finished();
578 return;580 return;
579 }581 }
580582
@@ -584,9 +586,9 @@
584 .arg(err),586 .arg(err),
585 BuildStep::ErrorMessageOutput);587 BuildStep::ErrorMessageOutput);
586588
587 m_futureInterface->reportResult(false);589 if(m_futureInterface)
590 reportRunResult(*m_futureInterface, false);
588 cleanup();591 cleanup();
589 emit finished();
590 return;592 return;
591 }593 }
592594
@@ -623,7 +625,7 @@
623 continue;625 continue;
624626
625 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());627 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
626 if(!tc || tc->type() != QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {628 if(!tc || tc->typeId() != Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
627 qWarning()<<"Incompatible Toolchain for hook"<<hook.appId;629 qWarning()<<"Incompatible Toolchain for hook"<<hook.appId;
628 continue;630 continue;
629 }631 }
@@ -745,9 +747,9 @@
745747
746 if (m_packageMode == OnlyMakeInstall) {748 if (m_packageMode == OnlyMakeInstall) {
747749
748 m_futureInterface->reportResult(true);750 if(m_futureInterface)
751 reportRunResult(*m_futureInterface, true);
749 cleanup();752 cleanup();
750 emit finished();
751753
752 return;754 return;
753 }755 }
@@ -772,7 +774,7 @@
772 if (!processFinished())774 if (!processFinished())
773 return;775 return;
774776
775 QRegularExpression exp(QLatin1String(Constants::UBUNTU_CLICK_SUCCESS_PACKAGE_REGEX));777 QRegularExpression exp((QLatin1String(Constants::UBUNTU_CLICK_SUCCESS_PACKAGE_REGEX)));
776 QRegularExpressionMatch m = exp.match(m_lastLine);778 QRegularExpressionMatch m = exp.match(m_lastLine);
777 if(m.hasMatch()) {779 if(m.hasMatch()) {
778 m_clickPackageName = m.captured(1);780 m_clickPackageName = m.captured(1);
@@ -794,9 +796,9 @@
794 if (!processFinished(IgnoreReturnCode))796 if (!processFinished(IgnoreReturnCode))
795 return;797 return;
796798
797 m_futureInterface->reportResult(true);799 if(m_futureInterface)
800 reportRunResult(*m_futureInterface, true);
798 cleanup();801 cleanup();
799 emit finished();
800 }802 }
801803
802 default:804 default:
@@ -824,7 +826,8 @@
824826
825void UbuntuPackageStep::onProcessFailedToStart()827void UbuntuPackageStep::onProcessFailedToStart()
826{828{
827 m_futureInterface->reportResult(false);829 if(m_futureInterface)
830 reportRunResult(*m_futureInterface, false);
828831
829 ProjectExplorer::ProcessParameters *params;832 ProjectExplorer::ProcessParameters *params;
830 if (m_state == MakeInstall)833 if (m_state == MakeInstall)
@@ -837,7 +840,6 @@
837 params->prettyArguments()),840 params->prettyArguments()),
838 BuildStep::ErrorMessageOutput);841 BuildStep::ErrorMessageOutput);
839842
840 emit finished();
841 cleanup();843 cleanup();
842844
843}845}
844846
=== modified file 'src/ubuntu/ubuntupackagestep.h'
--- src/ubuntu/ubuntupackagestep.h 2015-07-08 15:38:37 +0000
+++ src/ubuntu/ubuntupackagestep.h 2016-08-24 15:35:12 +0000
@@ -55,7 +55,7 @@
5555
56public:56public:
57 // BuildStep interface57 // BuildStep interface
58 virtual bool init() override;58 virtual bool init(QList<const ProjectExplorer::BuildStep *> &earlierSteps) override;
59 virtual void run(QFutureInterface<bool> &fi) override;59 virtual void run(QFutureInterface<bool> &fi) override;
60 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;60 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
61 virtual bool immutable() const override;61 virtual bool immutable() const override;
6262
=== modified file 'src/ubuntu/ubuntupackagingmode.cpp'
--- src/ubuntu/ubuntupackagingmode.cpp 2015-03-03 17:23:52 +0000
+++ src/ubuntu/ubuntupackagingmode.cpp 2016-08-24 15:35:12 +0000
@@ -80,8 +80,6 @@
80 m_modeView->rootContext()->setContextProperty(QLatin1String("resourceRoot") ,Constants::UBUNTU_DEVICESCREEN_ROOT);80 m_modeView->rootContext()->setContextProperty(QLatin1String("resourceRoot") ,Constants::UBUNTU_DEVICESCREEN_ROOT);
81 m_modeView->setSource(QUrl::fromLocalFile(Constants::UBUNTU_PUBLISHSCREEN_QML));81 m_modeView->setSource(QUrl::fromLocalFile(Constants::UBUNTU_PUBLISHSCREEN_QML));
8282
83 connect(Core::ModeManager::instance(), SIGNAL(currentModeChanged(Core::IMode*)), SLOT(modeChanged(Core::IMode*)));
84
85 QObject* sessionManager = ProjectExplorer::SessionManager::instance();83 QObject* sessionManager = ProjectExplorer::SessionManager::instance();
86 connect(sessionManager,SIGNAL(projectAdded(ProjectExplorer::Project*)),SLOT(on_projectAdded(ProjectExplorer::Project*)));84 connect(sessionManager,SIGNAL(projectAdded(ProjectExplorer::Project*)),SLOT(on_projectAdded(ProjectExplorer::Project*)));
87 connect(sessionManager,SIGNAL(projectRemoved(ProjectExplorer::Project*)),SLOT(on_projectRemoved(ProjectExplorer::Project*)));85 connect(sessionManager,SIGNAL(projectRemoved(ProjectExplorer::Project*)),SLOT(on_projectRemoved(ProjectExplorer::Project*)));
@@ -95,10 +93,6 @@
9593
96}94}
9795
98void UbuntuPackagingMode::modeChanged(Core::IMode* currentMode) {
99 previousMode = currentMode->id();
100}
101
102void UbuntuPackagingMode::updateModeState() {96void UbuntuPackagingMode::updateModeState() {
103 ProjectExplorer::Project* startupProject = ProjectExplorer::SessionManager::startupProject();97 ProjectExplorer::Project* startupProject = ProjectExplorer::SessionManager::startupProject();
10498
10599
=== modified file 'src/ubuntu/ubuntupackagingmode.h'
--- src/ubuntu/ubuntupackagingmode.h 2015-01-29 07:49:13 +0000
+++ src/ubuntu/ubuntupackagingmode.h 2016-08-24 15:35:12 +0000
@@ -40,15 +40,12 @@
40 void initialize();40 void initialize();
4141
42protected slots:42protected slots:
43 void modeChanged(Core::IMode*);
44
45 void on_projectAdded(ProjectExplorer::Project *project);43 void on_projectAdded(ProjectExplorer::Project *project);
46 void on_projectRemoved(ProjectExplorer::Project *project);44 void on_projectRemoved(ProjectExplorer::Project *project);
47 void updateModeState();45 void updateModeState();
4846
49protected:47protected:
50 QWidget* m_modeWidget;48 QWidget* m_modeWidget;
51 Core::Id previousMode;
5249
53private:50private:
54 static UbuntuPackagingMode* m_instance;51 static UbuntuPackagingMode* m_instance;
5552
=== modified file 'src/ubuntu/ubuntupackagingmodel.cpp'
--- src/ubuntu/ubuntupackagingmodel.cpp 2016-07-06 09:18:16 +0000
+++ src/ubuntu/ubuntupackagingmodel.cpp 2016-08-24 15:35:12 +0000
@@ -404,7 +404,7 @@
404 p->activeTarget() &&404 p->activeTarget() &&
405 p->activeTarget()->kit() &&405 p->activeTarget()->kit() &&
406 ProjectExplorer::ToolChainKitInformation::toolChain(p->activeTarget()->kit()) &&406 ProjectExplorer::ToolChainKitInformation::toolChain(p->activeTarget()->kit()) &&
407 (ProjectExplorer::ToolChainKitInformation::toolChain(p->activeTarget()->kit())->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)407 (ProjectExplorer::ToolChainKitInformation::toolChain(p->activeTarget()->kit())->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID
408 || p->projectManager()->mimeType() == QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE));408 || p->projectManager()->mimeType() == QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE));
409409
410 setCanBuild(buildButtonsEnabled);410 setCanBuild(buildButtonsEnabled);
@@ -467,7 +467,7 @@
467 m_packageBuildSteps.append(QSharedPointer<ProjectExplorer::BuildStepList> (new ProjectExplorer::BuildStepList(b,ProjectExplorer::Constants::BUILDSTEPS_BUILD)));467 m_packageBuildSteps.append(QSharedPointer<ProjectExplorer::BuildStepList> (new ProjectExplorer::BuildStepList(b,ProjectExplorer::Constants::BUILDSTEPS_BUILD)));
468468
469 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(b->target()->kit());469 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(b->target()->kit());
470 if(tc && tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)){470 if(tc && tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID){
471 ClickToolChain *cTc = static_cast<ClickToolChain *>(tc);471 ClickToolChain *cTc = static_cast<ClickToolChain *>(tc);
472 usedArchitectures << cTc->clickTarget().architecture;472 usedArchitectures << cTc->clickTarget().architecture;
473 }473 }
474474
=== modified file 'src/ubuntu/ubuntuplugin.cpp'
--- src/ubuntu/ubuntuplugin.cpp 2016-07-07 09:11:32 +0000
+++ src/ubuntu/ubuntuplugin.cpp 2016-08-24 15:35:12 +0000
@@ -161,8 +161,8 @@
161 addAutoReleasedObject(new UbuntuSettingsProjectDefaultsPage);161 addAutoReleasedObject(new UbuntuSettingsProjectDefaultsPage);
162 addAutoReleasedObject(new UbuntuSettingsDeviceConnectivityPage);162 addAutoReleasedObject(new UbuntuSettingsDeviceConnectivityPage);
163163
164 addAutoReleasedObject(new UbuntuVersionManager);164 //addAutoReleasedObject(new UbuntuVersionManager);
165 Core::IWizardFactory::registerFeatureProvider(new UbuntuFeatureProvider);165 //Core::IWizardFactory::registerFeatureProvider(new UbuntuFeatureProvider);
166166
167 // welcome page plugin167 // welcome page plugin
168 addAutoReleasedObject(new UbuntuWelcomePage);168 addAutoReleasedObject(new UbuntuWelcomePage);
169169
=== modified file 'src/ubuntu/ubuntuplugin.h'
--- src/ubuntu/ubuntuplugin.h 2016-05-30 08:28:41 +0000
+++ src/ubuntu/ubuntuplugin.h 2016-08-24 15:35:12 +0000
@@ -24,7 +24,6 @@
24#include "ubuntudevicemode.h"24#include "ubuntudevicemode.h"
25#include "ubuntumenu.h"25#include "ubuntumenu.h"
26#include "ubuntuprojectmanager.h"26#include "ubuntuprojectmanager.h"
27#include "ubuntufeatureprovider.h"
28#include "ubuntuversionmanager.h"27#include "ubuntuversionmanager.h"
29#include "ubuntupackagingmode.h"28#include "ubuntupackagingmode.h"
30#include "ubuntusettingsdeviceconnectivitypage.h"29#include "ubuntusettingsdeviceconnectivitypage.h"
3130
=== modified file 'src/ubuntu/ubuntuproject.cpp'
--- src/ubuntu/ubuntuproject.cpp 2016-05-12 06:50:19 +0000
+++ src/ubuntu/ubuntuproject.cpp 2016-08-24 15:35:12 +0000
@@ -36,7 +36,6 @@
3636
37 setId(Constants::UBUNTUPROJECT_ID);37 setId(Constants::UBUNTUPROJECT_ID);
38 setRequiredKitMatcher(UbuntuKitMatcher());38 setRequiredKitMatcher(UbuntuKitMatcher());
39 setPreferredKitMatcher(QtSupport::QtKitInformation::qtVersionMatcher(Core::FeatureSet(QtSupport::Constants::FEATURE_DESKTOP)));
4039
41 setProjectContext(Core::Context(Constants::UBUNTUPROJECT_PROJECTCONTEXT));40 setProjectContext(Core::Context(Constants::UBUNTUPROJECT_PROJECTCONTEXT));
4241
@@ -46,6 +45,7 @@
46 m_file = QSharedPointer<UbuntuProjectFile>(new UbuntuProjectFile(this, fileName));45 m_file = QSharedPointer<UbuntuProjectFile>(new UbuntuProjectFile(this, fileName));
4746
48 Core::DocumentManager::addDocument(m_file.data(), true);47 Core::DocumentManager::addDocument(m_file.data(), true);
48 setDocument(m_file.data());
4949
50 m_rootNode = QSharedPointer<UbuntuProjectNode>(new UbuntuProjectNode(this, m_file.data()));50 m_rootNode = QSharedPointer<UbuntuProjectNode>(new UbuntuProjectNode(this, m_file.data()));
51 m_manager->registerProject(this);51 m_manager->registerProject(this);
@@ -82,10 +82,6 @@
82 return m_projectName;82 return m_projectName;
83}83}
8484
85Core::IDocument *UbuntuProject::document() const {
86 return m_file.data();
87}
88
89ProjectExplorer::IProjectManager *UbuntuProject::projectManager() const {85ProjectExplorer::IProjectManager *UbuntuProject::projectManager() const {
90 return m_manager;86 return m_manager;
91}87}
@@ -137,7 +133,10 @@
137 return true;133 return true;
138}134}
139135
140QString UbuntuProject::shadowBuildDirectory(const QString &proFilePath, const ProjectExplorer::Kit *k, const QString &suffix)136QString UbuntuProject::shadowBuildDirectory(const QString &proFilePath
137 , const ProjectExplorer::Kit *k
138 , const QString &suffix
139 , const ProjectExplorer::BuildConfiguration::BuildType buildType)
141{140{
142 if (proFilePath.isEmpty())141 if (proFilePath.isEmpty())
143 return QString();142 return QString();
@@ -149,7 +148,7 @@
149 return info.absolutePath();148 return info.absolutePath();
150149
151 const QString projectName = QFileInfo(proFilePath).completeBaseName();150 const QString projectName = QFileInfo(proFilePath).completeBaseName();
152 ProjectExplorer::ProjectMacroExpander expander(projectName, k, suffix);151 ProjectExplorer::ProjectMacroExpander expander(proFilePath, projectName, k, suffix, buildType);
153 QDir projectDir = QDir(projectDirectory(Utils::FileName::fromString(proFilePath)).toString());152 QDir projectDir = QDir(projectDirectory(Utils::FileName::fromString(proFilePath)).toString());
154 QString buildPath = expander.expand(Core::DocumentManager::buildDirectory());153 QString buildPath = expander.expand(Core::DocumentManager::buildDirectory());
155 return QDir::cleanPath(projectDir.absoluteFilePath(buildPath));154 return QDir::cleanPath(projectDir.absoluteFilePath(buildPath));
@@ -164,7 +163,7 @@
164bool UbuntuKitMatcher::matches(const ProjectExplorer::Kit *k)163bool UbuntuKitMatcher::matches(const ProjectExplorer::Kit *k)
165{164{
166 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);165 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
167 if (tc->type() == QLatin1String(Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID))166 if (tc->typeId() == Ubuntu::Constants::UBUNTU_CLICK_TOOLCHAIN_ID)
168 return true;167 return true;
169168
170 return false;169 return false;
171170
=== modified file 'src/ubuntu/ubuntuproject.h'
--- src/ubuntu/ubuntuproject.h 2015-03-03 17:23:52 +0000
+++ src/ubuntu/ubuntuproject.h 2016-08-24 15:35:12 +0000
@@ -42,6 +42,7 @@
42#include <projectexplorer/session.h>42#include <projectexplorer/session.h>
43#include <projectexplorer/runconfiguration.h>43#include <projectexplorer/runconfiguration.h>
44#include <projectexplorer/applicationlauncher.h>44#include <projectexplorer/applicationlauncher.h>
45#include <projectexplorer/buildconfiguration.h>
4546
46namespace Ubuntu {47namespace Ubuntu {
47namespace Internal {48namespace Internal {
@@ -65,7 +66,6 @@
65 UbuntuProject(UbuntuProjectManager *manager, const QString &fileName);66 UbuntuProject(UbuntuProjectManager *manager, const QString &fileName);
6667
67 QString displayName() const override;68 QString displayName() const override;
68 Core::IDocument *document() const override;
69 ProjectExplorer::IProjectManager *projectManager() const override;69 ProjectExplorer::IProjectManager *projectManager() const override;
7070
71 ProjectExplorer::ProjectNode *rootProjectNode() const override;71 ProjectExplorer::ProjectNode *rootProjectNode() const override;
@@ -88,7 +88,9 @@
88 bool needsConfiguration() const override;88 bool needsConfiguration() const override;
89 bool requiresTargetPanel() const override;89 bool requiresTargetPanel() const override;
9090
91 static QString shadowBuildDirectory(const QString &proFilePath, const ProjectExplorer::Kit *k, const QString &suffix = QString());91 static QString shadowBuildDirectory(const QString &proFilePath, const ProjectExplorer::Kit *k,
92 const QString &suffix = QString(),
93 const ProjectExplorer::BuildConfiguration::BuildType buildType = ProjectExplorer::BuildConfiguration::Unknown);
92private:94private:
93 void extractProjectFileData(const QString& filename);95 void extractProjectFileData(const QString& filename);
9496
9597
=== modified file 'src/ubuntu/ubuntuprojectfile.cpp'
--- src/ubuntu/ubuntuprojectfile.cpp 2015-03-03 17:23:52 +0000
+++ src/ubuntu/ubuntuprojectfile.cpp 2016-08-24 15:35:12 +0000
@@ -34,14 +34,6 @@
34 return false;34 return false;
35}35}
3636
37QString UbuntuProjectFile::defaultPath() const {
38 return QString();
39}
40
41QString UbuntuProjectFile::suggestedFileName() const {
42 return QString();
43}
44
45bool UbuntuProjectFile::isModified() const {37bool UbuntuProjectFile::isModified() const {
46 return false;38 return false;
47}39}
4840
=== modified file 'src/ubuntu/ubuntuprojectfile.h'
--- src/ubuntu/ubuntuprojectfile.h 2015-03-03 17:23:52 +0000
+++ src/ubuntu/ubuntuprojectfile.h 2016-08-24 15:35:12 +0000
@@ -47,10 +47,6 @@
47 ~UbuntuProjectFile() {}47 ~UbuntuProjectFile() {}
4848
49 bool save(QString *errorString, const QString &fileName, bool autoSave) override;49 bool save(QString *errorString, const QString &fileName, bool autoSave) override;
50
51 QString defaultPath() const override;
52 QString suggestedFileName() const override;
53
54 bool isModified() const override;50 bool isModified() const override;
55 bool isSaveAsAllowed() const override;51 bool isSaveAsAllowed() const override;
5652
5753
=== modified file 'src/ubuntu/ubuntuprojectnode.cpp'
--- src/ubuntu/ubuntuprojectnode.cpp 2015-03-03 17:23:52 +0000
+++ src/ubuntu/ubuntuprojectnode.cpp 2016-08-24 15:35:12 +0000
@@ -87,7 +87,7 @@
87 if (! end)87 if (! end)
88 return 0;88 return 0;
8989
90 QString baseDir = path().toFileInfo().path();90 QString baseDir = filePath().toFileInfo().path();
9191
92 QString folderName;92 QString folderName;
93 for (int i = 0; i < end; ++i) {93 for (int i = 0; i < end; ++i) {
9494
=== modified file 'src/ubuntu/ubuntuqmlbuildconfiguration.cpp'
--- src/ubuntu/ubuntuqmlbuildconfiguration.cpp 2015-04-28 14:47:49 +0000
+++ src/ubuntu/ubuntuqmlbuildconfiguration.cpp 2016-08-24 15:35:12 +0000
@@ -11,6 +11,7 @@
11#include <projectexplorer/kitinformation.h>11#include <projectexplorer/kitinformation.h>
12#include <projectexplorer/buildsteplist.h>12#include <projectexplorer/buildsteplist.h>
13#include <utils/fancylineedit.h>13#include <utils/fancylineedit.h>
14#include <utils/algorithm.h>
14#include <utils/mimetypes/mimedatabase.h>15#include <utils/mimetypes/mimedatabase.h>
15#include <qmlprojectmanager/qmlprojectconstants.h>16#include <qmlprojectmanager/qmlprojectconstants.h>
1617
@@ -184,7 +185,11 @@
184 QList<ProjectExplorer::BuildInfo *> builds;185 QList<ProjectExplorer::BuildInfo *> builds;
185186
186 ProjectExplorer::BuildInfo *info = new ProjectExplorer::BuildInfo(this);187 ProjectExplorer::BuildInfo *info = new ProjectExplorer::BuildInfo(this);
187 info->buildDirectory = Utils::FileName::fromString(UbuntuProject::shadowBuildDirectory(projectDir,k,QStringLiteral("default")));188 info->buildDirectory = Utils::FileName::fromString(UbuntuProject::shadowBuildDirectory(
189 projectDir,
190 k,
191 QStringLiteral("default"),
192 ProjectExplorer::BuildConfiguration::Unknown));
188 info->typeName = tr("Qml");193 info->typeName = tr("Qml");
189 info->kitId = k->id();194 info->kitId = k->id();
190 info->displayName = tr("Default");195 info->displayName = tr("Default");
@@ -231,8 +236,9 @@
231 : AbstractProcessStep(bsl,bs)236 : AbstractProcessStep(bsl,bs)
232{}237{}
233238
234bool UbuntuQmlUpdateTranslationTemplateStep::init()239bool UbuntuQmlUpdateTranslationTemplateStep::init(QList<const BuildStep *> &earlierSteps)
235{240{
241 Q_UNUSED(earlierSteps);
236 QString projectDir = target()->project()->projectDirectory().toString();242 QString projectDir = target()->project()->projectDirectory().toString();
237243
238 ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();244 ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();
@@ -269,9 +275,9 @@
269 : UbuntuQmlUpdateTranslationTemplateStep(bsl,bs)275 : UbuntuQmlUpdateTranslationTemplateStep(bsl,bs)
270{}276{}
271277
272bool UbuntuQmlBuildTranslationStep::init()278bool UbuntuQmlBuildTranslationStep::init(QList<const BuildStep *> &earlierSteps)
273{279{
274 if(!UbuntuQmlUpdateTranslationTemplateStep::init())280 if(!UbuntuQmlUpdateTranslationTemplateStep::init(earlierSteps))
275 return false;281 return false;
276282
277 ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();283 ProjectExplorer::BuildConfiguration *bc = target()->activeBuildConfiguration();
@@ -303,36 +309,35 @@
303 return UbuntuQmlUpdateTranslationTemplateStep::run(fi);309 return UbuntuQmlUpdateTranslationTemplateStep::run(fi);
304}310}
305311
306QList<Core::Id> UbuntuQmlBuildStepFactory::availableCreationIds(ProjectExplorer::BuildStepList *parent) const312bool UbuntuQmlBuildStepFactory::canHandle(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
307{313{
314 return Utils::contains(availableSteps(parent), Utils::equal(&ProjectExplorer::BuildStepInfo::id, id));
315}
316
317QList<ProjectExplorer::BuildStepInfo> UbuntuQmlBuildStepFactory::availableSteps(ProjectExplorer::BuildStepList *parent) const
318{
319 QList<ProjectExplorer::BuildStepInfo> res;
320
308 if(parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD)321 if(parent->id() != ProjectExplorer::Constants::BUILDSTEPS_BUILD)
309 return QList<Core::Id>();322 return res;
310323
311 UbuntuKitMatcher m;324 UbuntuKitMatcher m;
312 if(!m.matches(parent->target()->kit())325 if(!m.matches(parent->target()->kit())
313 || parent->target()->project()->id() != "QmlProjectManager.QmlProject")326 || parent->target()->project()->id() != "QmlProjectManager.QmlProject")
314 return QList<Core::Id>();327 return res;
315328
316 return QList<Core::Id>()<<Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP<<Constants::UBUNTU_CLICK_QML_UPDATE_TRANSL_MAKESTEP;329 res << ProjectExplorer::BuildStepInfo(Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP,
317}330 tr("Build translations"),
318331 ProjectExplorer::BuildStepInfo::UniqueStep)
319QString UbuntuQmlBuildStepFactory::displayNameForId(const Core::Id id) const332 << ProjectExplorer::BuildStepInfo(Constants::UBUNTU_CLICK_QML_UPDATE_TRANSL_MAKESTEP,
320{333 tr("Update translations template"),
321 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)334 ProjectExplorer::BuildStepInfo::UniqueStep);
322 return tr("Build translations");335 return res;
323 else if(id == Constants::UBUNTU_CLICK_QML_UPDATE_TRANSL_MAKESTEP)
324 return tr("Update translations template");
325 return QString();
326}
327
328bool UbuntuQmlBuildStepFactory::canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const
329{
330 return availableCreationIds(parent).contains(id);
331}336}
332337
333ProjectExplorer::BuildStep *UbuntuQmlBuildStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)338ProjectExplorer::BuildStep *UbuntuQmlBuildStepFactory::create(ProjectExplorer::BuildStepList *parent, const Core::Id id)
334{339{
335 QTC_ASSERT(canCreate(parent,id),return 0);340 QTC_ASSERT(canHandle(parent,id),return 0);
336341
337 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)342 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)
338 return new UbuntuQmlBuildTranslationStep(parent);343 return new UbuntuQmlBuildTranslationStep(parent);
@@ -342,18 +347,13 @@
342 return nullptr;347 return nullptr;
343}348}
344349
345bool UbuntuQmlBuildStepFactory::canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const
346{
347 return availableCreationIds(parent).contains(ProjectExplorer::idFromMap(map));
348}
349
350ProjectExplorer::BuildStep *UbuntuQmlBuildStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)350ProjectExplorer::BuildStep *UbuntuQmlBuildStepFactory::restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map)
351{351{
352 QTC_ASSERT(canRestore(parent,map),return 0);
353
354 ProjectExplorer::AbstractProcessStep *step = 0;352 ProjectExplorer::AbstractProcessStep *step = 0;
355 Core::Id id = ProjectExplorer::idFromMap(map);353 Core::Id id = ProjectExplorer::idFromMap(map);
356354
355 QTC_ASSERT(canHandle(parent,id),return 0);
356
357 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)357 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)
358 step = new UbuntuQmlBuildTranslationStep(parent);358 step = new UbuntuQmlBuildTranslationStep(parent);
359 else if(id == Constants::UBUNTU_CLICK_QML_UPDATE_TRANSL_MAKESTEP)359 else if(id == Constants::UBUNTU_CLICK_QML_UPDATE_TRANSL_MAKESTEP)
@@ -369,14 +369,9 @@
369 return step;369 return step;
370}370}
371371
372bool UbuntuQmlBuildStepFactory::canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const
373{
374 return availableCreationIds(parent).contains(product->id());
375}
376
377ProjectExplorer::BuildStep *UbuntuQmlBuildStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)372ProjectExplorer::BuildStep *UbuntuQmlBuildStepFactory::clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product)
378{373{
379 QTC_ASSERT(canClone(parent,product),return 0);374 QTC_ASSERT(canHandle(parent,product->id()),return 0);
380375
381 const Core::Id id = product->id();376 const Core::Id id = product->id();
382 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)377 if(id == Constants::UBUNTU_CLICK_QML_BUILD_TRANSL_MAKESTEP)
383378
=== modified file 'src/ubuntu/ubuntuqmlbuildconfiguration.h'
--- src/ubuntu/ubuntuqmlbuildconfiguration.h 2016-07-22 10:17:50 +0000
+++ src/ubuntu/ubuntuqmlbuildconfiguration.h 2016-08-24 15:35:12 +0000
@@ -57,7 +57,7 @@
57 UbuntuQmlUpdateTranslationTemplateStep(ProjectExplorer::BuildStepList *bsl, UbuntuQmlUpdateTranslationTemplateStep *bs);57 UbuntuQmlUpdateTranslationTemplateStep(ProjectExplorer::BuildStepList *bsl, UbuntuQmlUpdateTranslationTemplateStep *bs);
5858
59 // BuildStep interface59 // BuildStep interface
60 virtual bool init() override;60 virtual bool init(QList<const BuildStep *> &earlierSteps) override;
61 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;61 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
6262
63 QString makeCommand(ProjectExplorer::ToolChain *tc, const Utils::Environment &env) const;63 QString makeCommand(ProjectExplorer::ToolChain *tc, const Utils::Environment &env) const;
@@ -71,7 +71,7 @@
71 UbuntuQmlBuildTranslationStep(ProjectExplorer::BuildStepList *bsl, UbuntuQmlBuildTranslationStep *bs);71 UbuntuQmlBuildTranslationStep(ProjectExplorer::BuildStepList *bsl, UbuntuQmlBuildTranslationStep *bs);
7272
73 // BuildStep interface73 // BuildStep interface
74 virtual bool init() override;74 virtual bool init(QList<const BuildStep *> &earlierSteps) override;
75 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;75 virtual ProjectExplorer::BuildStepConfigWidget *createConfigWidget() override;
76 void run(QFutureInterface<bool> &fi) override;76 void run(QFutureInterface<bool> &fi) override;
7777
@@ -107,14 +107,14 @@
107107
108public:108public:
109 // IBuildStepFactory interface109 // IBuildStepFactory interface
110 virtual QList<Core::Id> availableCreationIds(ProjectExplorer::BuildStepList *parent) const override;110 virtual QList<ProjectExplorer::BuildStepInfo> availableSteps(ProjectExplorer::BuildStepList *parent) const override;
111 virtual QString displayNameForId(const Core::Id id) const override;
112 virtual bool canCreate(ProjectExplorer::BuildStepList *parent, const Core::Id id) const override;
113 virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) override;111 virtual ProjectExplorer::BuildStep *create(ProjectExplorer::BuildStepList *parent, const Core::Id id) override;
114 virtual bool canRestore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) const override;
115 virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override;112 virtual ProjectExplorer::BuildStep *restore(ProjectExplorer::BuildStepList *parent, const QVariantMap &map) override;
116 virtual bool canClone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) const override;
117 virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) override;113 virtual ProjectExplorer::BuildStep *clone(ProjectExplorer::BuildStepList *parent, ProjectExplorer::BuildStep *product) override;
114
115private:
116 bool canHandle(ProjectExplorer::BuildStepList *parent, const Core::Id id) const;
117
118};118};
119119
120} // namespace Internal120} // namespace Internal
121121
=== modified file 'src/ubuntu/ubuntuqtversion.cpp'
--- src/ubuntu/ubuntuqtversion.cpp 2016-03-22 13:32:33 +0000
+++ src/ubuntu/ubuntuqtversion.cpp 2016-08-24 15:35:12 +0000
@@ -2,16 +2,20 @@
2#include "ubuntuconstants.h"2#include "ubuntuconstants.h"
3#include "settings.h"3#include "settings.h"
44
5#include <ubuntu/device/container/containerdevice.h>
6#include <ubuntu/ubuntuclicktool.h>
5#include <qtsupport/qtsupportconstants.h>7#include <qtsupport/qtsupportconstants.h>
68
7#include <QCoreApplication>9#include <QCoreApplication>
8#include <QFileInfo>10#include <QFileInfo>
9#include <QDebug>11#include <QDebug>
12#include <QDir>
1013
11namespace Ubuntu {14namespace Ubuntu {
12namespace Internal {15namespace Internal {
1316
14const char SCRIPT_VERSION_KEY[] = "UbuntuQtVersion.ScriptVersion";17const char SCRIPT_VERSION_KEY[] = "UbuntuQtVersion.ScriptVersion";
18const char CONTAINER_NAME[] = "UbuntuQtVersion.ContainerName";
1519
16/*!20/*!
17 * \brief MIN_SCRIPT_VERSION21 * \brief MIN_SCRIPT_VERSION
@@ -25,9 +29,10 @@
25 m_scriptVersion(MIN_SCRIPT_VERSION)29 m_scriptVersion(MIN_SCRIPT_VERSION)
26{ }30{ }
2731
28UbuntuQtVersion::UbuntuQtVersion(const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)32UbuntuQtVersion::UbuntuQtVersion(const QString &containerName, const Utils::FileName &path, bool isAutodetected, const QString &autodetectionSource)
29 : BaseQtVersion(path, isAutodetected, autodetectionSource),33 : BaseQtVersion(path, isAutodetected, autodetectionSource),
30 m_scriptVersion(MIN_SCRIPT_VERSION)34 m_scriptVersion(MIN_SCRIPT_VERSION),
35 m_containerName(containerName)
31{36{
32 setUnexpandedDisplayName(defaultUnexpandedDisplayName(path, false));37 setUnexpandedDisplayName(defaultUnexpandedDisplayName(path, false));
33}38}
@@ -39,12 +44,21 @@
39{44{
40 BaseQtVersion::fromMap(map);45 BaseQtVersion::fromMap(map);
41 m_scriptVersion = map.value(QLatin1String(SCRIPT_VERSION_KEY),0).toInt();46 m_scriptVersion = map.value(QLatin1String(SCRIPT_VERSION_KEY),0).toInt();
47 m_containerName = map.value(QLatin1String(CONTAINER_NAME),QString()).toString();
48
49 if (m_containerName.isEmpty()) {
50 //ok, this is a old QtVersion, we need to restore the container name from the
51 //qmake path
52 Utils::FileName command = this->qmakeCommand();
53 m_containerName = command.toFileInfo().dir().dirName();
54 }
42}55}
4356
44QVariantMap UbuntuQtVersion::toMap() const57QVariantMap UbuntuQtVersion::toMap() const
45{58{
46 QVariantMap map = BaseQtVersion::toMap();59 QVariantMap map = BaseQtVersion::toMap();
47 map.insert(QLatin1String(SCRIPT_VERSION_KEY),m_scriptVersion);60 map.insert(QLatin1String(SCRIPT_VERSION_KEY),m_scriptVersion);
61 map.insert(QLatin1String(CONTAINER_NAME), m_containerName);
48 return map;62 return map;
49}63}
5064
@@ -68,15 +82,23 @@
68 return QCoreApplication::translate("QtVersion", "Ubuntu Phone", "Qt Version is used for Ubuntu Phone development");82 return QCoreApplication::translate("QtVersion", "Ubuntu Phone", "Qt Version is used for Ubuntu Phone development");
69}83}
7084
71QString UbuntuQtVersion::platformName() const85QSet<Core::Id> UbuntuQtVersion::targetDeviceTypes() const
72{86{
73 return QLatin1String(Constants::UBUNTU_PLATFORM_NAME);87 QSet<Core::Id> set{
74}88 Constants::UBUNTU_DEVICE_TYPE_ID
7589 };
76QString UbuntuQtVersion::platformDisplayName() const90
77{91 auto hostAbi = ProjectExplorer::Abi::hostAbi();
78 return QLatin1String(Constants::UBUNTU_PLATFORM_NAME_TR);92 for (const ProjectExplorer::Abi &abi : qtAbis()) {
79}93 if (abi.architecture() == hostAbi.architecture() &&
94 abi.os() == hostAbi.os()) {
95 set << ContainerDevice::createIdForContainer(m_containerName);
96 }
97 }
98
99 return set;
100}
101
80int UbuntuQtVersion::scriptVersion() const102int UbuntuQtVersion::scriptVersion() const
81{103{
82 return m_scriptVersion;104 return m_scriptVersion;
@@ -92,6 +114,11 @@
92 return MIN_SCRIPT_VERSION;114 return MIN_SCRIPT_VERSION;
93}115}
94116
117QString UbuntuQtVersion::remoteQMakeCommand() const
118{
119 return QString::fromLatin1("/usr/bin/%2").arg(qmakeCommand().fileName());
120}
121
95bool UbuntuQtVersion::hasQmlDump() const122bool UbuntuQtVersion::hasQmlDump() const
96{123{
97 return false;124 return false;
@@ -132,10 +159,18 @@
132{159{
133 Q_UNUSED(evaluator);160 Q_UNUSED(evaluator);
134 //we only care about our qmakes161 //we only care about our qmakes
135 if(!qmakePath.toFileInfo().absolutePath().contains(Settings::settingsPath().toString()))162 QFileInfo qmakeInfo = qmakePath.toFileInfo();
136 return 0;163 if(!qmakeInfo.absolutePath().contains(Settings::settingsPath().toString()))
137164 return 0;
138 return new UbuntuQtVersion(qmakePath,isAutoDetected,autoDetectionSource);165
166 if(!qmakeInfo.isSymLink() || qmakeInfo.symLinkTarget() != Constants::UBUNTU_CLICK_TARGET_WRAPPER)
167 return 0;
168
169 QString containerName = qmakePath.toFileInfo().dir().dirName();
170 if (!UbuntuClickTool::targetExists(containerName))
171 return 0;
172
173 return new UbuntuQtVersion(containerName, qmakePath,isAutoDetected,autoDetectionSource);
139}174}
140175
141} // namespace Internal176} // namespace Internal
142177
=== modified file 'src/ubuntu/ubuntuqtversion.h'
--- src/ubuntu/ubuntuqtversion.h 2016-03-22 13:32:33 +0000
+++ src/ubuntu/ubuntuqtversion.h 2016-08-24 15:35:12 +0000
@@ -11,7 +11,7 @@
11{11{
12public:12public:
13 UbuntuQtVersion();13 UbuntuQtVersion();
14 UbuntuQtVersion(const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());14 UbuntuQtVersion(const QString &containerName, const Utils::FileName &path, bool isAutodetected = false, const QString &autodetectionSource = QString());
15 ~UbuntuQtVersion() override;15 ~UbuntuQtVersion() override;
1616
17 // BaseQtVersion interface17 // BaseQtVersion interface
@@ -26,14 +26,15 @@
2626
27 QString description() const override;27 QString description() const override;
2828
29 QString platformName() const override;29 virtual QSet<Core::Id> targetDeviceTypes() const override;
30 QString platformDisplayName() const override;
3130
32 int scriptVersion() const;31 int scriptVersion() const;
33 void setScriptVersion(int scriptVersion);32 void setScriptVersion(int scriptVersion);
3433
35 static int minimalScriptVersion ();34 static int minimalScriptVersion ();
3635
36 QString remoteQMakeCommand () const;
37
37 // BaseQtVersion interface38 // BaseQtVersion interface
38 virtual bool hasQmlDump() const override;39 virtual bool hasQmlDump() const override;
39 virtual bool hasQmlDumpWithRelocatableFlag() const override;40 virtual bool hasQmlDumpWithRelocatableFlag() const override;
@@ -41,6 +42,7 @@
4142
42private:43private:
43 int m_scriptVersion;44 int m_scriptVersion;
45 QString m_containerName;
44};46};
4547
46class UbuntuQtVersionFactory : public QtSupport::QtVersionFactory48class UbuntuQtVersionFactory : public QtSupport::QtVersionFactory
4749
=== modified file 'src/ubuntu/ubuntuwelcomemode.cpp'
--- src/ubuntu/ubuntuwelcomemode.cpp 2016-04-19 12:09:54 +0000
+++ src/ubuntu/ubuntuwelcomemode.cpp 2016-08-24 15:35:12 +0000
@@ -24,6 +24,7 @@
24#include <QQmlContext>24#include <QQmlContext>
2525
26#include <utils/fileutils.h>26#include <utils/fileutils.h>
27#include <utils/algorithm.h>
27#include <coreplugin/iwizardfactory.h>28#include <coreplugin/iwizardfactory.h>
28#include <projectexplorer/projectexplorer.h>29#include <projectexplorer/projectexplorer.h>
2930
@@ -69,7 +70,10 @@
6970
70void UbuntuWelcomePage::newProject()71void UbuntuWelcomePage::newProject()
71{72{
72 Core::ICore::showNewItemDialog(tr("New Project"), Core::IWizardFactory::wizardFactoriesOfKind(Core::IWizardFactory::ProjectWizard));73 Core::ICore::showNewItemDialog(tr("New Project"), Utils::filtered(Core::IWizardFactory::allWizardFactories(),
74 [](Core::IWizardFactory *f) {
75 return f->kind() == Core::IWizardFactory::ProjectWizard;
76 }));
73}77}
7478
75void UbuntuWelcomePage::openProject()79void UbuntuWelcomePage::openProject()
7680
=== modified file 'src/ubuntu/wizards/createtargetwizard.cpp'
--- src/ubuntu/wizards/createtargetwizard.cpp 2016-07-12 08:47:56 +0000
+++ src/ubuntu/wizards/createtargetwizard.cpp 2016-08-24 15:35:12 +0000
@@ -364,7 +364,7 @@
364 return true;364 return true;
365 });365 });
366 ui->lineEditName->setPlaceholderText(tr("Please select a name"));366 ui->lineEditName->setPlaceholderText(tr("Please select a name"));
367 ui->lineEditName->triggerChanged();367 ui->lineEditName->validate();
368368
369 setTitle(tr("Please type a name:"));369 setTitle(tr("Please type a name:"));
370 setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Name"));370 setProperty(Utils::SHORT_TITLE_PROPERTY, tr("Name"));
371371
=== modified file 'src/ubuntu/wizards/ubuntufatpackagingwizard.cpp'
--- src/ubuntu/wizards/ubuntufatpackagingwizard.cpp 2016-07-06 09:18:16 +0000
+++ src/ubuntu/wizards/ubuntufatpackagingwizard.cpp 2016-08-24 15:35:12 +0000
@@ -231,7 +231,7 @@
231 QString fw;231 QString fw;
232 foreach (ProjectExplorer::BuildConfiguration *conf, selectedSuspects()) {232 foreach (ProjectExplorer::BuildConfiguration *conf, selectedSuspects()) {
233 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(conf->target()->kit());233 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(conf->target()->kit());
234 if (tc && tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {234 if (tc && tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
235 ClickToolChain *cTc = static_cast<ClickToolChain *>(tc);235 ClickToolChain *cTc = static_cast<ClickToolChain *>(tc);
236 if (fw.isEmpty())236 if (fw.isEmpty())
237 fw = cTc->clickTarget().framework;237 fw = cTc->clickTarget().framework;
238238
=== modified file 'src/ubuntu/wizards/ubuntufirstrunwizard.cpp'
--- src/ubuntu/wizards/ubuntufirstrunwizard.cpp 2016-05-17 16:33:36 +0000
+++ src/ubuntu/wizards/ubuntufirstrunwizard.cpp 2016-08-24 15:35:12 +0000
@@ -135,7 +135,7 @@
135 if (!tc || !QtSupport::QtKitInformation::qtVersion(curr))135 if (!tc || !QtSupport::QtKitInformation::qtVersion(curr))
136 continue;136 continue;
137137
138 if (tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {138 if (tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
139 found = true;139 found = true;
140140
141 QTreeWidgetItem* kitItem = new QTreeWidgetItem;141 QTreeWidgetItem* kitItem = new QTreeWidgetItem;
142142
=== modified file 'src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp'
--- src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp 2016-05-12 06:50:19 +0000
+++ src/ubuntu/wizards/ubuntuprojectapplicationwizard.cpp 2016-08-24 15:35:12 +0000
@@ -33,6 +33,7 @@
33#include <extensionsystem/pluginmanager.h>33#include <extensionsystem/pluginmanager.h>
34#include <cmakeprojectmanager/cmakekitinformation.h>34#include <cmakeprojectmanager/cmakekitinformation.h>
35#include <cmakeprojectmanager/cmaketool.h>35#include <cmakeprojectmanager/cmaketool.h>
36#include <coreplugin/id.h>
3637
37#include <projectexplorer/kitinformation.h>38#include <projectexplorer/kitinformation.h>
38#include <projectexplorer/toolchain.h>39#include <projectexplorer/toolchain.h>
@@ -141,14 +142,16 @@
141}142}
142143
143144
144Core::FeatureSet UbuntuProjectApplicationWizard::requiredFeatures() const145QSet<Core::Id> UbuntuProjectApplicationWizard::requiredFeatures() const
145{146{
146#ifdef Q_PROCESSOR_ARM147#ifdef Q_PROCESSOR_ARM
147 return CustomProjectWizard::requiredFeatures();148 return CustomProjectWizard::requiredFeatures();
148#else149#else
149 return CustomProjectWizard::requiredFeatures()150 QSet<Core::Id> features = CustomProjectWizard::requiredFeatures();
150 | Core::Feature(QtSupport::Constants::FEATURE_QMLPROJECT)151 features << QtSupport::Constants::FEATURE_QMLPROJECT
151 | Core::Feature::versionedFeature(QtSupport::Constants::FEATURE_QT_QUICK_PREFIX, 2);152 << Core::Id::versionedId(QtSupport::Constants::FEATURE_QT_QUICK_PREFIX, 2);
153
154 return features;
152#endif155#endif
153}156}
154157
@@ -220,7 +223,7 @@
220 bool found = false;223 bool found = false;
221 foreach(ProjectExplorer::Kit *curr, allKits) {224 foreach(ProjectExplorer::Kit *curr, allKits) {
222 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(curr);225 ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(curr);
223 if (tc->type() == QLatin1String(Constants::UBUNTU_CLICK_TOOLCHAIN_ID)) {226 if (tc->typeId() == Constants::UBUNTU_CLICK_TOOLCHAIN_ID) {
224 found = true;227 found = true;
225 break;228 break;
226 }229 }
@@ -279,7 +282,7 @@
279#endif282#endif
280 //this is just a fallback for now to remove all ubuntu kits until cross compiling is sorted out283 //this is just a fallback for now to remove all ubuntu kits until cross compiling is sorted out
281 //it should not be hit at all but i keep it there just to be safe284 //it should not be hit at all but i keep it there just to be safe
282 m_targetSetupPage->setRequiredKitMatcher(QtSupport::QtKitInformation::platformMatcher(QLatin1String(QtSupport::Constants::DESKTOP_PLATFORM)));285 m_targetSetupPage->setRequiredKitMatcher(QtSupport::QtKitInformation::platformMatcher(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE));
283 break;286 break;
284 }287 }
285 case UbuntuProjectApplicationWizard::QMakeProject:288 case UbuntuProjectApplicationWizard::QMakeProject:
286289
=== modified file 'src/ubuntu/wizards/ubuntuprojectapplicationwizard.h'
--- src/ubuntu/wizards/ubuntuprojectapplicationwizard.h 2015-06-11 14:03:50 +0000
+++ src/ubuntu/wizards/ubuntuprojectapplicationwizard.h 2016-08-24 15:35:12 +0000
@@ -58,7 +58,7 @@
58 bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage) const override;58 bool postGenerateFiles(const QWizard *, const Core::GeneratedFiles &l, QString *errorMessage) const override;
5959
60private:60private:
61 Core::FeatureSet requiredFeatures() const;61 QSet<Core::Id> requiredFeatures() const;
62 ProjectType m_type;62 ProjectType m_type;
63};63};
6464
6565
=== modified file 'src/ubuntu/wizards/ubuntuprojectmigrationwizard.cpp'
--- src/ubuntu/wizards/ubuntuprojectmigrationwizard.cpp 2015-04-28 14:47:49 +0000
+++ src/ubuntu/wizards/ubuntuprojectmigrationwizard.cpp 2016-08-24 15:35:12 +0000
@@ -135,7 +135,7 @@
135{135{
136 UbuntuProjectMigrationWizard wiz(project,parent);136 UbuntuProjectMigrationWizard wiz(project,parent);
137 if(wiz.exec() == QDialog::Accepted) {137 if(wiz.exec() == QDialog::Accepted) {
138 bool multiTargetProject = project->rootQmakeProjectNode()->projectType() == QmakeProjectManager::SubDirsTemplate;138 bool multiTargetProject = project->rootProjectNode()->projectType() == QmakeProjectManager::SubDirsTemplate;
139139
140140
141 QMap<QString,QString> base_replacements;141 QMap<QString,QString> base_replacements;
@@ -168,7 +168,7 @@
168 bool canRead = true;168 bool canRead = true;
169 //setup the file reader correctly169 //setup the file reader correctly
170170
171 if (ProFile *pro = reader->parsedProFile(node->path().toString())) {171 if (ProFile *pro = reader->parsedProFile(node->filePath().toString())) {
172 if(!reader->accept(pro, QMakeEvaluator::LoadAll)) {172 if(!reader->accept(pro, QMakeEvaluator::LoadAll)) {
173 canRead = false;173 canRead = false;
174 }174 }
@@ -179,7 +179,7 @@
179179
180180
181 if(!canRead) {181 if(!canRead) {
182 printToOutputPane(tr("Can not parse %1, skipping migration.").arg(node->path().toString()));182 printToOutputPane(tr("Can not parse %1, skipping migration.").arg(node->filePath().toString()));
183 continue;183 continue;
184 }184 }
185185
@@ -308,7 +308,7 @@
308 //now add required files308 //now add required files
309 if(projectType == QmakeProjectManager::ApplicationTemplate) {309 if(projectType == QmakeProjectManager::ApplicationTemplate) {
310310
311 QFileInfo proFilePath(node->path().toString());311 QFileInfo proFilePath(node->filePath().toFileInfo());
312312
313 QmakeProjectManager::TargetInformation targetInfo = node->targetInformation();313 QmakeProjectManager::TargetInformation targetInfo = node->targetInformation();
314 if(hookTargets.contains(targetInfo.target)) {314 if(hookTargets.contains(targetInfo.target)) {
@@ -441,7 +441,7 @@
441 manifestFile.write(doc.toJson());441 manifestFile.write(doc.toJson());
442 manifestFile.close();442 manifestFile.close();
443443
444 project->rootQmakeProjectNode()->addSubProjects(QStringList()<<QString::fromLatin1("%1/%2").arg(project->projectDirectory().toString()).arg(QStringLiteral("/manifest.pro")));444 project->rootProjectNode()->addSubProjects(QStringList()<<QString::fromLatin1("%1/%2").arg(project->projectDirectory().toString()).arg(QStringLiteral("/manifest.pro")));
445 }445 }
446 }446 }
447}447}

Subscribers

People subscribed via source and target branches