From 5199f84f60ed07d75bb071ba2d2de375adeefec7 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 27 Jun 2016 16:40:23 +0200 Subject: [PATCH] Debugger: Clean up debuggerengine.cpp Some leftover stringfreeze workaround, plus QLatin1*. Change-Id: I5e143af5cda64cb29b7769174187fc86185a89cb Reviewed-by: Orgad Shaneh --- src/plugins/debugger/debuggerengine.cpp | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 8cb0ea8a2d1..8aa4c3aaddc 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -37,7 +37,6 @@ #include "logwindow.h" #include "memoryagent.h" #include "moduleshandler.h" -#include "gdb/gdbengine.h" // REMOVE #include "registerhandler.h" #include "sourcefileshandler.h" #include "sourceutils.h" @@ -564,7 +563,7 @@ void DebuggerEngine::startDebugger(DebuggerRunControl *runControl) d->m_runControl->setApplicationProcessHandle(ProcessHandle(d->m_inferiorPid)); if (isNativeMixedActive()) - d->m_runParameters.inferior.environment.set(QLatin1String("QV4_FORCE_INTERPRETER"), QLatin1String("1")); + d->m_runParameters.inferior.environment.set("QV4_FORCE_INTERPRETER", "1"); action(OperateByInstruction)->setEnabled(hasCapability(DisassemblerCapability)); @@ -609,7 +608,7 @@ void DebuggerEngine::gotoLocation(const Location &loc) } if (loc.fileName().isEmpty()) { - showMessage(QLatin1String("CANNOT GO TO THIS LOCATION")); + showMessage("CANNOT GO TO THIS LOCATION"); return; } const QString file = QDir::cleanPath(loc.fileName()); @@ -633,7 +632,7 @@ void DebuggerEngine::gotoLocation(const Location &loc) // Called from RunControl. void DebuggerEngine::handleStartFailed() { - showMessage(QLatin1String("HANDLE RUNCONTROL START FAILED")); + showMessage("HANDLE RUNCONTROL START FAILED"); d->m_runControl = 0; d->m_progress.setProgressValue(900); d->m_progress.reportCanceled(); @@ -643,7 +642,7 @@ void DebuggerEngine::handleStartFailed() // Called from RunControl. void DebuggerEngine::handleFinished() { - showMessage(QLatin1String("HANDLE RUNCONTROL FINISHED")); + showMessage("HANDLE RUNCONTROL FINISHED"); d->m_runControl = 0; d->m_progress.setProgressValue(1000); d->m_progress.reportFinished(); @@ -905,7 +904,7 @@ void DebuggerEngine::notifyEngineRemoteSetupFinished(const RemoteSetupResult &re if (result.gdbServerPort.isValid()) { QString &rc = d->m_runParameters.remoteChannel; - const int sepIndex = rc.lastIndexOf(QLatin1Char(':')); + const int sepIndex = rc.lastIndexOf(':'); if (sepIndex != -1) { rc.replace(sepIndex + 1, rc.count() - sepIndex - 1, QString::number(result.gdbServerPort.number())); @@ -1785,9 +1784,9 @@ QString DebuggerEngine::msgInterrupted() void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name) { if (name.isEmpty()) - name = QLatin1Char(' ') + tr("", "name") + QLatin1Char(' '); + name = ' ' + tr("", "name") + ' '; if (meaning.isEmpty()) - meaning = QLatin1Char(' ') + tr("", "meaning") + QLatin1Char(' '); + meaning = ' ' + tr("", "meaning") + ' '; const QString msg = tr("

The inferior stopped because it received a " "signal from the operating system.

" "" @@ -1856,14 +1855,14 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp) "experience for this binary format."); return; } else if (warnOnRelease) { - if (!symbolFile.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive)) - symbolFile.append(QLatin1String(".exe")); + if (!symbolFile.endsWith(".exe", Qt::CaseInsensitive)) + symbolFile.append(".exe"); QString errorMessage; QStringList rc; if (getPDBFiles(symbolFile, &rc, &errorMessage) && !rc.isEmpty()) return; if (!errorMessage.isEmpty()) { - detailedWarning.append(QLatin1Char('\n')); + detailedWarning.append('\n'); detailedWarning.append(errorMessage); } } else { @@ -1979,12 +1978,12 @@ void DebuggerEngine::validateExecutable(DebuggerRunParameters *sp) tr("The selected debugger may be inappropiate for the inferior.\n" "Examining symbols and setting breakpoints by file name and line number " "may fail.\n") - + QLatin1Char('\n') + detailedWarning); + + '\n' + detailedWarning); } else if (warnOnRelease) { AsynchronousMessageBox::information(tr("Warning"), tr("This does not seem to be a \"Debug\" build.\n" "Setting breakpoints by file name and line number may fail.") - + QLatin1Char('\n') + detailedWarning); + + '\n' + detailedWarning); } } @@ -2007,7 +2006,7 @@ void DebuggerEngine::updateLocalsView(const GdbMi &all) static int count = 0; showMessage(QString("") .arg(++count).arg(LogWindow::logTimeStamp()), LogMiscInput); - showStatusMessage(GdbEngine::tr("Finished retrieving data"), 400); // FIXME: String + showStatusMessage(tr("Finished retrieving data"), 400); DebuggerToolTipManager::updateEngine(this);
Signal name : %1