Removed unnecessary launch process from S60DeviceDebugRunControl for Symbian

Bug QTCREATORBUG-2088 has been fixed
Task-number: QTCREATORBUG-2088

Reviewed-by: Friedemann Kleint
This commit is contained in:
Pawel Polanski
2010-08-19 15:50:11 +02:00
parent 02afdfc83c
commit 6e90b51937
4 changed files with 125 additions and 138 deletions

View File

@@ -260,7 +260,7 @@ void S60DeployConfigurationWidget::slotLauncherStateChanged(int s)
switch (s) { switch (s) {
case trk::Launcher::WaitingForTrk: { case trk::Launcher::WaitingForTrk: {
// Entered trk wait state..open message box // Entered trk wait state..open message box
QMessageBox *mb = S60DeviceRunControlBase::createTrkWaitingMessageBox(m_infoLauncher->trkServerName(), this); QMessageBox *mb = S60DeviceRunControl::createTrkWaitingMessageBox(m_infoLauncher->trkServerName(), this);
connect(m_infoLauncher, SIGNAL(stateChanged(int)), mb, SLOT(close())); connect(m_infoLauncher, SIGNAL(stateChanged(int)), mb, SLOT(close()));
connect(mb, SIGNAL(finished(int)), this, SLOT(slotWaitingForTrkClosed())); connect(mb, SIGNAL(finished(int)), this, SLOT(slotWaitingForTrkClosed()));
mb->open(); mb->open();

View File

@@ -310,7 +310,7 @@ void S60DeployStep::setReleaseDeviceAfterLauncherFinish(bool v)
void S60DeployStep::slotLauncherStateChanged(int s) void S60DeployStep::slotLauncherStateChanged(int s)
{ {
if (s == trk::Launcher::WaitingForTrk) { if (s == trk::Launcher::WaitingForTrk) {
QMessageBox *mb = S60DeviceRunControlBase::createTrkWaitingMessageBox(m_launcher->trkServerName(), QMessageBox *mb = S60DeviceRunControl::createTrkWaitingMessageBox(m_launcher->trkServerName(),
Core::ICore::instance()->mainWindow()); Core::ICore::instance()->mainWindow());
connect(m_launcher, SIGNAL(stateChanged(int)), mb, SLOT(close())); connect(m_launcher, SIGNAL(stateChanged(int)), mb, SLOT(close()));
connect(mb, SIGNAL(finished(int)), this, SLOT(slotWaitingForTrkClosed())); connect(mb, SIGNAL(finished(int)), this, SLOT(slotWaitingForTrkClosed()));

View File

@@ -74,9 +74,6 @@ const char * const PRO_FILE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.Pro
const char * const COMMUNICATION_TYPE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CommunicationType"); const char * const COMMUNICATION_TYPE_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CommunicationType");
const char * const COMMAND_LINE_ARGUMENTS_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CommandLineArguments"); const char * const COMMAND_LINE_ARGUMENTS_KEY("Qt4ProjectManager.S60DeviceRunConfiguration.CommandLineArguments");
const int PROGRESS_DEPLOYBASE = 0;
const int PROGRESS_PACKAGEDEPLOYED = 100;
const int PROGRESS_PACKAGEINSTALLED = 200;
const int PROGRESS_MAX = 200; const int PROGRESS_MAX = 200;
enum { debug = 0 }; enum { debug = 0 };
@@ -211,7 +208,6 @@ bool S60DeviceRunConfiguration::fromMap(const QVariantMap &map)
return RunConfiguration::fromMap(map); return RunConfiguration::fromMap(map);
} }
static inline QString fixBaseNameTarget(const QString &in) static inline QString fixBaseNameTarget(const QString &in)
{ {
if (in == QLatin1String("udeb")) if (in == QLatin1String("udeb"))
@@ -323,10 +319,9 @@ RunConfiguration *S60DeviceRunConfigurationFactory::clone(Target *parent, RunCon
// ======== S60DeviceRunControlBase // ======== S60DeviceRunControlBase
S60DeviceRunControlBase::S60DeviceRunControlBase(RunConfiguration *runConfiguration, QString mode) : S60DeviceRunControl::S60DeviceRunControl(RunConfiguration *runConfiguration, QString mode) :
RunControl(runConfiguration, mode), RunControl(runConfiguration, mode),
m_toolChain(ProjectExplorer::ToolChain::INVALID), m_toolChain(ProjectExplorer::ToolChain::INVALID),
m_releaseDeviceAfterLauncherFinish(false),
m_handleDeviceRemoval(true), m_handleDeviceRemoval(true),
m_launcher(0) m_launcher(0)
{ {
@@ -350,11 +345,11 @@ S60DeviceRunControlBase::S60DeviceRunControlBase(RunConfiguration *runConfigurat
QTC_ASSERT(!m_qtBinPath.isEmpty(), return); QTC_ASSERT(!m_qtBinPath.isEmpty(), return);
m_executableFileName = activeDeployConf->localExecutableFileName(); m_executableFileName = activeDeployConf->localExecutableFileName();
if (debug) if (debug)
qDebug() << "S60DeviceRunControlBase::CT" << m_targetName << ProjectExplorer::ToolChain::toolChainName(m_toolChain) qDebug() << "S60DeviceRunControl::CT" << m_targetName << ProjectExplorer::ToolChain::toolChainName(m_toolChain)
<< m_serialPortName; << m_serialPortName;
} }
S60DeviceRunControlBase::~S60DeviceRunControlBase() S60DeviceRunControl::~S60DeviceRunControl()
{ {
if (m_launcher) { if (m_launcher) {
m_launcher->deleteLater(); m_launcher->deleteLater();
@@ -362,23 +357,18 @@ S60DeviceRunControlBase::~S60DeviceRunControlBase()
} }
} }
void S60DeviceRunControlBase::setReleaseDeviceAfterLauncherFinish(bool v) void S60DeviceRunControl::start()
{ {
m_releaseDeviceAfterLauncherFinish = v; m_launchProgress = new QFutureInterface<void>;
} Core::ICore::instance()->progressManager()->addTask(m_launchProgress->future(),
void S60DeviceRunControlBase::start()
{
m_deployProgress = new QFutureInterface<void>;
Core::ICore::instance()->progressManager()->addTask(m_deployProgress->future(),
tr("Launching"), tr("Launching"),
QLatin1String("Symbian.Launch")); QLatin1String("Symbian.Launch"));
m_deployProgress->setProgressRange(0, PROGRESS_MAX); m_launchProgress->setProgressRange(0, PROGRESS_MAX);
m_deployProgress->setProgressValue(0); m_launchProgress->setProgressValue(0);
m_deployProgress->reportStarted(); m_launchProgress->reportStarted();
emit started(); emit started();
if (m_serialPortName.isEmpty()) { if (m_serialPortName.isEmpty()) {
m_deployProgress->reportCanceled(); m_launchProgress->reportCanceled();
appendMessage(this, tr("There is no device plugged in."), true); appendMessage(this, tr("There is no device plugged in."), true);
emit finished(); emit finished();
return; return;
@@ -390,7 +380,7 @@ void S60DeviceRunControlBase::start()
QString settingsCategory; QString settingsCategory;
QString settingsPage; QString settingsPage;
if (!checkConfiguration(&errorMessage, &settingsCategory, &settingsPage)) { if (!checkConfiguration(&errorMessage, &settingsCategory, &settingsPage)) {
m_deployProgress->reportCanceled(); m_launchProgress->reportCanceled();
appendMessage(this, errorMessage, true); appendMessage(this, errorMessage, true);
emit finished(); emit finished();
Core::ICore::instance()->showWarningWithOptions(tr("Debugger for Symbian Platform"), Core::ICore::instance()->showWarningWithOptions(tr("Debugger for Symbian Platform"),
@@ -402,35 +392,25 @@ void S60DeviceRunControlBase::start()
startLaunching(); startLaunching();
} }
static inline void stopProcess(QProcess *p) void S60DeviceRunControl::stop()
{
const int timeOutMS = 200;
if (p->state() != QProcess::Running)
return;
p->terminate();
if (p->waitForFinished(timeOutMS))
return;
p->kill();
}
void S60DeviceRunControlBase::stop()
{ {
if (m_launcher) if (m_launcher)
m_launcher->terminate(); m_launcher->terminate();
} }
bool S60DeviceRunControlBase::isRunning() const bool S60DeviceRunControl::isRunning() const
{ {
//TODO !!! return m_launcher && (m_launcher->state() == trk::Launcher::Connecting
return false; || m_launcher->state() == trk::Launcher::Connected
|| m_launcher->state() == trk::Launcher::WaitingForTrk);
} }
void S60DeviceRunControlBase::startLaunching() void S60DeviceRunControl::startLaunching()
{ {
QString errorMessage; QString errorMessage;
if (setupLauncher(errorMessage)) { if (setupLauncher(errorMessage)) {
if (m_deployProgress) if (m_launchProgress)
m_deployProgress->setProgressValue(PROGRESS_MAX/2); m_launchProgress->setProgressValue(PROGRESS_MAX/2);
} else { } else {
if (!errorMessage.isEmpty()) if (!errorMessage.isEmpty())
appendMessage(this, errorMessage, true); appendMessage(this, errorMessage, true);
@@ -439,7 +419,7 @@ void S60DeviceRunControlBase::startLaunching()
} }
} }
bool S60DeviceRunControlBase::setupLauncher(QString &errorMessage) bool S60DeviceRunControl::setupLauncher(QString &errorMessage)
{ {
connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)), connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)),
this, SLOT(deviceRemoved(SymbianUtils::SymbianDevice))); this, SLOT(deviceRemoved(SymbianUtils::SymbianDevice)));
@@ -472,38 +452,36 @@ bool S60DeviceRunControlBase::setupLauncher(QString &errorMessage)
return true; return true;
} }
void S60DeviceRunControlBase::printConnectFailed(const QString &errorMessage) void S60DeviceRunControl::printConnectFailed(const QString &errorMessage)
{ {
emit appendMessage(this, tr("Could not connect to App TRK on device: %1. Restarting App TRK might help.").arg(errorMessage), true); emit appendMessage(this, tr("Could not connect to App TRK on device: %1. Restarting App TRK might help.").arg(errorMessage), true);
} }
void S60DeviceRunControlBase::launcherFinished() void S60DeviceRunControl::launcherFinished()
{ {
if (m_releaseDeviceAfterLauncherFinish) {
m_handleDeviceRemoval = false; m_handleDeviceRemoval = false;
trk::Launcher::releaseToDeviceManager(m_launcher); trk::Launcher::releaseToDeviceManager(m_launcher);
}
m_launcher->deleteLater(); m_launcher->deleteLater();
m_launcher = 0; m_launcher = 0;
handleLauncherFinished(); handleLauncherFinished();
} }
void S60DeviceRunControlBase::reportDeployFinished() void S60DeviceRunControl::reportDeployFinished()
{ {
if (m_deployProgress) { if (m_launchProgress) {
m_deployProgress->reportFinished(); m_launchProgress->reportFinished();
delete m_deployProgress; delete m_launchProgress;
m_deployProgress = 0; m_launchProgress = 0;
} }
} }
void S60DeviceRunControlBase::processStopped(uint pc, uint pid, uint tid, const QString& reason) void S60DeviceRunControl::processStopped(uint pc, uint pid, uint tid, const QString& reason)
{ {
emit addToOutputWindow(this, trk::Launcher::msgStopped(pid, tid, pc, reason), false); emit addToOutputWindow(this, trk::Launcher::msgStopped(pid, tid, pc, reason), false);
m_launcher->terminate(); m_launcher->terminate();
} }
QMessageBox *S60DeviceRunControlBase::createTrkWaitingMessageBox(const QString &port, QWidget *parent) QMessageBox *S60DeviceRunControl::createTrkWaitingMessageBox(const QString &port, QWidget *parent)
{ {
const QString title = QCoreApplication::translate("Qt4ProjectManager::Internal::S60DeviceRunControlBase", const QString title = QCoreApplication::translate("Qt4ProjectManager::Internal::S60DeviceRunControlBase",
"Waiting for App TRK"); "Waiting for App TRK");
@@ -517,10 +495,10 @@ QMessageBox *S60DeviceRunControlBase::createTrkWaitingMessageBox(const QString &
return rc; return rc;
} }
void S60DeviceRunControlBase::slotLauncherStateChanged(int s) void S60DeviceRunControl::slotLauncherStateChanged(int s)
{ {
if (s == trk::Launcher::WaitingForTrk) { if (s == trk::Launcher::WaitingForTrk) {
QMessageBox *mb = S60DeviceRunControlBase::createTrkWaitingMessageBox(m_launcher->trkServerName(), QMessageBox *mb = S60DeviceRunControl::createTrkWaitingMessageBox(m_launcher->trkServerName(),
Core::ICore::instance()->mainWindow()); Core::ICore::instance()->mainWindow());
connect(m_launcher, SIGNAL(stateChanged(int)), mb, SLOT(close())); connect(m_launcher, SIGNAL(stateChanged(int)), mb, SLOT(close()));
connect(mb, SIGNAL(finished(int)), this, SLOT(slotWaitingForTrkClosed())); connect(mb, SIGNAL(finished(int)), this, SLOT(slotWaitingForTrkClosed()));
@@ -528,7 +506,7 @@ void S60DeviceRunControlBase::slotLauncherStateChanged(int s)
} }
} }
void S60DeviceRunControlBase::slotWaitingForTrkClosed() void S60DeviceRunControl::slotWaitingForTrkClosed()
{ {
if (m_launcher && m_launcher->state() == trk::Launcher::WaitingForTrk) { if (m_launcher && m_launcher->state() == trk::Launcher::WaitingForTrk) {
stop(); stop();
@@ -537,17 +515,17 @@ void S60DeviceRunControlBase::slotWaitingForTrkClosed()
} }
} }
void S60DeviceRunControlBase::printApplicationOutput(const QString &output) void S60DeviceRunControl::printApplicationOutput(const QString &output)
{ {
printApplicationOutput(output, false); printApplicationOutput(output, false);
} }
void S60DeviceRunControlBase::printApplicationOutput(const QString &output, bool onStdErr) void S60DeviceRunControl::printApplicationOutput(const QString &output, bool onStdErr)
{ {
emit addToOutputWindowInline(this, output, onStdErr); emit addToOutputWindowInline(this, output, onStdErr);
} }
void S60DeviceRunControlBase::deviceRemoved(const SymbianUtils::SymbianDevice &d) void S60DeviceRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &d)
{ {
if (m_handleDeviceRemoval && d.portName() == m_serialPortName) { if (m_handleDeviceRemoval && d.portName() == m_serialPortName) {
appendMessage(this, tr("The device '%1' has been disconnected").arg(d.friendlyName()), true); appendMessage(this, tr("The device '%1' has been disconnected").arg(d.friendlyName()), true);
@@ -555,20 +533,13 @@ void S60DeviceRunControlBase::deviceRemoved(const SymbianUtils::SymbianDevice &d
} }
} }
bool S60DeviceRunControlBase::checkConfiguration(QString * /* errorMessage */, bool S60DeviceRunControl::checkConfiguration(QString * /* errorMessage */,
QString * /* settingsCategory */, QString * /* settingsCategory */,
QString * /* settingsPage */) const QString * /* settingsPage */) const
{ {
return true; return true;
} }
// =============== S60DeviceRunControl
S60DeviceRunControl::S60DeviceRunControl(ProjectExplorer::RunConfiguration *runConfiguration, QString mode) :
S60DeviceRunControlBase(runConfiguration, mode)
{
}
void S60DeviceRunControl::initLauncher(const QString &executable, trk::Launcher *launcher) void S60DeviceRunControl::initLauncher(const QString &executable, trk::Launcher *launcher)
{ {
connect(launcher, SIGNAL(startingApplication()), this, SLOT(printStartingNotice())); connect(launcher, SIGNAL(startingApplication()), this, SLOT(printStartingNotice()));
@@ -593,8 +564,8 @@ void S60DeviceRunControl::printStartingNotice()
void S60DeviceRunControl::applicationRunNotice(uint pid) void S60DeviceRunControl::applicationRunNotice(uint pid)
{ {
emit appendMessage(this, tr("Application running with pid %1.").arg(pid), false); emit appendMessage(this, tr("Application running with pid %1.").arg(pid), false);
if (m_deployProgress) if (m_launchProgress)
m_deployProgress->setProgressValue(PROGRESS_MAX); m_launchProgress->setProgressValue(PROGRESS_MAX);
} }
void S60DeviceRunControl::applicationRunFailedNotice(const QString &errorMessage) void S60DeviceRunControl::applicationRunFailedNotice(const QString &errorMessage)
@@ -605,19 +576,31 @@ void S60DeviceRunControl::applicationRunFailedNotice(const QString &errorMessage
// ======== S60DeviceDebugRunControl // ======== S60DeviceDebugRunControl
S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc, QString mode) : S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc, QString mode) :
S60DeviceRunControlBase(rc, mode), RunControl(rc, mode),
m_startParams(new Debugger::DebuggerStartParameters), m_startParams(new Debugger::DebuggerStartParameters),
m_debuggerRunControl(0) m_debuggerRunControl(0),
m_debugProgress(0)
{ {
setReleaseDeviceAfterLauncherFinish(true); // Debugger controls device after install
QTC_ASSERT(rc, return); QTC_ASSERT(rc, return);
S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(rc->qt4Target()->activeDeployConfiguration()); S60DeployConfiguration *activeDeployConf = qobject_cast<S60DeployConfiguration *>(rc->qt4Target()->activeDeployConfiguration());
const QString debugFileName = QString::fromLatin1("%1:\\sys\\bin\\%2.exe")
.arg(activeDeployConf->installationDrive()).arg(activeDeployConf->targetName());
m_startParams->remoteChannel = activeDeployConf->serialPortName(); m_startParams->remoteChannel = activeDeployConf->serialPortName();
m_startParams->processArgs = rc->commandLineArguments(); m_startParams->processArgs = rc->commandLineArguments();
m_startParams->startMode = Debugger::StartInternal; m_startParams->startMode = Debugger::StartInternal;
m_startParams->toolChainType = rc->toolChainType(); m_startParams->toolChainType = rc->toolChainType();
m_startParams->executable = debugFileName;
// Prefer the '*.sym' file over the '.exe', which should exist at the same
// location in debug builds
if (!QFileInfo(m_startParams->symbolFileName).isFile()) {
m_startParams->symbolFileName.clear();
emit appendMessage(this, tr("Warning: Cannot locate the symbol file belonging to %1.").arg(m_localExecutableFileName), true);
}
m_localExecutableFileName = activeDeployConf->localExecutableFileName(); m_localExecutableFileName = activeDeployConf->localExecutableFileName();
const int lastDotPos = m_localExecutableFileName.lastIndexOf(QLatin1Char('.')); const int lastDotPos = m_localExecutableFileName.lastIndexOf(QLatin1Char('.'));
@@ -626,42 +609,35 @@ S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc
} }
} }
S60DeviceDebugRunControl::~S60DeviceDebugRunControl() void S60DeviceDebugRunControl::start()
{ {
// FIXME: Needed? m_debuggerRunControl->deleteLater(); m_debugProgress = new QFutureInterface<void>;
} Core::ICore::instance()->progressManager()->addTask(m_debugProgress->future(),
tr("Debugging"),
QLatin1String("Symbian.Debug"));
m_debugProgress->setProgressRange(0, PROGRESS_MAX);
m_debugProgress->setProgressValue(0);
m_debugProgress->reportStarted();
emit started();
void S60DeviceDebugRunControl::stop() QString errorMessage;
{ QString settingsCategory;
S60DeviceRunControlBase::stop(); QString settingsPage;
QTC_ASSERT(m_debuggerRunControl, return) if (!checkConfiguration(&errorMessage, &settingsCategory, &settingsPage)) {
if (m_debuggerRunControl->state() == Debugger::DebuggerNotReady) m_debugProgress->reportCanceled();
m_debuggerRunControl->stop(); appendMessage(this, errorMessage, true);
}
void S60DeviceDebugRunControl::initLauncher(const QString &executable, trk::Launcher *launcher)
{
// No setting an executable on the launcher causes it to deploy only
m_startParams->executable = executable;
// Prefer the '*.sym' file over the '.exe', which should exist at the same
// location in debug builds
if (!QFileInfo(m_startParams->symbolFileName).isFile()) {
m_startParams->symbolFileName.clear();
emit appendMessage(this, tr("Warning: Cannot locate the symbol file belonging to %1.").arg(m_localExecutableFileName), true);
}
// Avoid close/open sequence in quick succession, which may cause crashs
launcher->setCloseDevice(false);
// The S60DeviceDebugRunControl does not deploy anything anymore
emit finished(); emit finished();
Core::ICore::instance()->showWarningWithOptions(tr("Debugger for Symbian Platform"),
errorMessage, QString(),
settingsCategory, settingsPage);
return;
} }
void S60DeviceDebugRunControl::handleLauncherFinished()
{
using namespace Debugger; using namespace Debugger;
emit appendMessage(this, tr("Launching debugger..."), false); emit appendMessage(this, tr("Launching debugger..."), false);
QTC_ASSERT(m_debuggerRunControl == 0, /* Should happen only once. */); QTC_ASSERT(m_debuggerRunControl == 0, /* Should happen only once. */);
m_debuggerRunControl = DebuggerPlugin::createDebugger(*m_startParams.data()); m_debuggerRunControl = DebuggerPlugin::createDebugger(*m_startParams.data());
connect(m_debuggerRunControl, connect(m_debuggerRunControl,
SIGNAL(finished()), SIGNAL(finished()),
SLOT(debuggingFinished()), SLOT(debuggingFinished()),
@@ -674,10 +650,40 @@ void S60DeviceDebugRunControl::handleLauncherFinished()
DebuggerPlugin::startDebugger(m_debuggerRunControl); DebuggerPlugin::startDebugger(m_debuggerRunControl);
} }
S60DeviceDebugRunControl::~S60DeviceDebugRunControl()
{
delete m_debugProgress;
// FIXME: Needed? m_debuggerRunControl->deleteLater();
}
void S60DeviceDebugRunControl::stop()
{
QTC_ASSERT(m_debuggerRunControl, return)
if (m_debuggerRunControl->state() == Debugger::DebuggerNotReady)
m_debuggerRunControl->stop();
if (m_debugProgress)
m_debugProgress->reportCanceled();
delete m_debugProgress;
m_debugProgress = 0;
}
bool S60DeviceDebugRunControl::isRunning() const
{
return m_debuggerRunControl
&& m_debuggerRunControl->isRunning();
}
void S60DeviceDebugRunControl::debuggingFinished() void S60DeviceDebugRunControl::debuggingFinished()
{ {
emit appendMessage(this, tr("Debugging finished."), false); emit appendMessage(this, tr("Debugging finished."), false);
emit finished(); emit finished();
if (m_debugProgress) {
m_debugProgress->setProgressValue(PROGRESS_MAX);
m_debugProgress->reportFinished();
}
delete m_debugProgress;
m_debugProgress = 0;
} }
bool S60DeviceDebugRunControl::checkConfiguration(QString *errorMessage, bool S60DeviceDebugRunControl::checkConfiguration(QString *errorMessage,

View File

@@ -122,18 +122,14 @@ public:
QString displayNameForId(const QString &id) const; QString displayNameForId(const QString &id) const;
}; };
/* S60DeviceRunControlBase: Builds the package and starts launcher // S60DeviceRunControl configures launcher to run the application
* to deploy. Subclasses can configure the launcher to run or start a debugger.
* Building the package comprises for:
* GnuPoc: run 'make sis' with environment variables for signing set
* Other: run the makesis.exe tool, run signsis */
class S60DeviceRunControlBase : public ProjectExplorer::RunControl class S60DeviceRunControl : public ProjectExplorer::RunControl
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit S60DeviceRunControlBase(ProjectExplorer::RunConfiguration *runConfiguration, QString mode); explicit S60DeviceRunControl(ProjectExplorer::RunConfiguration *runConfiguration, QString mode);
~S60DeviceRunControlBase(); ~S60DeviceRunControl();
virtual void start(); virtual void start();
virtual void stop(); virtual void stop();
virtual bool isRunning() const; virtual bool isRunning() const;
@@ -141,16 +137,18 @@ public:
static QMessageBox *createTrkWaitingMessageBox(const QString &port, QWidget *parent = 0); static QMessageBox *createTrkWaitingMessageBox(const QString &port, QWidget *parent = 0);
protected: protected:
virtual void initLauncher(const QString &executable, trk::Launcher *) = 0; virtual void initLauncher(const QString &executable, trk::Launcher *);
virtual void handleLauncherFinished() = 0; virtual void handleLauncherFinished();
virtual bool checkConfiguration(QString *errorMessage, virtual bool checkConfiguration(QString *errorMessage,
QString *settingsCategory, QString *settingsCategory,
QString *settingsPage) const; QString *settingsPage) const;
void setReleaseDeviceAfterLauncherFinish(bool);
protected slots: protected slots:
void printApplicationOutput(const QString &output, bool onStdErr); void printApplicationOutput(const QString &output, bool onStdErr);
void printApplicationOutput(const QString &output); void printApplicationOutput(const QString &output);
void printStartingNotice();
void applicationRunNotice(uint pid);
void applicationRunFailedNotice(const QString &errorMessage);
void deviceRemoved(const SymbianUtils::SymbianDevice &); void deviceRemoved(const SymbianUtils::SymbianDevice &);
void reportDeployFinished(); void reportDeployFinished();
@@ -162,7 +160,7 @@ private slots:
void slotWaitingForTrkClosed(); void slotWaitingForTrkClosed();
protected: protected:
QFutureInterface<void> *m_deployProgress; QFutureInterface<void> *m_launchProgress;
private: private:
void startLaunching(); void startLaunching();
@@ -176,53 +174,36 @@ private:
QString m_executableFileName; QString m_executableFileName;
QString m_qtDir; QString m_qtDir;
QString m_qtBinPath; QString m_qtBinPath;
bool m_releaseDeviceAfterLauncherFinish;
bool m_handleDeviceRemoval; bool m_handleDeviceRemoval;
trk::Launcher *m_launcher; trk::Launcher *m_launcher;
char m_installationDrive; char m_installationDrive;
}; };
// Configure launcher to run the application // S60DeviceDebugRunControl starts debugging
class S60DeviceRunControl : public S60DeviceRunControlBase
{
Q_OBJECT
public:
explicit S60DeviceRunControl(ProjectExplorer::RunConfiguration *runConfiguration, QString mode);
protected: class S60DeviceDebugRunControl : public ProjectExplorer::RunControl
virtual void initLauncher(const QString &executable, trk::Launcher *);
virtual void handleLauncherFinished();
private slots:
void printStartingNotice();
void applicationRunNotice(uint pid);
void applicationRunFailedNotice(const QString &errorMessage);
private:
};
class S60DeviceDebugRunControl : public S60DeviceRunControlBase
{ {
Q_DISABLE_COPY(S60DeviceDebugRunControl) Q_DISABLE_COPY(S60DeviceDebugRunControl)
Q_OBJECT Q_OBJECT
public: public:
explicit S60DeviceDebugRunControl(S60DeviceRunConfiguration *runConfiguration, QString mode); explicit S60DeviceDebugRunControl(S60DeviceRunConfiguration *runConfiguration, QString mode);
virtual ~S60DeviceDebugRunControl(); virtual ~S60DeviceDebugRunControl();
virtual void start();
virtual void stop(); virtual void stop();
virtual bool isRunning() const;
protected: protected:
virtual void initLauncher(const QString &executable, trk::Launcher *);
virtual void handleLauncherFinished();
virtual bool checkConfiguration(QString *errorMessage, virtual bool checkConfiguration(QString *errorMessage,
QString *settingsCategory, QString *settingsCategory,
QString *settingsPage) const; QString *settingsPage) const;
private slots: private slots:
void debuggingFinished(); void debuggingFinished();
private:
protected:
QSharedPointer<Debugger::DebuggerStartParameters> m_startParams; QSharedPointer<Debugger::DebuggerStartParameters> m_startParams;
Debugger::DebuggerRunControl *m_debuggerRunControl; Debugger::DebuggerRunControl *m_debuggerRunControl;
QFutureInterface<void> *m_debugProgress;
QString m_localExecutableFileName; QString m_localExecutableFileName;
}; };