~ubuntu-sdk-team/qtcreator-plugin-remotelinux/trunk

« back to all changes in this revision

Viewing changes to src/qnx/blackberryruncontrolfactory.cpp

  • Committer: CI bot
  • Author(s): Benjamin Zeller
  • Date: 2014-06-16 10:28:43 UTC
  • mfrom: (4.2.4 remotelinux)
  • Revision ID: ps-jenkins@lists.canonical.com-20140616102843-8juvmjvzwlzsboyw
Migrating to Qt5.3 and QtC 3.1 

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include "blackberrydebugsupport.h"
37
37
#include "blackberryqtversion.h"
38
38
#include "blackberrydeviceconnectionmanager.h"
 
39
#include "blackberryapplicationrunner.h"
39
40
#include "qnxutils.h"
40
41
 
41
42
#include <debugger/debuggerplugin.h>
48
49
#include <projectexplorer/toolchain.h>
49
50
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
50
51
#include <qtsupport/qtkitinformation.h>
 
52
#include <analyzerbase/analyzerstartparameters.h>
 
53
#include <analyzerbase/analyzermanager.h>
 
54
#include <analyzerbase/analyzerruncontrol.h>
 
55
#include <coreplugin/messagemanager.h>
51
56
 
52
57
using namespace Qnx;
53
58
using namespace Qnx::Internal;
86
91
    return activeDeployConf != 0;
87
92
}
88
93
 
 
94
static void createAnalyzerStartParameters(Analyzer::AnalyzerStartParameters *pStartParameters, BlackBerryRunConfiguration* runConfiguration, ProjectExplorer::RunMode mode)
 
95
{
 
96
    QTC_ASSERT(pStartParameters, return);
 
97
    pStartParameters->runMode = mode;
 
98
    if (mode == ProjectExplorer::QmlProfilerRunMode)
 
99
        pStartParameters->startMode = Analyzer::StartLocal;
 
100
 
 
101
    ProjectExplorer::Target *target = runConfiguration->target();
 
102
    ProjectExplorer::Kit *kit = target->kit();
 
103
 
 
104
    ProjectExplorer::IDevice::ConstPtr device = ProjectExplorer::DeviceKitInformation::device(kit);
 
105
    if (device) {
 
106
        pStartParameters->connParams = device->sshParameters();
 
107
        pStartParameters->analyzerHost = device->qmlProfilerHost();
 
108
    }
 
109
    pStartParameters->sysroot = ProjectExplorer::SysRootKitInformation::sysRoot(kit).toString();
 
110
 
 
111
    Debugger::DebuggerRunConfigurationAspect *aspect = runConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
 
112
    if (aspect)
 
113
        pStartParameters->analyzerPort = aspect->qmlDebugServerPort();
 
114
}
 
115
 
89
116
ProjectExplorer::RunControl *BlackBerryRunControlFactory::create(ProjectExplorer::RunConfiguration *runConfiguration,
90
117
        ProjectExplorer::RunMode mode, QString *errorMessage)
91
118
{
106
133
        m_activeRunControls[rc->key()] = runControl;
107
134
        return runControl;
108
135
    }
109
 
 
 
136
    if (mode == ProjectExplorer::QmlProfilerRunMode) {
 
137
        QtSupport::BaseQtVersion *qtVer = QtSupport::QtKitInformation::qtVersion(rc->target()->kit());
 
138
        if (qtVer && qtVer->qtVersion() <= QtSupport::QtVersionNumber(4, 8, 6))
 
139
            Core::MessageManager::write(tr("Target Qt version (%1) might not support QML profiling. "
 
140
                "Cascades applications are not affected and should work as expected. "
 
141
                "For more info see http://qt-project.org/wiki/Qt-Creator-with-BlackBerry-10")
 
142
                .arg(qtVer->qtVersionString()), Core::MessageManager::Flash
 
143
            );
 
144
 
 
145
        Analyzer::AnalyzerStartParameters params;
 
146
        createAnalyzerStartParameters(&params, rc, mode);
 
147
 
 
148
        Analyzer::AnalyzerRunControl *runControl = Analyzer::AnalyzerManager::createRunControl(params, runConfiguration);
 
149
        BlackBerryApplicationRunner::LaunchFlags launchFlags(BlackBerryApplicationRunner::QmlDebugLaunch
 
150
            | BlackBerryApplicationRunner::QmlDebugLaunchBlocking
 
151
            | BlackBerryApplicationRunner::QmlProfilerLaunch);
 
152
        BlackBerryApplicationRunner *runner = new BlackBerryApplicationRunner(launchFlags, rc, runControl);
 
153
 
 
154
        connect(runner, SIGNAL(finished()), runControl, SLOT(notifyRemoteFinished()));
 
155
        connect(runner, SIGNAL(output(QString, Utils::OutputFormat)),
 
156
                runControl, SLOT(logApplicationMessage(QString, Utils::OutputFormat)));
 
157
        connect(runControl, SIGNAL(starting(const Analyzer::AnalyzerRunControl*)),
 
158
                runner, SLOT(start()));
 
159
        connect(runControl, SIGNAL(finished()), runner, SLOT(stop()));
 
160
        return runControl;
 
161
    }
110
162
    Debugger::DebuggerRunControl * const runControl =
111
163
            Debugger::DebuggerPlugin::createDebugger(startParameters(rc), runConfiguration, errorMessage);
112
164
    if (!runControl)