Maemo: Add prefix to run control class members.

This commit is contained in:
ck
2010-04-13 10:46:54 +02:00
parent 8a6040c739
commit 75b1fcdd66
2 changed files with 56 additions and 56 deletions

View File

@@ -73,16 +73,16 @@ void AbstractMaemoRunControl::startDeployment(bool forDebugging)
QTC_ASSERT(runConfig, return); QTC_ASSERT(runConfig, return);
if (devConfig.isValid()) { if (devConfig.isValid()) {
deployables.clear(); m_deployables.clear();
if (runConfig->currentlyNeedsDeployment(devConfig.host)) { if (runConfig->currentlyNeedsDeployment(devConfig.host)) {
deployables.append(Deployable(executableFileName(), m_deployables.append(Deployable(executableFileName(),
QFileInfo(executableOnHost()).canonicalPath(), QFileInfo(executableOnHost()).canonicalPath(),
&MaemoRunConfiguration::wasDeployed)); &MaemoRunConfiguration::wasDeployed));
} }
if (forDebugging if (forDebugging
&& runConfig->debuggingHelpersNeedDeployment(devConfig.host)) { && runConfig->debuggingHelpersNeedDeployment(devConfig.host)) {
const QFileInfo &info(runConfig->dumperLib()); const QFileInfo &info(runConfig->dumperLib());
deployables.append(Deployable(info.fileName(), info.canonicalPath(), m_deployables.append(Deployable(info.fileName(), info.canonicalPath(),
&MaemoRunConfiguration::debuggingHelpersDeployed)); &MaemoRunConfiguration::debuggingHelpersDeployed));
} }
@@ -99,10 +99,10 @@ void AbstractMaemoRunControl::deploy()
Core::ICore::instance()->progressManager() Core::ICore::instance()->progressManager()
->addTask(m_progress.future(), tr("Deploying"), ->addTask(m_progress.future(), tr("Deploying"),
QLatin1String("Maemo.Deploy")); QLatin1String("Maemo.Deploy"));
if (!deployables.isEmpty()) { if (!m_deployables.isEmpty()) {
QList<SshDeploySpec> deploySpecs; QList<SshDeploySpec> deploySpecs;
QStringList files; QStringList files;
foreach (const Deployable &deployable, deployables) { foreach (const Deployable &deployable, m_deployables) {
const QString srcFilePath const QString srcFilePath
= deployable.dir % QDir::separator() % deployable.fileName; = deployable.dir % QDir::separator() % deployable.fileName;
const QString tgtFilePath const QString tgtFilePath
@@ -111,16 +111,16 @@ void AbstractMaemoRunControl::deploy()
deploySpecs << SshDeploySpec(srcFilePath, tgtFilePath); deploySpecs << SshDeploySpec(srcFilePath, tgtFilePath);
} }
emit addToOutputWindow(this, tr("Files to deploy: %1.").arg(files.join(" "))); emit addToOutputWindow(this, tr("Files to deploy: %1.").arg(files.join(" ")));
sshDeployer.reset(new MaemoSshDeployer(devConfig, deploySpecs)); m_sshDeployer.reset(new MaemoSshDeployer(devConfig, deploySpecs));
connect(sshDeployer.data(), SIGNAL(finished()), connect(m_sshDeployer.data(), SIGNAL(finished()),
this, SLOT(deployProcessFinished())); this, SLOT(deployProcessFinished()));
connect(sshDeployer.data(), SIGNAL(fileCopied(QString)), connect(m_sshDeployer.data(), SIGNAL(fileCopied(QString)),
this, SLOT(handleFileCopied())); this, SLOT(handleFileCopied()));
m_progress.setProgressRange(0, deployables.count()); m_progress.setProgressRange(0, m_deployables.count());
m_progress.setProgressValue(0); m_progress.setProgressValue(0);
m_progress.reportStarted(); m_progress.reportStarted();
emit started(); emit started();
sshDeployer->start(); m_sshDeployer->start();
} else { } else {
m_progress.reportFinished(); m_progress.reportFinished();
handleDeploymentFinished(true); handleDeploymentFinished(true);
@@ -129,37 +129,37 @@ void AbstractMaemoRunControl::deploy()
void AbstractMaemoRunControl::handleFileCopied() void AbstractMaemoRunControl::handleFileCopied()
{ {
Deployable deployable = deployables.takeFirst(); Deployable deployable = m_deployables.takeFirst();
(runConfig->*deployable.updateTimestamp)(devConfig.host); (runConfig->*deployable.updateTimestamp)(devConfig.host);
m_progress.setProgressValue(m_progress.progressValue() + 1); m_progress.setProgressValue(m_progress.progressValue() + 1);
} }
void AbstractMaemoRunControl::stopDeployment() void AbstractMaemoRunControl::stopDeployment()
{ {
sshDeployer->stop(); m_sshDeployer->stop();
} }
bool AbstractMaemoRunControl::isDeploying() const bool AbstractMaemoRunControl::isDeploying() const
{ {
return sshDeployer && sshDeployer->isRunning(); return m_sshDeployer && m_sshDeployer->isRunning();
} }
void AbstractMaemoRunControl::run(const QString &remoteCall) void AbstractMaemoRunControl::run(const QString &remoteCall)
{ {
sshRunner.reset(new MaemoSshRunner(devConfig, remoteCall)); m_sshRunner.reset(new MaemoSshRunner(devConfig, remoteCall));
handleExecutionAboutToStart(sshRunner.data()); handleExecutionAboutToStart(m_sshRunner.data());
sshRunner->start(); m_sshRunner->start();
} }
bool AbstractMaemoRunControl::isRunning() const bool AbstractMaemoRunControl::isRunning() const
{ {
return isDeploying() || (sshRunner && sshRunner->isRunning()); return isDeploying() || (m_sshRunner && m_sshRunner->isRunning());
} }
void AbstractMaemoRunControl::stopRunning(bool forDebugging) void AbstractMaemoRunControl::stopRunning(bool forDebugging)
{ {
if (sshRunner && sshRunner->isRunning()) { if (m_sshRunner && m_sshRunner->isRunning()) {
sshRunner->stop(); m_sshRunner->stop();
QStringList apps(executableFileName()); QStringList apps(executableFileName());
if (forDebugging) if (forDebugging)
apps << QLatin1String("gdbserver"); apps << QLatin1String("gdbserver");
@@ -177,17 +177,17 @@ void AbstractMaemoRunControl::kill(const QStringList &apps)
} }
const QString remoteCall const QString remoteCall
= niceKill + QLatin1String("sleep 1; ") + brutalKill; = niceKill + QLatin1String("sleep 1; ") + brutalKill;
sshStopper.reset(new MaemoSshRunner(devConfig, remoteCall)); m_sshStopper.reset(new MaemoSshRunner(devConfig, remoteCall));
sshStopper->start(); m_sshStopper->start();
} }
void AbstractMaemoRunControl::deployProcessFinished() void AbstractMaemoRunControl::deployProcessFinished()
{ {
const bool success = !sshDeployer->hasError(); const bool success = !m_sshDeployer->hasError();
if (success) { if (success) {
emit addToOutputWindow(this, tr("Deployment finished.")); emit addToOutputWindow(this, tr("Deployment finished."));
} else { } else {
handleError(tr("Deployment failed: %1").arg(sshDeployer->error())); handleError(tr("Deployment failed: %1").arg(m_sshDeployer->error()));
m_progress.reportCanceled(); m_progress.reportCanceled();
} }
m_progress.reportFinished(); m_progress.reportFinished();
@@ -266,7 +266,7 @@ MaemoRunControl::~MaemoRunControl()
void MaemoRunControl::start() void MaemoRunControl::start()
{ {
stoppedByUser = false; m_stoppedByUser = false;
startDeployment(false); startDeployment(false);
} }
@@ -299,7 +299,7 @@ void MaemoRunControl::startExecution()
void MaemoRunControl::executionFinished() void MaemoRunControl::executionFinished()
{ {
MaemoSshRunner *runner = static_cast<MaemoSshRunner *>(sender()); MaemoSshRunner *runner = static_cast<MaemoSshRunner *>(sender());
if (stoppedByUser) { if (m_stoppedByUser) {
emit addToOutputWindow(this, tr("Remote process stopped by user.")); emit addToOutputWindow(this, tr("Remote process stopped by user."));
} else if (runner->hasError()) { } else if (runner->hasError()) {
emit addToOutputWindow(this, tr("Remote process exited with error: %1") emit addToOutputWindow(this, tr("Remote process exited with error: %1")
@@ -315,7 +315,7 @@ void MaemoRunControl::stop()
if (!isRunning()) if (!isRunning())
return; return;
stoppedByUser = true; m_stoppedByUser = true;
if (isDeploying()) { if (isDeploying()) {
stopDeployment(); stopDeployment();
} else { } else {
@@ -331,26 +331,26 @@ void MaemoRunControl::handleRemoteOutput(const QString &output)
MaemoDebugRunControl::MaemoDebugRunControl(RunConfiguration *runConfiguration) MaemoDebugRunControl::MaemoDebugRunControl(RunConfiguration *runConfiguration)
: AbstractMaemoRunControl(runConfiguration) : AbstractMaemoRunControl(runConfiguration)
, debuggerManager(ExtensionSystem::PluginManager::instance() , m_debuggerManager(ExtensionSystem::PluginManager::instance()
->getObject<Debugger::DebuggerManager>()) ->getObject<Debugger::DebuggerManager>())
, startParams(new Debugger::DebuggerStartParameters) , m_startParams(new Debugger::DebuggerStartParameters)
{ {
QTC_ASSERT(debuggerManager != 0, return); QTC_ASSERT(m_debuggerManager != 0, return);
startParams->startMode = Debugger::StartRemote; m_startParams->startMode = Debugger::StartRemote;
startParams->executable = executableOnHost(); m_startParams->executable = executableOnHost();
startParams->remoteChannel m_startParams->remoteChannel
= devConfig.host % QLatin1Char(':') % gdbServerPort(); = devConfig.host % QLatin1Char(':') % gdbServerPort();
startParams->remoteArchitecture = QLatin1String("arm"); m_startParams->remoteArchitecture = QLatin1String("arm");
startParams->sysRoot = runConfig->sysRoot(); m_startParams->sysRoot = runConfig->sysRoot();
startParams->toolChainType = ToolChain::GCC_MAEMO; m_startParams->toolChainType = ToolChain::GCC_MAEMO;
startParams->debuggerCommand = runConfig->gdbCmd(); m_startParams->debuggerCommand = runConfig->gdbCmd();
startParams->dumperLibrary = runConfig->dumperLib(); m_startParams->dumperLibrary = runConfig->dumperLib();
startParams->remoteDumperLib = QString::fromLocal8Bit("%1/%2") m_startParams->remoteDumperLib = QString::fromLocal8Bit("%1/%2")
.arg(remoteDir()).arg(QFileInfo(runConfig->dumperLib()).fileName()); .arg(remoteDir()).arg(QFileInfo(runConfig->dumperLib()).fileName());
connect(debuggerManager, SIGNAL(debuggingFinished()), this, connect(m_debuggerManager, SIGNAL(debuggingFinished()), this,
SLOT(debuggingFinished()), Qt::QueuedConnection); SLOT(debuggingFinished()), Qt::QueuedConnection);
connect(debuggerManager, SIGNAL(applicationOutputAvailable(QString)), connect(m_debuggerManager, SIGNAL(applicationOutputAvailable(QString)),
this, SLOT(debuggerOutput(QString)), Qt::QueuedConnection); this, SLOT(debuggerOutput(QString)), Qt::QueuedConnection);
} }
@@ -378,7 +378,7 @@ void MaemoDebugRunControl::handleDeploymentFinished(bool success)
void MaemoDebugRunControl::handleExecutionAboutToStart(const MaemoSshRunner *runner) void MaemoDebugRunControl::handleExecutionAboutToStart(const MaemoSshRunner *runner)
{ {
inferiorPid = -1; m_inferiorPid = -1;
connect(runner, SIGNAL(remoteOutput(QString)), connect(runner, SIGNAL(remoteOutput(QString)),
this, SLOT(gdbServerStarted(QString))); this, SLOT(gdbServerStarted(QString)));
} }
@@ -394,14 +394,14 @@ void MaemoDebugRunControl::startGdbServer()
void MaemoDebugRunControl::gdbServerStartFailed(const QString &reason) void MaemoDebugRunControl::gdbServerStartFailed(const QString &reason)
{ {
handleError(tr("Debugging failed: %1").arg(reason)); handleError(tr("Debugging failed: %1").arg(reason));
debuggerManager->exitDebugger(); m_debuggerManager->exitDebugger();
emit finished(); emit finished();
} }
void MaemoDebugRunControl::gdbServerStarted(const QString &output) void MaemoDebugRunControl::gdbServerStarted(const QString &output)
{ {
qDebug("gdbserver's stderr output: %s", output.toLatin1().data()); qDebug("gdbserver's stderr output: %s", output.toLatin1().data());
if (inferiorPid != -1) if (m_inferiorPid != -1)
return; return;
const QString searchString("pid = "); const QString searchString("pid = ");
const int searchStringLength = searchString.length(); const int searchStringLength = searchString.length();
@@ -421,15 +421,15 @@ void MaemoDebugRunControl::gdbServerStarted(const QString &output)
"server pid!")); "server pid!"));
return; return;
} }
inferiorPid = pid; m_inferiorPid = pid;
qDebug("inferiorPid = %d", inferiorPid); qDebug("inferiorPid = %d", m_inferiorPid);
startDebugging(); startDebugging();
} }
void MaemoDebugRunControl::startDebugging() void MaemoDebugRunControl::startDebugging()
{ {
debuggerManager->startNewDebugger(startParams); m_debuggerManager->startNewDebugger(m_startParams);
} }
void MaemoDebugRunControl::stop() void MaemoDebugRunControl::stop()
@@ -440,14 +440,14 @@ void MaemoDebugRunControl::stop()
if (isDeploying()) { if (isDeploying()) {
stopDeployment(); stopDeployment();
} else { } else {
debuggerManager->exitDebugger(); m_debuggerManager->exitDebugger();
} }
} }
bool MaemoDebugRunControl::isRunning() const bool MaemoDebugRunControl::isRunning() const
{ {
return AbstractMaemoRunControl::isRunning() return AbstractMaemoRunControl::isRunning()
|| debuggerManager->state() != Debugger::DebuggerNotReady; || m_debuggerManager->state() != Debugger::DebuggerNotReady;
} }
void MaemoDebugRunControl::debuggingFinished() void MaemoDebugRunControl::debuggingFinished()

View File

@@ -97,9 +97,9 @@ private:
void kill(const QStringList &apps); void kill(const QStringList &apps);
QFutureInterface<void> m_progress; QFutureInterface<void> m_progress;
QScopedPointer<MaemoSshDeployer> sshDeployer; QScopedPointer<MaemoSshDeployer> m_sshDeployer;
QScopedPointer<MaemoSshRunner> sshRunner; QScopedPointer<MaemoSshRunner> m_sshRunner;
QScopedPointer<MaemoSshRunner> sshStopper; QScopedPointer<MaemoSshRunner> m_sshStopper;
struct Deployable struct Deployable
{ {
@@ -110,7 +110,7 @@ private:
QString dir; QString dir;
updateFunc updateTimestamp; updateFunc updateTimestamp;
}; };
QList<Deployable> deployables; QList<Deployable> m_deployables;
}; };
class MaemoRunControl : public AbstractMaemoRunControl class MaemoRunControl : public AbstractMaemoRunControl
@@ -131,7 +131,7 @@ private:
virtual void handleExecutionAboutToStart(const MaemoSshRunner *runner); virtual void handleExecutionAboutToStart(const MaemoSshRunner *runner);
void startExecution(); void startExecution();
bool stoppedByUser; bool m_stoppedByUser;
}; };
class MaemoDebugRunControl : public AbstractMaemoRunControl class MaemoDebugRunControl : public AbstractMaemoRunControl
@@ -158,9 +158,9 @@ private:
void gdbServerStartFailed(const QString &reason); void gdbServerStartFailed(const QString &reason);
void startDebugging(); void startDebugging();
Debugger::DebuggerManager *debuggerManager; Debugger::DebuggerManager *m_debuggerManager;
QSharedPointer<Debugger::DebuggerStartParameters> startParams; QSharedPointer<Debugger::DebuggerStartParameters> m_startParams;
int inferiorPid; int m_inferiorPid;
}; };
} // namespace Internal } // namespace Internal