Commit 1b1663a2 authored by hjk's avatar hjk

introduce a appendMessage overload not requiring the 'this' parameter

parent 4170843f
......@@ -445,12 +445,12 @@ void DebuggerRunControl::start()
d->m_engine->startDebugger(this);
if (d->m_running)
emit appendMessage(this, tr("Debugging starts"), NormalMessageFormat);
appendMessage(tr("Debugging starts"), NormalMessageFormat);
}
void DebuggerRunControl::startFailed()
{
emit appendMessage(this, tr("Debugging has failed"), NormalMessageFormat);
appendMessage(tr("Debugging has failed"), NormalMessageFormat);
d->m_running = false;
emit finished();
d->m_engine->handleStartFailed();
......@@ -458,7 +458,7 @@ void DebuggerRunControl::startFailed()
void DebuggerRunControl::handleFinished()
{
emit appendMessage(this, tr("Debugging has finished"), NormalMessageFormat);
appendMessage(tr("Debugging has finished"), NormalMessageFormat);
if (d->m_engine)
d->m_engine->handleFinished();
debuggerCore()->runControlFinished(d->m_engine);
......@@ -468,13 +468,13 @@ void DebuggerRunControl::showMessage(const QString &msg, int channel)
{
switch (channel) {
case AppOutput:
emit appendMessage(this, msg, StdOutFormatSameLine);
appendMessage(msg, StdOutFormatSameLine);
break;
case AppError:
emit appendMessage(this, msg, StdErrFormatSameLine);
appendMessage(msg, StdErrFormatSameLine);
break;
case AppStuff:
emit appendMessage(this, msg, NormalMessageFormat);
appendMessage(msg, NormalMessageFormat);
break;
}
}
......@@ -648,7 +648,7 @@ DebuggerRunControl *DebuggerRunControlFactory::create
if (!DebuggerRunControl::checkDebugConfiguration(sp.toolChainType,
&errorMessage, &settingsCategory, &settingsPage)) {
//emit appendMessage(this, errorMessage, true);
//appendMessage(errorMessage, true);
Core::ICore::instance()->showWarningWithOptions(tr("Debugger"),
errorMessage, QString(), settingsCategory, settingsPage);
return 0;
......
......@@ -108,7 +108,7 @@ void LocalApplicationRunControl::start()
emit started();
QString msg = tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable));
emit appendMessage(this, msg, NormalMessageFormat);
appendMessage(msg, NormalMessageFormat);
}
LocalApplicationRunControl::StopResult LocalApplicationRunControl::stop()
......@@ -125,14 +125,14 @@ bool LocalApplicationRunControl::isRunning() const
void LocalApplicationRunControl::slotAppendMessage(const QString &err,
OutputFormat format)
{
emit appendMessage(this, err, format);
appendMessage(err, format);
}
void LocalApplicationRunControl::processExited(int exitCode)
{
QString msg = tr("%1 exited with code %2")
.arg(QDir::toNativeSeparators(m_executable)).arg(exitCode);
emit appendMessage(this, msg, ErrorMessageFormat);
appendMessage(msg, ErrorMessageFormat);
emit finished();
}
......
......@@ -367,3 +367,8 @@ void RunControl::bringApplicationToForegroundInternal()
}
#endif
}
void RunControl::appendMessage(const QString &msg, OutputFormat format)
{
emit appendMessage(this, msg, format);
}
......@@ -201,16 +201,16 @@ public:
OutputFormatter *outputFormatter();
QString runMode() const;
public slots:
void bringApplicationToForeground(qint64 pid);
void appendMessage(const QString &msg, ProjectExplorer::OutputFormat format);
signals:
void appendMessage(ProjectExplorer::RunControl *, const QString &error,
ProjectExplorer::OutputFormat);
void appendMessage(ProjectExplorer::RunControl *runControl,
const QString &msg, ProjectExplorer::OutputFormat format);
void started();
void finished();
public slots:
void bringApplicationToForeground(qint64 pid);
void appendMessage(const QString &error, ProjectExplorer::OutputFormat);
private slots:
void bringApplicationToForegroundInternal();
......
......@@ -98,7 +98,7 @@ void QmlRunControl::start()
emit started();
QString msg = tr("Starting %1 %2")
.arg(QDir::toNativeSeparators(m_executable), m_commandLineArguments);
appendMessage(this, msg, NormalMessageFormat);
appendMessage(msg, NormalMessageFormat);
}
RunControl::StopResult QmlRunControl::stop()
......@@ -119,14 +119,14 @@ void QmlRunControl::slotBringApplicationToForeground(qint64 pid)
void QmlRunControl::slotAppendMessage(const QString &line, OutputFormat format)
{
emit appendMessage(this, line, format);
appendMessage(line, format);
}
void QmlRunControl::processExited(int exitCode)
{
QString msg = tr("%1 exited with code %2")
.arg(QDir::toNativeSeparators(m_executable)).arg(exitCode);
emit appendMessage(this, msg, exitCode ? ErrorMessageFormat : NormalMessageFormat);
appendMessage(msg, exitCode ? ErrorMessageFormat : NormalMessageFormat);
emit finished();
}
......
......@@ -100,7 +100,7 @@ void MaemoRunControl::handleSshError(const QString &error)
void MaemoRunControl::startExecution()
{
emit appendMessage(this, tr("Starting remote process ..."), NormalMessageFormat);
appendMessage(tr("Starting remote process ..."), NormalMessageFormat);
m_runner->startExecution(QString::fromLocal8Bit("%1 %2 %3 %4")
.arg(MaemoGlobal::remoteCommandPrefix(m_runner->remoteExecutable()))
.arg(MaemoGlobal::remoteEnvironment(m_runner->userEnvChanges()))
......@@ -111,8 +111,7 @@ void MaemoRunControl::startExecution()
void MaemoRunControl::handleRemoteProcessFinished(qint64 exitCode)
{
if (exitCode != MaemoSshRunner::InvalidExitCode) {
emit appendMessage(this,
tr("Finished running remote process. Exit code was %1.")
appendMessage(tr("Finished running remote process. Exit code was %1.")
.arg(exitCode), NormalMessageFormat);
}
setFinished();
......@@ -120,22 +119,22 @@ void MaemoRunControl::handleRemoteProcessFinished(qint64 exitCode)
void MaemoRunControl::handleRemoteOutput(const QByteArray &output)
{
emit appendMessage(this, QString::fromUtf8(output), StdOutFormatSameLine);
appendMessage(QString::fromUtf8(output), StdOutFormatSameLine);
}
void MaemoRunControl::handleRemoteErrorOutput(const QByteArray &output)
{
emit appendMessage(this, QString::fromUtf8(output), StdErrFormatSameLine);
appendMessage(QString::fromUtf8(output), StdErrFormatSameLine);
}
void MaemoRunControl::handleProgressReport(const QString &progressString)
{
emit appendMessage(this, progressString, NormalMessageFormat);
appendMessage(progressString, NormalMessageFormat);
}
void MaemoRunControl::handleMountDebugOutput(const QString &output)
{
emit appendMessage(this, output, StdErrFormatSameLine);
appendMessage(output, StdErrFormatSameLine);
}
bool MaemoRunControl::isRunning() const
......@@ -146,7 +145,7 @@ bool MaemoRunControl::isRunning() const
void MaemoRunControl::handleError(const QString &errString)
{
stop();
emit appendMessage(this, errString, ErrorMessageFormat);
appendMessage(errString, ErrorMessageFormat);
QMessageBox::critical(0, tr("Remote Execution Failure"), errString);
}
......
......@@ -542,12 +542,12 @@ void S60DeviceRunControl::start()
if (m_serialPortName.isEmpty()) {
m_launchProgress->reportCanceled();
QString msg = tr("No device is connected. Please connect a device and try again.");
appendMessage(this, msg, NormalMessageFormat);
appendMessage(msg, NormalMessageFormat);
emit finished();
return;
}
emit appendMessage(this, tr("Executable file: %1").arg(msgListFile(m_executableFileName)),
appendMessage(tr("Executable file: %1").arg(msgListFile(m_executableFileName)),
NormalMessageFormat);
QString errorMessage;
......@@ -555,7 +555,7 @@ void S60DeviceRunControl::start()
QString settingsPage;
if (!checkConfiguration(&errorMessage, &settingsCategory, &settingsPage)) {
m_launchProgress->reportCanceled();
appendMessage(this, errorMessage, ErrorMessageFormat);
appendMessage(errorMessage, ErrorMessageFormat);
emit finished();
Core::ICore::instance()->showWarningWithOptions(tr("Debugger for Symbian Platform"),
errorMessage, QString(),
......@@ -588,7 +588,7 @@ void S60DeviceRunControl::startLaunching()
m_launchProgress->setProgressValue(PROGRESS_MAX/2);
} else {
if (!errorMessage.isEmpty())
appendMessage(this, errorMessage, ErrorMessageFormat);
appendMessage(errorMessage, ErrorMessageFormat);
stop();
emit finished();
}
......@@ -629,7 +629,7 @@ bool S60DeviceRunControl::setupLauncher(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),
appendMessage(tr("Could not connect to App TRK on device: %1. Restarting App TRK might help.").arg(errorMessage),
ErrorMessageFormat);
}
......@@ -652,7 +652,7 @@ void S60DeviceRunControl::reportDeployFinished()
void S60DeviceRunControl::processStopped(uint pc, uint pid, uint tid, const QString &reason)
{
appendMessage(this, trk::Launcher::msgStopped(pid, tid, pc, reason), StdOutFormat);
appendMessage(trk::Launcher::msgStopped(pid, tid, pc, reason), StdOutFormat);
m_launcher->terminate();
}
......@@ -683,7 +683,7 @@ void S60DeviceRunControl::slotWaitingForTrkClosed()
{
if (m_launcher && m_launcher->state() == trk::Launcher::WaitingForTrk) {
stop();
appendMessage(this, tr("Canceled."), ErrorMessageFormat);
appendMessage(tr("Canceled."), ErrorMessageFormat);
emit finished();
}
}
......@@ -695,7 +695,7 @@ void S60DeviceRunControl::printApplicationOutput(const QString &output)
void S60DeviceRunControl::printApplicationOutput(const QString &output, bool onStdErr)
{
appendMessage(this, output, onStdErr ? StdErrFormat : StdOutFormat);
appendMessage(output, onStdErr ? StdErrFormat : StdOutFormat);
}
void S60DeviceRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &d)
......@@ -705,7 +705,7 @@ void S60DeviceRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &d)
m_launcher->deleteLater();
m_launcher = 0;
QString msg = tr("The device '%1' has been disconnected").arg(d.friendlyName());
appendMessage(this, msg, ErrorMessageFormat);
appendMessage(msg, ErrorMessageFormat);
emit finished();
}
}
......@@ -730,24 +730,24 @@ void S60DeviceRunControl::initLauncher(const QString &executable, trk::Launcher
void S60DeviceRunControl::handleLauncherFinished()
{
emit finished();
emit appendMessage(this, tr("Finished."), NormalMessageFormat);
appendMessage(tr("Finished."), NormalMessageFormat);
}
void S60DeviceRunControl::printStartingNotice()
{
emit appendMessage(this, tr("Starting application..."), NormalMessageFormat);
appendMessage(tr("Starting application..."), NormalMessageFormat);
}
void S60DeviceRunControl::applicationRunNotice(uint pid)
{
emit appendMessage(this, tr("Application running with pid %1.").arg(pid), NormalMessageFormat);
appendMessage(tr("Application running with pid %1.").arg(pid), NormalMessageFormat);
if (m_launchProgress)
m_launchProgress->setProgressValue(PROGRESS_MAX);
}
void S60DeviceRunControl::applicationRunFailedNotice(const QString &errorMessage)
{
emit appendMessage(this, tr("Could not start application: %1").arg(errorMessage), NormalMessageFormat);
appendMessage(tr("Could not start application: %1").arg(errorMessage), NormalMessageFormat);
}
// ======== S60DeviceDebugRunControl
......@@ -812,7 +812,7 @@ S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc
if (startParameters().symbolFileName.isEmpty()) {
const QString msg = tr("Warning: Cannot locate the symbol file belonging to %1.").
arg(localExecutable(rc));
emit appendMessage(this, msg, ErrorMessageFormat);
appendMessage(msg, ErrorMessageFormat);
}
}
......@@ -823,7 +823,7 @@ void S60DeviceDebugRunControl::start()
QString settingsPage;
if (!Debugger::DebuggerRunControl::checkDebugConfiguration(startParameters().toolChainType,
&errorMessage, &settingsCategory, &settingsPage)) {
appendMessage(this, errorMessage, ErrorMessageFormat);
appendMessage(errorMessage, ErrorMessageFormat);
emit finished();
Core::ICore::instance()->showWarningWithOptions(tr("Debugger for Symbian Platform"),
errorMessage, QString(),
......@@ -831,6 +831,6 @@ void S60DeviceDebugRunControl::start()
return;
}
emit appendMessage(this, tr("Launching debugger..."), NormalMessageFormat);
appendMessage(tr("Launching debugger..."), NormalMessageFormat);
Debugger::DebuggerRunControl::start();
}
......@@ -349,7 +349,7 @@ void S60EmulatorRunControl::start()
emit started();
QString msg = tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable));
emit appendMessage(this, msg, NormalMessageFormat);
appendMessage(msg, NormalMessageFormat);
}
RunControl::StopResult S60EmulatorRunControl::stop()
......@@ -365,7 +365,7 @@ bool S60EmulatorRunControl::isRunning() const
void S60EmulatorRunControl::slotError(const QString & err)
{
emit appendMessage(this, err, ErrorMessageFormat);
appendMessage(err, ErrorMessageFormat);
emit finished();
}
......@@ -375,12 +375,12 @@ void S60EmulatorRunControl::slotAppendMessage(const QString &line, OutputFormat
static int prefixLength = prefix.length();
int index = line.indexOf(prefix);
if (index != -1)
emit appendMessage(this, line.mid(index + prefixLength + 1), format);
appendMessage(line.mid(index + prefixLength + 1), format);
}
void S60EmulatorRunControl::processExited(int exitCode)
{
QString msg = tr("%1 exited with code %2");
emit appendMessage(this, msg, exitCode ? ErrorMessageFormat : NormalMessageFormat);
appendMessage(msg, exitCode ? ErrorMessageFormat : NormalMessageFormat);
emit finished();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment