Maemo: Rename some run control symbols.

Rename function to better reflect its meaning.
Add prefix to class members.
This commit is contained in:
ck
2010-04-13 12:16:47 +02:00
parent 5117767551
commit c7cee130d8
2 changed files with 35 additions and 35 deletions

View File

@@ -59,8 +59,8 @@ using ProjectExplorer::ToolChain;
AbstractMaemoRunControl::AbstractMaemoRunControl(RunConfiguration *rc) AbstractMaemoRunControl::AbstractMaemoRunControl(RunConfiguration *rc)
: RunControl(rc) : RunControl(rc)
, runConfig(qobject_cast<MaemoRunConfiguration *>(rc)) , m_runConfig(qobject_cast<MaemoRunConfiguration *>(rc))
, devConfig(runConfig ? runConfig->deviceConfig() : MaemoDeviceConfig()) , m_devConfig(m_runConfig ? m_runConfig->deviceConfig() : MaemoDeviceConfig())
{ {
} }
@@ -82,20 +82,20 @@ void AbstractMaemoRunControl::stop()
void AbstractMaemoRunControl::startDeployment(bool forDebugging) void AbstractMaemoRunControl::startDeployment(bool forDebugging)
{ {
QTC_ASSERT(runConfig, return); QTC_ASSERT(m_runConfig, return);
if (m_stoppedByUser) { if (m_stoppedByUser) {
handleDeploymentFinished(false); handleDeploymentFinished(false);
} else if (devConfig.isValid()) { } else if (m_devConfig.isValid()) {
m_deployables.clear(); m_deployables.clear();
if (runConfig->currentlyNeedsDeployment(devConfig.host)) { if (m_runConfig->currentlyNeedsDeployment(m_devConfig.host)) {
m_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)) { && m_runConfig->debuggingHelpersNeedDeployment(m_devConfig.host)) {
const QFileInfo &info(runConfig->dumperLib()); const QFileInfo &info(m_runConfig->dumperLib());
m_deployables.append(Deployable(info.fileName(), info.canonicalPath(), m_deployables.append(Deployable(info.fileName(), info.canonicalPath(),
&MaemoRunConfiguration::debuggingHelpersDeployed)); &MaemoRunConfiguration::debuggingHelpersDeployed));
} }
@@ -125,9 +125,9 @@ 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(" ")));
m_sshDeployer.reset(new MaemoSshDeployer(devConfig, deploySpecs)); m_sshDeployer.reset(new MaemoSshDeployer(m_devConfig, deploySpecs));
connect(m_sshDeployer.data(), SIGNAL(finished()), connect(m_sshDeployer.data(), SIGNAL(finished()),
this, SLOT(deployProcessFinished())); this, SLOT(deployThreadFinished()));
connect(m_sshDeployer.data(), SIGNAL(fileCopied(QString)), connect(m_sshDeployer.data(), SIGNAL(fileCopied(QString)),
this, SLOT(handleFileCopied())); this, SLOT(handleFileCopied()));
m_progress.setProgressRange(0, m_deployables.count()); m_progress.setProgressRange(0, m_deployables.count());
@@ -144,7 +144,7 @@ void AbstractMaemoRunControl::deploy()
void AbstractMaemoRunControl::handleFileCopied() void AbstractMaemoRunControl::handleFileCopied()
{ {
Deployable deployable = m_deployables.takeFirst(); Deployable deployable = m_deployables.takeFirst();
(runConfig->*deployable.updateTimestamp)(devConfig.host); (m_runConfig->*deployable.updateTimestamp)(m_devConfig.host);
m_progress.setProgressValue(m_progress.progressValue() + 1); m_progress.setProgressValue(m_progress.progressValue() + 1);
} }
@@ -160,7 +160,7 @@ bool AbstractMaemoRunControl::isDeploying() const
void AbstractMaemoRunControl::run(const QString &remoteCall) void AbstractMaemoRunControl::run(const QString &remoteCall)
{ {
m_sshRunner.reset(new MaemoSshRunner(devConfig, remoteCall)); m_sshRunner.reset(new MaemoSshRunner(m_devConfig, remoteCall));
handleExecutionAboutToStart(m_sshRunner.data()); handleExecutionAboutToStart(m_sshRunner.data());
m_sshRunner->start(); m_sshRunner->start();
} }
@@ -191,11 +191,11 @@ void AbstractMaemoRunControl::kill(const QStringList &apps)
} }
const QString remoteCall const QString remoteCall
= niceKill + QLatin1String("sleep 1; ") + brutalKill; = niceKill + QLatin1String("sleep 1; ") + brutalKill;
m_sshStopper.reset(new MaemoSshRunner(devConfig, remoteCall)); m_sshStopper.reset(new MaemoSshRunner(m_devConfig, remoteCall));
m_sshStopper->start(); m_sshStopper->start();
} }
void AbstractMaemoRunControl::deployProcessFinished() void AbstractMaemoRunControl::deployThreadFinished()
{ {
const bool success = !m_sshDeployer->hasError(); const bool success = !m_sshDeployer->hasError();
if (m_stoppedByUser) { if (m_stoppedByUser) {
@@ -213,15 +213,15 @@ void AbstractMaemoRunControl::deployProcessFinished()
const QString AbstractMaemoRunControl::executableOnHost() const const QString AbstractMaemoRunControl::executableOnHost() const
{ {
qDebug("runconfig->executable: %s", qPrintable(runConfig->executable())); qDebug("runconfig->executable: %s", qPrintable(m_runConfig->executable()));
return runConfig->executable(); return m_runConfig->executable();
} }
const QString AbstractMaemoRunControl::sshPort() const const QString AbstractMaemoRunControl::sshPort() const
{ {
return devConfig.type == MaemoDeviceConfig::Physical return m_devConfig.type == MaemoDeviceConfig::Physical
? QString::number(devConfig.sshPort) ? QString::number(m_devConfig.sshPort)
: runConfig->simulatorSshPort(); : m_runConfig->simulatorSshPort();
} }
const QString AbstractMaemoRunControl::executableFileName() const const QString AbstractMaemoRunControl::executableFileName() const
@@ -231,23 +231,23 @@ const QString AbstractMaemoRunControl::executableFileName() const
const QString AbstractMaemoRunControl::remoteDir() const const QString AbstractMaemoRunControl::remoteDir() const
{ {
return homeDirOnDevice(devConfig.uname); return homeDirOnDevice(m_devConfig.uname);
} }
const QStringList AbstractMaemoRunControl::options() const const QStringList AbstractMaemoRunControl::options() const
{ {
const bool usePassword const bool usePassword
= devConfig.authentication == MaemoDeviceConfig::Password; = m_devConfig.authentication == MaemoDeviceConfig::Password;
const QLatin1String opt("-o"); const QLatin1String opt("-o");
QStringList optionList; QStringList optionList;
if (!usePassword) if (!usePassword)
optionList << QLatin1String("-i") << devConfig.keyFile; optionList << QLatin1String("-i") << m_devConfig.keyFile;
return optionList << opt return optionList << opt
<< QString::fromLatin1("PasswordAuthentication=%1"). << QString::fromLatin1("PasswordAuthentication=%1").
arg(usePassword ? "yes" : "no") << opt arg(usePassword ? "yes" : "no") << opt
<< QString::fromLatin1("PubkeyAuthentication=%1"). << QString::fromLatin1("PubkeyAuthentication=%1").
arg(usePassword ? "no" : "yes") << opt arg(usePassword ? "no" : "yes") << opt
<< QString::fromLatin1("ConnectTimeout=%1").arg(devConfig.timeout) << QString::fromLatin1("ConnectTimeout=%1").arg(m_devConfig.timeout)
<< opt << QLatin1String("CheckHostIP=no") << opt << QLatin1String("CheckHostIP=no")
<< opt << QLatin1String("StrictHostKeyChecking=no"); << opt << QLatin1String("StrictHostKeyChecking=no");
} }
@@ -308,7 +308,7 @@ void MaemoRunControl::startExecution()
{ {
const QString remoteCall = QString::fromLocal8Bit("%1 %2 %3") const QString remoteCall = QString::fromLocal8Bit("%1 %2 %3")
.arg(targetCmdLinePrefix()).arg(executableOnTarget()) .arg(targetCmdLinePrefix()).arg(executableOnTarget())
.arg(runConfig->arguments().join(" ")); .arg(m_runConfig->arguments().join(" "));
run(remoteCall); run(remoteCall);
} }
@@ -353,14 +353,14 @@ MaemoDebugRunControl::MaemoDebugRunControl(RunConfiguration *runConfiguration)
m_startParams->startMode = Debugger::StartRemote; m_startParams->startMode = Debugger::StartRemote;
m_startParams->executable = executableOnHost(); m_startParams->executable = executableOnHost();
m_startParams->remoteChannel m_startParams->remoteChannel
= devConfig.host % QLatin1Char(':') % gdbServerPort(); = m_devConfig.host % QLatin1Char(':') % gdbServerPort();
m_startParams->remoteArchitecture = QLatin1String("arm"); m_startParams->remoteArchitecture = QLatin1String("arm");
m_startParams->sysRoot = runConfig->sysRoot(); m_startParams->sysRoot = m_runConfig->sysRoot();
m_startParams->toolChainType = ToolChain::GCC_MAEMO; m_startParams->toolChainType = ToolChain::GCC_MAEMO;
m_startParams->debuggerCommand = runConfig->gdbCmd(); m_startParams->debuggerCommand = m_runConfig->gdbCmd();
m_startParams->dumperLibrary = runConfig->dumperLib(); m_startParams->dumperLibrary = m_runConfig->dumperLib();
m_startParams->remoteDumperLib = QString::fromLocal8Bit("%1/%2") m_startParams->remoteDumperLib = QString::fromLocal8Bit("%1/%2")
.arg(remoteDir()).arg(QFileInfo(runConfig->dumperLib()).fileName()); .arg(remoteDir()).arg(QFileInfo(m_runConfig->dumperLib()).fileName());
connect(m_debuggerManager, SIGNAL(debuggingFinished()), this, connect(m_debuggerManager, SIGNAL(debuggingFinished()), this,
SLOT(debuggingFinished()), Qt::QueuedConnection); SLOT(debuggingFinished()), Qt::QueuedConnection);
@@ -401,7 +401,7 @@ void MaemoDebugRunControl::startGdbServer()
{ {
const QString remoteCall(QString::fromLocal8Bit("%1 gdbserver :%2 %3 %4"). const QString remoteCall(QString::fromLocal8Bit("%1 gdbserver :%2 %3 %4").
arg(targetCmdLinePrefix()).arg(gdbServerPort()) arg(targetCmdLinePrefix()).arg(gdbServerPort())
.arg(executableOnTarget()).arg(runConfig->arguments().join(" "))); .arg(executableOnTarget()).arg(m_runConfig->arguments().join(" ")));
run(remoteCall); run(remoteCall);
} }
@@ -476,9 +476,9 @@ void MaemoDebugRunControl::debuggerOutput(const QString &output)
QString MaemoDebugRunControl::gdbServerPort() const QString MaemoDebugRunControl::gdbServerPort() const
{ {
return devConfig.type == MaemoDeviceConfig::Physical return m_devConfig.type == MaemoDeviceConfig::Physical
? QString::number(devConfig.gdbServerPort) ? QString::number(m_devConfig.gdbServerPort)
: runConfig->simulatorGdbServerPort(); : m_runConfig->simulatorGdbServerPort();
} }
} // namespace Internal } // namespace Internal

View File

@@ -86,12 +86,12 @@ protected:
const QString remoteDir() const; const QString remoteDir() const;
const QStringList options() const; const QStringList options() const;
private slots: private slots:
void deployProcessFinished(); void deployThreadFinished();
void handleFileCopied(); void handleFileCopied();
protected: protected:
MaemoRunConfiguration *runConfig; // TODO this pointer can be invalid MaemoRunConfiguration *m_runConfig; // TODO this pointer can be invalid
const MaemoDeviceConfig devConfig; const MaemoDeviceConfig m_devConfig;
bool m_stoppedByUser; bool m_stoppedByUser;
private: private: