From b9d15b113f257f491ef7294d646625392fa06294 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Thu, 16 Feb 2012 11:12:02 +0100 Subject: [PATCH] debugger: remove a few too-fancy typedefs Change-Id: I0c8ba3c2d22ca7128527da42b81919dabbd82d14 Reviewed-by: hjk <qthjk@ovi.com> --- src/plugins/debugger/debuggerdialogs.cpp | 2 +- src/plugins/debugger/debuggerplugin.cpp | 18 +++++++-------- src/plugins/debugger/debuggerrunner.cpp | 2 +- src/plugins/debugger/debuggerstringutils.h | 2 -- src/plugins/debugger/gdb/classicgdbengine.cpp | 6 ++--- src/plugins/debugger/gdb/coregdbadapter.cpp | 2 +- src/plugins/debugger/gdb/gdbengine.cpp | 22 +++++++++---------- src/plugins/debugger/watchutils.cpp | 2 +- 8 files changed, 27 insertions(+), 29 deletions(-) diff --git a/src/plugins/debugger/debuggerdialogs.cpp b/src/plugins/debugger/debuggerdialogs.cpp index bec4eae50cc..2e86f8dcad8 100644 --- a/src/plugins/debugger/debuggerdialogs.cpp +++ b/src/plugins/debugger/debuggerdialogs.cpp @@ -705,7 +705,7 @@ bool StartExternalDialog::run(QWidget *parent, if (!newParameters.arguments.isEmpty()) sp->processArgs = newParameters.arguments; // Fixme: 1 of 3 testing hacks. - if (sp->processArgs.startsWith(__("@tcf@ ")) || sp->processArgs.startsWith(__("@sym@ "))) + if (sp->processArgs.startsWith(QLatin1String("@tcf@ ")) || sp->processArgs.startsWith(QLatin1String("@sym@ "))) // Set up an ARM Symbian Abi sp->toolChainAbi = ProjectExplorer::Abi(ProjectExplorer::Abi::ArmArchitecture, ProjectExplorer::Abi::SymbianOS, diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 2917f3b698d..9e2b0d2a11e 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -2858,13 +2858,13 @@ void DebuggerPluginPrivate::extensionsInitialized() const Context cppeditorcontext(CppEditor::Constants::C_CPPEDITOR); m_startIcon = QIcon(_(":/debugger/images/debugger_start_small.png")); - m_startIcon.addFile(__(":/debugger/images/debugger_start.png")); + m_startIcon.addFile(QLatin1String(":/debugger/images/debugger_start.png")); m_exitIcon = QIcon(_(":/debugger/images/debugger_stop_small.png")); - m_exitIcon.addFile(__(":/debugger/images/debugger_stop.png")); - m_continueIcon = QIcon(__(":/debugger/images/debugger_continue_small.png")); - m_continueIcon.addFile(__(":/debugger/images/debugger_continue.png")); + m_exitIcon.addFile(QLatin1String(":/debugger/images/debugger_stop.png")); + m_continueIcon = QIcon(QLatin1String(":/debugger/images/debugger_continue_small.png")); + m_continueIcon.addFile(QLatin1String(":/debugger/images/debugger_continue.png")); m_interruptIcon = QIcon(_(":/debugger/images/debugger_interrupt_small.png")); - m_interruptIcon.addFile(__(":/debugger/images/debugger_interrupt.png")); + m_interruptIcon.addFile(QLatin1String(":/debugger/images/debugger_interrupt.png")); m_locationMarkIcon = QIcon(_(":/debugger/images/location_16.png")); m_busy = false; @@ -2937,15 +2937,15 @@ void DebuggerPluginPrivate::extensionsInitialized() connect(act, SIGNAL(triggered()), SLOT(handleAbort())); act = m_nextAction = new QAction(tr("Step Over"), this); - act->setIcon(QIcon(__(":/debugger/images/debugger_stepover_small.png"))); + act->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_stepover_small.png"))); connect(act, SIGNAL(triggered()), SLOT(handleExecNext())); act = m_stepAction = new QAction(tr("Step Into"), this); - act->setIcon(QIcon(__(":/debugger/images/debugger_stepinto_small.png"))); + act->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_stepinto_small.png"))); connect(act, SIGNAL(triggered()), SLOT(handleExecStep())); act = m_stepOutAction = new QAction(tr("Step Out"), this); - act->setIcon(QIcon(__(":/debugger/images/debugger_stepout_small.png"))); + act->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_stepout_small.png"))); connect(act, SIGNAL(triggered()), SLOT(handleExecStepOut())); act = m_runToLineAction = new QAction(tr("Run to Line"), this); @@ -2980,7 +2980,7 @@ void DebuggerPluginPrivate::extensionsInitialized() act->setCheckable(true); act->setChecked(false); act->setCheckable(false); - act->setIcon(QIcon(__(":/debugger/images/debugger_reversemode_16.png"))); + act->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_reversemode_16.png"))); act->setIconVisibleInMenu(false); act = m_frameDownAction = new QAction(tr("Move to Called Frame"), this); diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index 5a1f4f46375..4361b4861e5 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -530,7 +530,7 @@ static QList<DebuggerEngineType> engineTypes(const DebuggerStartParameters &sp) } // FIXME: 1 of 3 testing hacks. - if (sp.processArgs.startsWith(__("@tcf@ "))) { + if (sp.processArgs.startsWith(QLatin1String("@tcf@ "))) { result.push_back(GdbEngineType); return result; } diff --git a/src/plugins/debugger/debuggerstringutils.h b/src/plugins/debugger/debuggerstringutils.h index 81346636e73..7647576c3eb 100644 --- a/src/plugins/debugger/debuggerstringutils.h +++ b/src/plugins/debugger/debuggerstringutils.h @@ -40,8 +40,6 @@ namespace Debugger { namespace Internal { -typedef QLatin1Char _c; -typedef QLatin1String __; inline QString _(const char *s) { return QString::fromLatin1(s); } inline QString _(const QByteArray &ba) { return QString::fromLatin1(ba, ba.size()); } diff --git a/src/plugins/debugger/gdb/classicgdbengine.cpp b/src/plugins/debugger/gdb/classicgdbengine.cpp index a74387904f3..3b2f82a34a8 100644 --- a/src/plugins/debugger/gdb/classicgdbengine.cpp +++ b/src/plugins/debugger/gdb/classicgdbengine.cpp @@ -1047,7 +1047,7 @@ void GdbEngine::handleDebuggingHelperValue3Classic(const GdbResponse &response) int l = out.isEmpty() ? 0 : list.size(); for (int i = 0; i < l; ++i) str.append(list.at(i).toInt()); - data.setValue(_c('"') + str + _c('"')); + data.setValue(QLatin1Char('"') + str + QLatin1Char('"')); data.setHasChildren(false); data.setAllUnneeded(); insertData(data); @@ -1425,9 +1425,9 @@ void GdbEngine::handleVarListChildrenHelperClassic(const GdbMi &item, data.exp = "*(" + parent.exp + ')'; } else if (startsWithDigit(data.name)) { // An array. No variables needed? - data.name = _c('[') + data.name + _c(']'); + data.name = QLatin1Char('[') + data.name + QLatin1Char(']'); data.exp = parent.exp + '[' + exp + ']'; - } else if (0 && parent.name.endsWith(_c('.'))) { + } else if (0 && parent.name.endsWith(QLatin1Char('.'))) { // Happens with anonymous unions data.exp = parent.exp + data.name.toLatin1(); //data.name = "<anonymous union>"; diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp index 8a5b7a1e51c..89dd2d5786a 100644 --- a/src/plugins/debugger/gdb/coregdbadapter.cpp +++ b/src/plugins/debugger/gdb/coregdbadapter.cpp @@ -135,7 +135,7 @@ void CoreGdbAdapter::handleTemporaryTargetCore(const GdbResponse &response) m_executable = QLatin1String(console.mid(pos1 + 1, pos2 - pos1 - 1)); // Strip off command line arguments. FIXME: make robust. - int idx = m_executable.indexOf(_c(' ')); + int idx = m_executable.indexOf(QLatin1Char(' ')); if (idx >= 0) m_executable.truncate(idx); if (m_executable.isEmpty()) { diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 48ff1491cde..5c18eff124c 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3265,16 +3265,16 @@ void GdbEngine::handleModulesList(const GdbResponse &response) Module module; QString symbolsRead; QTextStream ts(&line, QIODevice::ReadOnly); - if (line.startsWith(__("0x"))) { + if (line.startsWith(QLatin1String("0x"))) { ts >> module.startAddress >> module.endAddress >> symbolsRead; module.moduleName = ts.readLine().trimmed(); module.symbolsRead = - (symbolsRead == __("Yes") ? Module::ReadOk : Module::ReadFailed); + (symbolsRead == QLatin1String("Yes") ? Module::ReadOk : Module::ReadFailed); modules.append(module); - } else if (line.trimmed().startsWith(__("No"))) { + } else if (line.trimmed().startsWith(QLatin1String("No"))) { // gdb 6.4 symbianelf ts >> symbolsRead; - QTC_ASSERT(symbolsRead == __("No"), continue); + QTC_ASSERT(symbolsRead == QLatin1String("No"), continue); module.startAddress = 0; module.endAddress = 0; module.moduleName = ts.readLine().trimmed(); @@ -3796,19 +3796,19 @@ bool GdbEngine::setToolTipExpression(const QPoint &mousePos, } exp = exp.mid(pos1, pos2 - pos1); - if (exp.isEmpty() || exp.startsWith(_c('#')) || !hasLetterOrNumber(exp) || isKeyWord(exp)) + if (exp.isEmpty() || exp.startsWith(QLatin1Char('#')) || !hasLetterOrNumber(exp) || isKeyWord(exp)) return false; - if (exp.startsWith(_c('"')) && exp.endsWith(_c('"'))) + if (exp.startsWith(QLatin1Char('"')) && exp.endsWith(QLatin1Char('"'))) return false; - if (exp.startsWith(__("++")) || exp.startsWith(__("--"))) + if (exp.startsWith(QLatin1String("++")) || exp.startsWith(QLatin1String("--"))) exp = exp.mid(2); - if (exp.endsWith(__("++")) || exp.endsWith(__("--"))) + if (exp.endsWith(QLatin1String("++")) || exp.endsWith(QLatin1String("--"))) exp = exp.mid(2); - if (exp.startsWith(_c('<')) || exp.startsWith(_c('['))) + if (exp.startsWith(QLatin1Char('<')) || exp.startsWith(QLatin1Char('['))) return false; if (hasSideEffects(exp) || exp.isEmpty()) @@ -4130,7 +4130,7 @@ WatchData GdbEngine::localVariable(const GdbMi &item, GdbMi t = item.findChild("numchild"); if (t.isValid()) data.setHasChildren(t.data().toInt() > 0); - else if (isPointerType(data.type) || data.name == __("this")) + else if (isPointerType(data.type) || data.name == QLatin1String("this")) data.setHasChildren(true); return data; } @@ -4139,7 +4139,7 @@ void GdbEngine::insertData(const WatchData &data0) { PENDING_DEBUG("INSERT DATA" << data0.toString()); WatchData data = data0; - if (data.value.startsWith(__("mi_cmd_var_create:"))) { + if (data.value.startsWith(QLatin1String("mi_cmd_var_create:"))) { qDebug() << "BOGUS VALUE:" << data.toString(); return; } diff --git a/src/plugins/debugger/watchutils.cpp b/src/plugins/debugger/watchutils.cpp index 8b3672d08a0..7007a1133cf 100644 --- a/src/plugins/debugger/watchutils.cpp +++ b/src/plugins/debugger/watchutils.cpp @@ -888,7 +888,7 @@ void parseWatchData(const QSet<QByteArray> &expandedINames, data1.iname += data1.name.toLatin1(); } if (!data1.name.isEmpty() && data1.name.at(0).isDigit()) - data1.name = _c('[') + data1.name + _c(']'); + data1.name = QLatin1Char('[') + data1.name + QLatin1Char(']'); if (addressStep) { setWatchDataAddress(data1, addressBase); addressBase += addressStep; -- GitLab