Debugger: Remove unneeded qualifications

Mostly done using the following ruby script:
Dir.glob('**/*.cpp').each { |file|
  next if file =~ %r{src/shared/qbs|/qmljs/}
  s = File.read(file)
  s.scan(/^using namespace (.*);$/) {
    ns = $1
    t = s.gsub(/^(.*)\b#{ns}::((?!Const)[A-Z])/) { |m|
      before = $1
      char = $2
      if before =~ /"|\/\/|\\|using|SIGNAL|SLOT|Q_/
        m
      else
        before + char
      end
    }
    if t != s
      puts file
      File.open(file, 'w').write(t)
    end
  }
}

Change-Id: I1aa1a2b6ccbafeb1a8f3053fffa39b3f96992591
Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2015-02-03 23:58:49 +02:00
committed by hjk
parent 3a9b34f232
commit 4e8e75d88e
23 changed files with 152 additions and 155 deletions

View File

@@ -1063,7 +1063,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
// with helpers enabled. In this case we get a second response with
// msg="Cannot find new threads: generic error"
showMessage(_("APPLYING WORKAROUND #1"));
Core::AsynchronousMessageBox::critical(
AsynchronousMessageBox::critical(
tr("Executable failed"), QString::fromLocal8Bit(msg));
showStatusMessage(tr("Process failed to start"));
//shutdown();
@@ -1103,7 +1103,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
// long as the breakpoints are enabled.
// FIXME: Should we silently disable the offending breakpoints?
showMessage(_("APPLYING WORKAROUND #5"));
Core::AsynchronousMessageBox::critical(
AsynchronousMessageBox::critical(
tr("Setting breakpoints failed"), QString::fromLocal8Bit(msg));
QTC_CHECK(state() == InferiorRunOk);
notifyInferiorSpontaneousStop();
@@ -1119,7 +1119,7 @@ void GdbEngine::handleResultRecord(GdbResponse *response)
if (!m_lastWinException.isEmpty())
logMsg = m_lastWinException + QLatin1Char('\n');
logMsg += QString::fromLocal8Bit(msg);
Core::AsynchronousMessageBox::critical(tr("Executable Failed"), logMsg);
AsynchronousMessageBox::critical(tr("Executable Failed"), logMsg);
showStatusMessage(tr("Executable failed: %1").arg(logMsg));
}
}
@@ -1748,7 +1748,7 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response)
QString out1 = _("The selected build of GDB does not support Python scripting.");
QString out2 = _("It cannot be used in Qt Creator.");
showStatusMessage(out1 + QLatin1Char(' ') + out2);
Core::AsynchronousMessageBox::critical(tr("Execution Error"), out1 + _("<br>") + out2);
AsynchronousMessageBox::critical(tr("Execution Error"), out1 + _("<br>") + out2);
}
notifyEngineSetupFailed();
}
@@ -1756,7 +1756,7 @@ void GdbEngine::handlePythonSetup(const GdbResponse &response)
void GdbEngine::showExecutionError(const QString &message)
{
Core::AsynchronousMessageBox::critical(tr("Execution Error"),
AsynchronousMessageBox::critical(tr("Execution Error"),
tr("Cannot continue debugged process:") + QLatin1Char('\n') + message);
}
@@ -1888,7 +1888,7 @@ void GdbEngine::handleInferiorShutdown(const GdbResponse &response)
notifyInferiorShutdownOk();
return;
}
Core::AsynchronousMessageBox::critical(
AsynchronousMessageBox::critical(
tr("Failed to shut down application"),
msgInferiorStopFailed(QString::fromLocal8Bit(ba)));
notifyInferiorShutdownFailed();
@@ -2172,7 +2172,7 @@ void GdbEngine::handleExecuteNext(const GdbResponse &response)
showExecutionError(QString::fromLocal8Bit(msg));
notifyInferiorRunFailed();
} else {
Core::AsynchronousMessageBox::critical(tr("Execution Error"),
AsynchronousMessageBox::critical(tr("Execution Error"),
tr("Cannot continue debugged process:") + QLatin1Char('\n') + QString::fromLocal8Bit(msg));
notifyInferiorIll();
}
@@ -3039,7 +3039,7 @@ void GdbEngine::handleShowModuleSymbols(const GdbResponse &response)
file.remove();
Internal::showModuleSymbols(modulePath, symbols);
} else {
Core::AsynchronousMessageBox::critical(tr("Cannot Read Symbols"),
AsynchronousMessageBox::critical(tr("Cannot Read Symbols"),
tr("Cannot read symbols for module \"%1\".").arg(fileName));
}
}
@@ -3527,7 +3527,7 @@ void GdbEngine::createSnapshot()
postCommand("gcore " + fileName.toLocal8Bit(),
NeedsStop|ConsoleCommand, CB(handleMakeSnapshot), fileName);
} else {
Core::AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),
AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),
tr("Cannot create snapshot file."));
}
}
@@ -3550,7 +3550,7 @@ void GdbEngine::handleMakeSnapshot(const GdbResponse &response)
DebuggerRunControlFactory::createAndScheduleRun(sp);
} else {
QByteArray msg = response.data["msg"].data();
Core::AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),
AsynchronousMessageBox::critical(tr("Snapshot Creation Error"),
tr("Cannot create snapshot:") + QLatin1Char('\n') + QString::fromLocal8Bit(msg));
}
}
@@ -4381,7 +4381,7 @@ void GdbEngine::loadInitScript()
if (QFileInfo(script).isReadable()) {
postCommand("source " + script.toLocal8Bit());
} else {
Core::AsynchronousMessageBox::warning(
AsynchronousMessageBox::warning(
tr("Cannot find debugger initialization script"),
tr("The debugger settings point to a script file at \"%1\" "
"which is not accessible. If a script file is not needed, "
@@ -4419,7 +4419,7 @@ void GdbEngine::handleGdbError(QProcess::ProcessError error)
default:
//m_gdbProc->kill();
//notifyEngineIll();
Core::AsynchronousMessageBox::critical(tr("GDB I/O Error"), msg);
AsynchronousMessageBox::critical(tr("GDB I/O Error"), msg);
break;
}
}
@@ -4447,7 +4447,7 @@ void GdbEngine::handleGdbFinished(int code, QProcess::ExitStatus type)
const QString msg = type == QProcess::CrashExit ?
tr("The gdb process terminated.") :
tr("The gdb process terminated unexpectedly (code %1)").arg(code);
Core::AsynchronousMessageBox::critical(tr("Unexpected GDB Exit"), msg);
AsynchronousMessageBox::critical(tr("Unexpected GDB Exit"), msg);
break;
}
}
@@ -4614,7 +4614,7 @@ void GdbEngine::notifyInferiorSetupFailed(const QString &msg)
return; // Adapter crashed meanwhile, so this notification is meaningless.
}
showMessage(_("INFERIOR START FAILED"));
Core::AsynchronousMessageBox::critical(tr("Failed to start application"), msg);
AsynchronousMessageBox::critical(tr("Failed to start application"), msg);
DebuggerEngine::notifyInferiorSetupFailed();
}
@@ -4636,7 +4636,7 @@ void GdbEngine::handleAdapterCrashed(const QString &msg)
m_gdbProc->kill();
if (!msg.isEmpty())
Core::AsynchronousMessageBox::critical(tr("Adapter crashed"), msg);
AsynchronousMessageBox::critical(tr("Adapter crashed"), msg);
}
void GdbEngine::createFullBacktrace()