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

@@ -293,7 +293,7 @@ QIcon BreakHandler::emptyIcon()
static inline bool fileNameMatch(const QString &f1, const QString &f2) static inline bool fileNameMatch(const QString &f1, const QString &f2)
{ {
if (Utils::HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive) if (HostOsInfo::fileNameCaseSensitivity() == Qt::CaseInsensitive)
return f1.compare(f2, Qt::CaseInsensitive) == 0; return f1.compare(f2, Qt::CaseInsensitive) == 0;
return f1 == f2; return f1 == f2;
} }
@@ -637,7 +637,7 @@ QVariant BreakpointItem::data(int column, int role) const
if (str.isEmpty() && !m_params.fileName.isEmpty()) if (str.isEmpty() && !m_params.fileName.isEmpty())
str = m_params.fileName; str = m_params.fileName;
if (str.isEmpty()) { if (str.isEmpty()) {
QString s = Utils::FileName::fromString(str).fileName(); QString s = FileName::fromString(str).fileName();
if (!s.isEmpty()) if (!s.isEmpty())
str = s; str = s;
} }

View File

@@ -2980,7 +2980,7 @@ CdbEngine::NormalizedSourceFileName CdbEngine::sourceMapNormalizeFileNameFromDeb
const QString fileName = cdbSourcePathMapping(QDir::toNativeSeparators(f), m_sourcePathMappings, const QString fileName = cdbSourcePathMapping(QDir::toNativeSeparators(f), m_sourcePathMappings,
DebuggerToSource); DebuggerToSource);
// Up/lower case normalization according to Windows. // Up/lower case normalization according to Windows.
const QString normalized = Utils::FileUtils::normalizePathName(fileName); const QString normalized = FileUtils::normalizePathName(fileName);
if (debugSourceMapping) if (debugSourceMapping)
qDebug(" sourceMapNormalizeFileNameFromDebugger %s->%s", qPrintable(fileName), qPrintable(normalized)); qDebug(" sourceMapNormalizeFileNameFromDebugger %s->%s", qPrintable(fileName), qPrintable(normalized));
// Check if it really exists, that is normalize worked and QFileInfo confirms it. // Check if it really exists, that is normalize worked and QFileInfo confirms it.

View File

@@ -105,19 +105,19 @@ namespace Internal {
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
DebuggerKitChooser::DebuggerKitChooser(Mode mode, QWidget *parent) DebuggerKitChooser::DebuggerKitChooser(Mode mode, QWidget *parent)
: ProjectExplorer::KitChooser(parent) : KitChooser(parent)
, m_hostAbi(ProjectExplorer::Abi::hostAbi()) , m_hostAbi(Abi::hostAbi())
, m_mode(mode) , m_mode(mode)
{ {
} }
// Match valid debuggers and restrict local debugging to compatible toolchains. // Match valid debuggers and restrict local debugging to compatible toolchains.
bool DebuggerKitChooser::kitMatches(const ProjectExplorer::Kit *k) const bool DebuggerKitChooser::kitMatches(const Kit *k) const
{ {
if (!DebuggerKitInformation::isValidDebugger(k)) if (!DebuggerKitInformation::isValidDebugger(k))
return false; return false;
if (m_mode == LocalDebugging) { if (m_mode == LocalDebugging) {
const ProjectExplorer::ToolChain *tc = ToolChainKitInformation::toolChain(k); const ToolChain *tc = ToolChainKitInformation::toolChain(k);
return tc && tc->targetAbi().os() == m_hostAbi.os(); return tc && tc->targetAbi().os() == m_hostAbi.os();
} }
return true; return true;

View File

@@ -313,7 +313,7 @@ public:
DisassemblerAgent m_disassemblerAgent; DisassemblerAgent m_disassemblerAgent;
MemoryAgent m_memoryAgent; MemoryAgent m_memoryAgent;
QScopedPointer<TextEditor::TextMark> m_locationMark; QScopedPointer<TextMark> m_locationMark;
QTimer m_locationTimer; QTimer m_locationTimer;
bool m_isStateDebugging; bool m_isStateDebugging;
@@ -594,9 +594,9 @@ void DebuggerEngine::gotoLocation(const Location &loc)
editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true); editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true);
if (loc.needsMarker()) { if (loc.needsMarker()) {
d->m_locationMark.reset(new TextEditor::TextMark(file, line)); d->m_locationMark.reset(new TextMark(file, line));
d->m_locationMark->setIcon(Internal::locationMarkIcon()); d->m_locationMark->setIcon(Internal::locationMarkIcon());
d->m_locationMark->setPriority(TextEditor::TextMark::HighPriority); d->m_locationMark->setPriority(TextMark::HighPriority);
} }
//qDebug() << "MEMORY: " << d->m_memoryAgent.hasVisibleEditor(); //qDebug() << "MEMORY: " << d->m_memoryAgent.hasVisibleEditor();
@@ -1404,7 +1404,7 @@ Terminal *DebuggerEngine::terminal() const
return &d->m_terminal; return &d->m_terminal;
} }
bool DebuggerEngine::setToolTipExpression(TextEditor::TextEditorWidget *, bool DebuggerEngine::setToolTipExpression(TextEditorWidget *,
const DebuggerToolTipContext &) const DebuggerToolTipContext &)
{ {
return false; return false;
@@ -1714,7 +1714,7 @@ void DebuggerEngine::showStoppedBySignalMessageBox(QString meaning, QString name
"<table><tr><td>Signal name : </td><td>%1</td></tr>" "<table><tr><td>Signal name : </td><td>%1</td></tr>"
"<tr><td>Signal meaning : </td><td>%2</td></tr></table>") "<tr><td>Signal meaning : </td><td>%2</td></tr></table>")
.arg(name, meaning); .arg(name, meaning);
Core::AsynchronousMessageBox::information(tr("Signal received"), msg); AsynchronousMessageBox::information(tr("Signal received"), msg);
} }
void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description) void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description)
@@ -1722,7 +1722,7 @@ void DebuggerEngine::showStoppedByExceptionMessageBox(const QString &description
const QString msg = const QString msg =
tr("<p>The inferior stopped because it triggered an exception.<p>%1"). tr("<p>The inferior stopped because it triggered an exception.<p>%1").
arg(description); arg(description);
Core::AsynchronousMessageBox::information(tr("Exception Triggered"), msg); AsynchronousMessageBox::information(tr("Exception Triggered"), msg);
} }
void DebuggerEngine::openMemoryView(const MemoryViewSetupData &data) void DebuggerEngine::openMemoryView(const MemoryViewSetupData &data)
@@ -1762,7 +1762,7 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp)
const bool warnOnRelease = boolSetting(WarnOnReleaseBuilds); const bool warnOnRelease = boolSetting(WarnOnReleaseBuilds);
QString detailedWarning; QString detailedWarning;
switch (sp->toolChainAbi.binaryFormat()) { switch (sp->toolChainAbi.binaryFormat()) {
case ProjectExplorer::Abi::PEFormat: { case Abi::PEFormat: {
if (!warnOnRelease || (sp->masterEngineType != CdbEngineType)) if (!warnOnRelease || (sp->masterEngineType != CdbEngineType))
return; return;
if (!binary.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive)) if (!binary.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive))
@@ -1777,7 +1777,7 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp)
} }
break; break;
} }
case ProjectExplorer::Abi::ElfFormat: { case Abi::ElfFormat: {
Utils::ElfReader reader(binary); Utils::ElfReader reader(binary);
Utils::ElfData elfData = reader.readHeaders(); Utils::ElfData elfData = reader.readHeaders();
@@ -1876,7 +1876,7 @@ void DebuggerEngine::validateExecutable(DebuggerStartParameters *sp)
return; return;
} }
if (warnOnRelease) { if (warnOnRelease) {
Core::AsynchronousMessageBox::information(tr("Warning"), AsynchronousMessageBox::information(tr("Warning"),
tr("This does not seem to be a \"Debug\" build.\n" tr("This does not seem to be a \"Debug\" build.\n"
"Setting breakpoints by file name and line number may fail.") "Setting breakpoints by file name and line number may fail.")
+ QLatin1Char('\n') + detailedWarning); + QLatin1Char('\n') + detailedWarning);

View File

@@ -232,7 +232,7 @@ void DebuggerItem::setEngineType(const DebuggerEngineType &engineType)
m_engineType = engineType; m_engineType = engineType;
} }
void DebuggerItem::setCommand(const Utils::FileName &command) void DebuggerItem::setCommand(const FileName &command)
{ {
m_command = command; m_command = command;
} }
@@ -257,7 +257,7 @@ void DebuggerItem::setAutoDetectionSource(const QString &autoDetectionSource)
m_autoDetectionSource = autoDetectionSource; m_autoDetectionSource = autoDetectionSource;
} }
void DebuggerItem::setAbis(const QList<ProjectExplorer::Abi> &abis) void DebuggerItem::setAbis(const QList<Abi> &abis)
{ {
m_abis = abis; m_abis = abis;
} }

View File

@@ -336,14 +336,14 @@ KitInformation::ItemList DebuggerKitInformation::toUserOutput(const Kit *k) cons
return ItemList() << qMakePair(tr("Debugger"), displayString(k)); return ItemList() << qMakePair(tr("Debugger"), displayString(k));
} }
FileName DebuggerKitInformation::debuggerCommand(const ProjectExplorer::Kit *k) FileName DebuggerKitInformation::debuggerCommand(const Kit *k)
{ {
const DebuggerItem *item = debugger(k); const DebuggerItem *item = debugger(k);
QTC_ASSERT(item, return FileName()); QTC_ASSERT(item, return FileName());
return item->command(); return item->command();
} }
DebuggerEngineType DebuggerKitInformation::engineType(const ProjectExplorer::Kit *k) DebuggerEngineType DebuggerKitInformation::engineType(const Kit *k)
{ {
const DebuggerItem *item = debugger(k); const DebuggerItem *item = debugger(k);
QTC_ASSERT(item, return NoEngineType); QTC_ASSERT(item, return NoEngineType);

View File

@@ -89,16 +89,16 @@ public:
bool isQmlActive() const; bool isQmlActive() const;
void setSimpleDockWidgetArrangement(); void setSimpleDockWidgetArrangement();
// Debuggable languages are registered with this function. // Debuggable languages are registered with this function.
void addLanguage(DebuggerLanguage language, const Core::Context &context); void addLanguage(DebuggerLanguage language, const Context &context);
QDockWidget *dockWidget(const QString &objectName) const QDockWidget *dockWidget(const QString &objectName) const
{ return q->findChild<QDockWidget *>(objectName); } { return q->findChild<QDockWidget *>(objectName); }
public slots: public slots:
void resetDebuggerLayout(); void resetDebuggerLayout();
void updateUiForProject(ProjectExplorer::Project *project); void updateUiForProject(Project *project);
void updateUiForTarget(ProjectExplorer::Target *target); void updateUiForTarget(Target *target);
void updateUiForRunConfiguration(ProjectExplorer::RunConfiguration *rc); void updateUiForRunConfiguration(RunConfiguration *rc);
void updateUiForCurrentRunConfiguration(); void updateUiForCurrentRunConfiguration();
void updateActiveLanguages(); void updateActiveLanguages();
void updateDockWidgetSettings(); void updateDockWidgetSettings();
@@ -162,26 +162,24 @@ DebuggerMainWindowPrivate::DebuggerMainWindowPrivate(DebuggerMainWindow *mw)
void DebuggerMainWindowPrivate::updateUiForProject(Project *project) void DebuggerMainWindowPrivate::updateUiForProject(Project *project)
{ {
if (m_previousProject) { if (m_previousProject) {
disconnect(m_previousProject, disconnect(m_previousProject, &Project::activeTargetChanged,
SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), this, &DebuggerMainWindowPrivate::updateUiForTarget);
this, SLOT(updateUiForTarget(ProjectExplorer::Target*)));
} }
m_previousProject = project; m_previousProject = project;
if (!project) { if (!project) {
updateUiForTarget(0); updateUiForTarget(0);
return; return;
} }
connect(project, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), connect(project, &Project::activeTargetChanged,
SLOT(updateUiForTarget(ProjectExplorer::Target*))); this, &DebuggerMainWindowPrivate::updateUiForTarget);
updateUiForTarget(project->activeTarget()); updateUiForTarget(project->activeTarget());
} }
void DebuggerMainWindowPrivate::updateUiForTarget(Target *target) void DebuggerMainWindowPrivate::updateUiForTarget(Target *target)
{ {
if (m_previousTarget) { if (m_previousTarget) {
disconnect(m_previousTarget, disconnect(m_previousTarget, &Target::activeRunConfigurationChanged,
SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)), this, &DebuggerMainWindowPrivate::updateUiForRunConfiguration);
this, SLOT(updateUiForRunConfiguration(ProjectExplorer::RunConfiguration*)));
} }
m_previousTarget = target; m_previousTarget = target;
@@ -191,9 +189,8 @@ void DebuggerMainWindowPrivate::updateUiForTarget(Target *target)
return; return;
} }
connect(target, connect(target, &Target::activeRunConfigurationChanged,
SIGNAL(activeRunConfigurationChanged(ProjectExplorer::RunConfiguration*)), this, &DebuggerMainWindowPrivate::updateUiForRunConfiguration);
SLOT(updateUiForRunConfiguration(ProjectExplorer::RunConfiguration*)));
updateUiForRunConfiguration(target->activeRunConfiguration()); updateUiForRunConfiguration(target->activeRunConfiguration());
} }
@@ -297,7 +294,7 @@ void DebuggerMainWindow::onModeChanged(IMode *mode)
void DebuggerMainWindowPrivate::createViewsMenuItems() void DebuggerMainWindowPrivate::createViewsMenuItems()
{ {
Context debugcontext(Constants::C_DEBUGMODE); Context debugcontext(Constants::C_DEBUGMODE);
m_viewsMenu = Core::ActionManager::actionContainer(Id(Core::Constants::M_WINDOW_VIEWS)); m_viewsMenu = ActionManager::actionContainer(Id(Core::Constants::M_WINDOW_VIEWS));
QTC_ASSERT(m_viewsMenu, return); QTC_ASSERT(m_viewsMenu, return);
QAction *openMemoryEditorAction = new QAction(this); QAction *openMemoryEditorAction = new QAction(this);
@@ -307,20 +304,20 @@ void DebuggerMainWindowPrivate::createViewsMenuItems()
// Add menu items // Add menu items
Command *cmd = 0; Command *cmd = 0;
cmd = Core::ActionManager::registerAction(openMemoryEditorAction, cmd = ActionManager::registerAction(openMemoryEditorAction,
"Debugger.Views.OpenMemoryEditor", debugcontext); "Debugger.Views.OpenMemoryEditor", debugcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
m_viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE); m_viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
cmd = Core::ActionManager::registerAction(q->menuSeparator1(), cmd = ActionManager::registerAction(q->menuSeparator1(),
"Debugger.Views.Separator1", debugcontext); "Debugger.Views.Separator1", debugcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
m_viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE); m_viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
cmd = Core::ActionManager::registerAction(q->autoHideTitleBarsAction(), cmd = ActionManager::registerAction(q->autoHideTitleBarsAction(),
"Debugger.Views.AutoHideTitleBars", debugcontext); "Debugger.Views.AutoHideTitleBars", debugcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
m_viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE); m_viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
cmd = Core::ActionManager::registerAction(q->menuSeparator2(), cmd = ActionManager::registerAction(q->menuSeparator2(),
"Debugger.Views.Separator2", debugcontext); "Debugger.Views.Separator2", debugcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
m_viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE); m_viewsMenu->addAction(cmd, Core::Constants::G_DEFAULT_THREE);
@@ -406,8 +403,8 @@ QDockWidget *DebuggerMainWindow::createDockWidget(const DebuggerLanguage &langua
Context globalContext(Core::Constants::C_GLOBAL); Context globalContext(Core::Constants::C_GLOBAL);
QAction *toggleViewAction = dockWidget->toggleViewAction(); QAction *toggleViewAction = dockWidget->toggleViewAction();
Command *cmd = Core::ActionManager::registerAction(toggleViewAction, Command *cmd = ActionManager::registerAction(toggleViewAction,
Core::Id("Debugger.").withSuffix(widget->objectName()), globalContext); Id("Debugger.").withSuffix(widget->objectName()), globalContext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
dockWidget->installEventFilter(&d->m_resizeEventFilter); dockWidget->installEventFilter(&d->m_resizeEventFilter);
@@ -429,10 +426,10 @@ void DebuggerMainWindow::addStagedMenuEntries()
QWidget *DebuggerMainWindow::createContents(IMode *mode) QWidget *DebuggerMainWindow::createContents(IMode *mode)
{ {
connect(SessionManager::instance(), SIGNAL(startupProjectChanged(ProjectExplorer::Project*)), connect(SessionManager::instance(), &SessionManager::startupProjectChanged,
d, SLOT(updateUiForProject(ProjectExplorer::Project*))); d, &DebuggerMainWindowPrivate::updateUiForProject);
d->m_viewsMenu = Core::ActionManager::actionContainer(Core::Id(Core::Constants::M_WINDOW_VIEWS)); d->m_viewsMenu = ActionManager::actionContainer(Id(Core::Constants::M_WINDOW_VIEWS));
QTC_ASSERT(d->m_viewsMenu, return 0); QTC_ASSERT(d->m_viewsMenu, return 0);
//d->m_mainWindow = new Internal::DebuggerMainWindow(this); //d->m_mainWindow = new Internal::DebuggerMainWindow(this);

View File

@@ -92,7 +92,7 @@ public:
// DebuggerItemModel // DebuggerItemModel
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
class DebuggerItemModel : public Utils::TreeModel class DebuggerItemModel : public TreeModel
{ {
Q_DECLARE_TR_FUNCTIONS(Debugger::DebuggerOptionsPage) Q_DECLARE_TR_FUNCTIONS(Debugger::DebuggerOptionsPage)

View File

@@ -418,12 +418,12 @@ static QToolButton *toolButton(QAction *action)
return button; return button;
} }
static void setProxyAction(ProxyAction *proxy, Core::Id id) static void setProxyAction(ProxyAction *proxy, Id id)
{ {
proxy->setAction(ActionManager::command(id)->action()); proxy->setAction(ActionManager::command(id)->action());
} }
static QToolButton *toolButton(Core::Id id) static QToolButton *toolButton(Id id)
{ {
return toolButton(ActionManager::command(id)->action()); return toolButton(ActionManager::command(id)->action());
} }
@@ -688,12 +688,12 @@ public:
} }
} }
void editorOpened(Core::IEditor *editor); void editorOpened(IEditor *editor);
void updateBreakMenuItem(Core::IEditor *editor); void updateBreakMenuItem(IEditor *editor);
void setBusyCursor(bool busy); void setBusyCursor(bool busy);
void requestMark(TextEditor::TextEditorWidget *widget, int lineNumber, void requestMark(TextEditorWidget *widget, int lineNumber,
TextEditor::TextMarkRequestKind kind); TextMarkRequestKind kind);
void requestContextMenu(TextEditor::TextEditorWidget *widget, void requestContextMenu(TextEditorWidget *widget,
int lineNumber, QMenu *menu); int lineNumber, QMenu *menu);
void activatePreviousMode(); void activatePreviousMode();
@@ -703,7 +703,7 @@ public:
const QString &tracePointMessage = QString()); const QString &tracePointMessage = QString());
void toggleBreakpointByAddress(quint64 address, void toggleBreakpointByAddress(quint64 address,
const QString &tracePointMessage = QString()); const QString &tracePointMessage = QString());
void onModeChanged(Core::IMode *mode); void onModeChanged(IMode *mode);
void onCoreAboutToOpen(); void onCoreAboutToOpen();
void showSettingsDialog(); void showSettingsDialog();
void updateDebugWithoutDeployMenu(); void updateDebugWithoutDeployMenu();
@@ -745,11 +745,11 @@ public:
void cleanupViews(); void cleanupViews();
void setInitialState(); void setInitialState();
void fontSettingsChanged(const TextEditor::FontSettings &settings); void fontSettingsChanged(const FontSettings &settings);
void updateState(DebuggerEngine *engine); void updateState(DebuggerEngine *engine);
void updateWatchersWindow(bool showWatch, bool showReturn); void updateWatchersWindow(bool showWatch, bool showReturn);
void onCurrentProjectChanged(ProjectExplorer::Project *project); void onCurrentProjectChanged(Project *project);
void sessionLoaded(); void sessionLoaded();
void aboutToUnloadSession(); void aboutToUnloadSession();
@@ -760,7 +760,7 @@ public:
#ifdef WITH_TESTS #ifdef WITH_TESTS
public slots: public slots:
void testLoadProject(const QString &proFile, const TestCallBack &cb); void testLoadProject(const QString &proFile, const TestCallBack &cb);
void testProjectLoaded(ProjectExplorer::Project *project); void testProjectLoaded(Project *project);
void testProjectEvaluated(); void testProjectEvaluated();
void testProjectBuilt(bool success); void testProjectBuilt(bool success);
void testUnloadProject(); void testUnloadProject();
@@ -1276,9 +1276,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
// Cpp/Qml ui setup // Cpp/Qml ui setup
m_mainWindow = new DebuggerMainWindow; m_mainWindow = new DebuggerMainWindow;
TaskHub::addCategory(Debugger::Constants::TASK_CATEGORY_DEBUGGER_DEBUGINFO, TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_DEBUGINFO,
tr("Debug Information")); tr("Debug Information"));
TaskHub::addCategory(Debugger::Constants::TASK_CATEGORY_DEBUGGER_RUNTIME, TaskHub::addCategory(TASK_CATEGORY_DEBUGGER_RUNTIME,
tr("Debugger Runtime")); tr("Debugger Runtime"));
return true; return true;
@@ -1330,7 +1330,7 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(Project *project)
m_startAction->setEnabled(canRun); m_startAction->setEnabled(canRun);
m_startAction->setToolTip(whyNot); m_startAction->setToolTip(whyNot);
m_debugWithoutDeployAction->setEnabled(canRun); m_debugWithoutDeployAction->setEnabled(canRun);
setProxyAction(m_visibleStartAction, Core::Id(Constants::DEBUG)); setProxyAction(m_visibleStartAction, Id(Constants::DEBUG));
} }
void DebuggerPluginPrivate::debugProject() void DebuggerPluginPrivate::debugProject()
@@ -1441,7 +1441,7 @@ void DebuggerPluginPrivate::attachToProcess(bool startServerOnly)
DebuggerKitChooser::RemoteDebugging : DebuggerKitChooser::LocalDebugging; DebuggerKitChooser::RemoteDebugging : DebuggerKitChooser::LocalDebugging;
DebuggerKitChooser *kitChooser = new DebuggerKitChooser(mode); DebuggerKitChooser *kitChooser = new DebuggerKitChooser(mode);
DeviceProcessesDialog *dlg = new DeviceProcessesDialog(kitChooser, ICore::dialogParent()); DeviceProcessesDialog *dlg = new DeviceProcessesDialog(kitChooser, ICore::dialogParent());
dlg->addAcceptButton(ProjectExplorer::DeviceProcessesDialog::tr("&Attach to Process")); dlg->addAcceptButton(DeviceProcessesDialog::tr("&Attach to Process"));
dlg->showAllDevices(); dlg->showAllDevices();
if (dlg->exec() == QDialog::Rejected) { if (dlg->exec() == QDialog::Rejected) {
delete dlg; delete dlg;
@@ -1508,7 +1508,7 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
IDevice::ConstPtr device = DeviceKitInformation::device(kit); IDevice::ConstPtr device = DeviceKitInformation::device(kit);
QTC_ASSERT(device, return 0); QTC_ASSERT(device, return 0);
if (process.pid == 0) { if (process.pid == 0) {
Core::AsynchronousMessageBox::warning(tr("Warning"), AsynchronousMessageBox::warning(tr("Warning"),
tr("Cannot attach to process with PID 0")); tr("Cannot attach to process with PID 0"));
return 0; return 0;
} }
@@ -1517,14 +1517,14 @@ DebuggerRunControl *DebuggerPluginPrivate::attachToRunningProcess(Kit *kit,
if (const ToolChain *tc = ToolChainKitInformation::toolChain(kit)) if (const ToolChain *tc = ToolChainKitInformation::toolChain(kit))
isWindows = tc->targetAbi().os() == Abi::WindowsOS; isWindows = tc->targetAbi().os() == Abi::WindowsOS;
if (isWindows && isWinProcessBeingDebugged(process.pid)) { if (isWindows && isWinProcessBeingDebugged(process.pid)) {
Core::AsynchronousMessageBox::warning(tr("Process Already Under Debugger Control"), AsynchronousMessageBox::warning(tr("Process Already Under Debugger Control"),
tr("The process %1 is already under the control of a debugger.\n" tr("The process %1 is already under the control of a debugger.\n"
"Qt Creator cannot attach to it.").arg(process.pid)); "Qt Creator cannot attach to it.").arg(process.pid));
return 0; return 0;
} }
if (device->type() != PE::DESKTOP_DEVICE_TYPE) { if (device->type() != PE::DESKTOP_DEVICE_TYPE) {
Core::AsynchronousMessageBox::warning(tr("Not a Desktop Device Type"), AsynchronousMessageBox::warning(tr("Not a Desktop Device Type"),
tr("It is only possible to attach to a locally running process.")); tr("It is only possible to attach to a locally running process."));
return 0; return 0;
} }
@@ -1865,7 +1865,7 @@ static void changeFontSize(QWidget *widget, qreal size)
} }
void DebuggerPluginPrivate::fontSettingsChanged void DebuggerPluginPrivate::fontSettingsChanged
(const TextEditor::FontSettings &settings) (const FontSettings &settings)
{ {
if (!boolSetting(FontSizeFollowsEditor)) if (!boolSetting(FontSizeFollowsEditor))
return; return;
@@ -2013,7 +2013,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_exitAction->setEnabled(false); m_exitAction->setEnabled(false);
m_startAction->setEnabled(true); m_startAction->setEnabled(true);
m_debugWithoutDeployAction->setEnabled(true); m_debugWithoutDeployAction->setEnabled(true);
setProxyAction(m_visibleStartAction, Core::Id(Constants::DEBUG)); setProxyAction(m_visibleStartAction, Id(Constants::DEBUG));
m_hiddenStopAction->setAction(m_undisturbableAction); m_hiddenStopAction->setAction(m_undisturbableAction);
} else if (state == InferiorStopOk) { } else if (state == InferiorStopOk) {
// F5 continues, Shift-F5 kills. It is "continuable". // F5 continues, Shift-F5 kills. It is "continuable".
@@ -2022,7 +2022,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_exitAction->setEnabled(true); m_exitAction->setEnabled(true);
m_startAction->setEnabled(false); m_startAction->setEnabled(false);
m_debugWithoutDeployAction->setEnabled(false); m_debugWithoutDeployAction->setEnabled(false);
setProxyAction(m_visibleStartAction, Core::Id(Constants::CONTINUE)); setProxyAction(m_visibleStartAction, Id(Constants::CONTINUE));
m_hiddenStopAction->setAction(m_exitAction); m_hiddenStopAction->setAction(m_exitAction);
m_localsAndExpressionsWindow->setShowLocals(true); m_localsAndExpressionsWindow->setShowLocals(true);
} else if (state == InferiorRunOk) { } else if (state == InferiorRunOk) {
@@ -2032,7 +2032,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_exitAction->setEnabled(true); m_exitAction->setEnabled(true);
m_startAction->setEnabled(false); m_startAction->setEnabled(false);
m_debugWithoutDeployAction->setEnabled(false); m_debugWithoutDeployAction->setEnabled(false);
setProxyAction(m_visibleStartAction, Core::Id(Constants::INTERRUPT)); setProxyAction(m_visibleStartAction, Id(Constants::INTERRUPT));
m_hiddenStopAction->setAction(m_interruptAction); m_hiddenStopAction->setAction(m_interruptAction);
m_localsAndExpressionsWindow->setShowLocals(false); m_localsAndExpressionsWindow->setShowLocals(false);
} else if (state == DebuggerFinished) { } else if (state == DebuggerFinished) {
@@ -2044,7 +2044,7 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
m_exitAction->setEnabled(false); m_exitAction->setEnabled(false);
m_startAction->setEnabled(canRun); m_startAction->setEnabled(canRun);
m_debugWithoutDeployAction->setEnabled(canRun); m_debugWithoutDeployAction->setEnabled(canRun);
setProxyAction(m_visibleStartAction, Core::Id(Constants::DEBUG)); setProxyAction(m_visibleStartAction, Id(Constants::DEBUG));
m_hiddenStopAction->setAction(m_undisturbableAction); m_hiddenStopAction->setAction(m_undisturbableAction);
m_codeModelSnapshot = CPlusPlus::Snapshot(); m_codeModelSnapshot = CPlusPlus::Snapshot();
setBusyCursor(false); setBusyCursor(false);
@@ -2447,7 +2447,7 @@ void DebuggerPluginPrivate::extensionsInitialized()
{ {
const QKeySequence debugKey = QKeySequence(UseMacShortcuts ? tr("Ctrl+Y") : tr("F5")); const QKeySequence debugKey = QKeySequence(UseMacShortcuts ? tr("Ctrl+Y") : tr("F5"));
QSettings *settings = Core::ICore::settings(); QSettings *settings = ICore::settings();
m_debuggerSettings = new DebuggerSettings; m_debuggerSettings = new DebuggerSettings;
m_debuggerSettings->readSettings(); m_debuggerSettings->readSettings();
@@ -2733,17 +2733,17 @@ void DebuggerPluginPrivate::extensionsInitialized()
cmd = ActionManager::registerAction(m_attachToRunningApplication, cmd = ActionManager::registerAction(m_attachToRunningApplication,
"Debugger.AttachToRemoteProcess", globalcontext); "Debugger.AttachToRemoteProcess", globalcontext);
cmd->setDescription(tr("Attach to Running Application")); cmd->setDescription(tr("Attach to Running Application"));
mstart->addAction(cmd, Debugger::Constants::G_GENERAL); mstart->addAction(cmd, G_GENERAL);
cmd = ActionManager::registerAction(m_attachToUnstartedApplication, cmd = ActionManager::registerAction(m_attachToUnstartedApplication,
"Debugger.AttachToUnstartedProcess", globalcontext); "Debugger.AttachToUnstartedProcess", globalcontext);
cmd->setDescription(tr("Attach to Unstarted Application")); cmd->setDescription(tr("Attach to Unstarted Application"));
mstart->addAction(cmd, Debugger::Constants::G_GENERAL); mstart->addAction(cmd, G_GENERAL);
cmd = ActionManager::registerAction(m_startAndDebugApplicationAction, cmd = ActionManager::registerAction(m_startAndDebugApplicationAction,
"Debugger.StartAndDebugApplication", globalcontext); "Debugger.StartAndDebugApplication", globalcontext);
cmd->setAttribute(Command::CA_Hide); cmd->setAttribute(Command::CA_Hide);
mstart->addAction(cmd, Debugger::Constants::G_GENERAL); mstart->addAction(cmd, G_GENERAL);
cmd = ActionManager::registerAction(m_attachToCoreAction, cmd = ActionManager::registerAction(m_attachToCoreAction,
"Debugger.AttachCore", globalcontext); "Debugger.AttachCore", globalcontext);
@@ -2976,10 +2976,10 @@ void DebuggerPluginPrivate::extensionsInitialized()
// Debug mode setup // Debug mode setup
DebugMode *debugMode = new DebugMode; DebugMode *debugMode = new DebugMode;
QWidget *widget = m_mainWindow->createContents(debugMode); QWidget *widget = m_mainWindow->createContents(debugMode);
Core::IContext *modeContextObject = new Core::IContext(this); IContext *modeContextObject = new IContext(this);
modeContextObject->setContext(Core::Context(CC::C_EDITORMANAGER)); modeContextObject->setContext(Context(CC::C_EDITORMANAGER));
modeContextObject->setWidget(widget); modeContextObject->setWidget(widget);
Core::ICore::addContextObject(modeContextObject); ICore::addContextObject(modeContextObject);
debugMode->setWidget(widget); debugMode->setWidget(widget);
m_plugin->addAutoReleasedObject(debugMode); m_plugin->addAutoReleasedObject(debugMode);
@@ -3505,7 +3505,7 @@ void DebuggerPluginPrivate::testBenchmark1()
{ {
#ifdef WITH_BENCHMARK #ifdef WITH_BENCHMARK
CALLGRIND_START_INSTRUMENTATION; CALLGRIND_START_INSTRUMENTATION;
volatile Core::Id id1 = Core::Id(DEBUGGER_COMMON_SETTINGS_ID); volatile Id id1 = Id(DEBUGGER_COMMON_SETTINGS_ID);
CALLGRIND_STOP_INSTRUMENTATION; CALLGRIND_STOP_INSTRUMENTATION;
CALLGRIND_DUMP_STATS; CALLGRIND_DUMP_STATS;

View File

@@ -295,7 +295,7 @@ bool DebuggerRunControlFactory::fillParametersFromLocalRunConfiguration
QTC_ASSERT(runConfiguration, return false); QTC_ASSERT(runConfiguration, return false);
auto rc = qobject_cast<const LocalApplicationRunConfiguration *>(runConfiguration); auto rc = qobject_cast<const LocalApplicationRunConfiguration *>(runConfiguration);
QTC_ASSERT(rc, return false); QTC_ASSERT(rc, return false);
EnvironmentAspect *environmentAspect = rc->extraAspect<ProjectExplorer::EnvironmentAspect>(); EnvironmentAspect *environmentAspect = rc->extraAspect<EnvironmentAspect>();
QTC_ASSERT(environmentAspect, return false); QTC_ASSERT(environmentAspect, return false);
Target *target = runConfiguration->target(); Target *target = runConfiguration->target();
@@ -331,7 +331,7 @@ bool DebuggerRunControlFactory::fillParametersFromLocalRunConfiguration
sp->languages |= CppLanguage; sp->languages |= CppLanguage;
if (debuggerAspect->useQmlDebugger()) { if (debuggerAspect->useQmlDebugger()) {
const ProjectExplorer::IDevice::ConstPtr device = const IDevice::ConstPtr device =
DeviceKitInformation::device(runConfiguration->target()->kit()); DeviceKitInformation::device(runConfiguration->target()->kit());
QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return sp); QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return sp);
QTcpServer server; QTcpServer server;
@@ -491,7 +491,7 @@ bool DebuggerRunControlFactory::fillParametersFromKit(DebuggerStartParameters *s
sp->executable = executableForPid(sp->attachPID); sp->executable = executableForPid(sp->attachPID);
} }
if (!sp->executable.isEmpty()) if (!sp->executable.isEmpty())
abis = Abi::abisOfBinary(Utils::FileName::fromString(sp->executable)); abis = Abi::abisOfBinary(FileName::fromString(sp->executable));
} }
if (!abis.isEmpty()) { if (!abis.isEmpty()) {
// Try exact abis. // Try exact abis.

View File

@@ -337,7 +337,7 @@ void DisassemblerAgent::updateBreakpointMarkers()
return; return;
const DisassemblerLines contents = d->contentsAtCurrentLocation(); const DisassemblerLines contents = d->contentsAtCurrentLocation();
foreach (TextEditor::TextMark *marker, d->breakpointMarks) foreach (TextMark *marker, d->breakpointMarks)
d->document->removeMark(marker); d->document->removeMark(marker);
qDeleteAll(d->breakpointMarks); qDeleteAll(d->breakpointMarks);
d->breakpointMarks.clear(); d->breakpointMarks.clear();

View File

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

View File

@@ -311,7 +311,7 @@ QWidget *GdbOptionsPage::widget()
void GdbOptionsPage::apply() void GdbOptionsPage::apply()
{ {
if (m_widget) if (m_widget)
m_widget->group.apply(Core::ICore::settings()); m_widget->group.apply(ICore::settings());
} }
void GdbOptionsPage::finish() void GdbOptionsPage::finish()
@@ -457,7 +457,7 @@ QWidget *GdbOptionsPage2::widget()
void GdbOptionsPage2::apply() void GdbOptionsPage2::apply()
{ {
if (m_widget) if (m_widget)
m_widget->group.apply(Core::ICore::settings()); m_widget->group.apply(ICore::settings());
} }
void GdbOptionsPage2::finish() void GdbOptionsPage2::finish()

View File

@@ -90,7 +90,7 @@ GdbServerStarter::~GdbServerStarter()
void GdbServerStarter::handleRemoteError(const QString &errorMsg) void GdbServerStarter::handleRemoteError(const QString &errorMsg)
{ {
Core::AsynchronousMessageBox::critical(tr("Remote Error"), errorMsg); AsynchronousMessageBox::critical(tr("Remote Error"), errorMsg);
} }
void GdbServerStarter::portGathererError(const QString &text) void GdbServerStarter::portGathererError(const QString &text)
@@ -198,15 +198,15 @@ void GdbServerStarter::attach(int port)
localExecutable = candidate; localExecutable = candidate;
} }
if (localExecutable.isEmpty()) { if (localExecutable.isEmpty()) {
Core::AsynchronousMessageBox::warning(tr("Warning"), AsynchronousMessageBox::warning(tr("Warning"),
tr("Cannot find local executable for remote process \"%1\".") tr("Cannot find local executable for remote process \"%1\".")
.arg(d->process.exe)); .arg(d->process.exe));
return; return;
} }
QList<Abi> abis = Abi::abisOfBinary(Utils::FileName::fromString(localExecutable)); QList<Abi> abis = Abi::abisOfBinary(FileName::fromString(localExecutable));
if (abis.isEmpty()) { if (abis.isEmpty()) {
Core::AsynchronousMessageBox::warning(tr("Warning"), AsynchronousMessageBox::warning(tr("Warning"),
tr("Cannot find ABI for remote process \"%1\".") tr("Cannot find ABI for remote process \"%1\".")
.arg(d->process.exe)); .arg(d->process.exe));
return; return;

View File

@@ -62,11 +62,11 @@ GdbTermEngine::GdbTermEngine(const DebuggerStartParameters &startParameters)
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
// Windows up to xp needs a workaround for attaching to freshly started processes. see proc_stub_win // Windows up to xp needs a workaround for attaching to freshly started processes. see proc_stub_win
if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA) if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA)
m_stubProc.setMode(Utils::ConsoleProcess::Suspend); m_stubProc.setMode(ConsoleProcess::Suspend);
else else
m_stubProc.setMode(Utils::ConsoleProcess::Debug); m_stubProc.setMode(ConsoleProcess::Debug);
#else #else
m_stubProc.setMode(Utils::ConsoleProcess::Debug); m_stubProc.setMode(ConsoleProcess::Debug);
m_stubProc.setSettings(Core::ICore::settings()); m_stubProc.setSettings(Core::ICore::settings());
#endif #endif
} }
@@ -94,11 +94,11 @@ void GdbTermEngine::setupEngine()
// Set environment + dumper preload. // Set environment + dumper preload.
m_stubProc.setEnvironment(startParameters().environment); m_stubProc.setEnvironment(startParameters().environment);
connect(&m_stubProc, &Utils::ConsoleProcess::processError, connect(&m_stubProc, &ConsoleProcess::processError,
this, &GdbTermEngine::stubError); this, &GdbTermEngine::stubError);
connect(&m_stubProc, &Utils::ConsoleProcess::processStarted, connect(&m_stubProc, &ConsoleProcess::processStarted,
this, &GdbTermEngine::stubStarted); this, &GdbTermEngine::stubStarted);
connect(&m_stubProc, &Utils::ConsoleProcess::stubStopped, connect(&m_stubProc, &ConsoleProcess::stubStopped,
this, &GdbTermEngine::stubExited); this, &GdbTermEngine::stubExited);
// FIXME: Starting the stub implies starting the inferior. This is // FIXME: Starting the stub implies starting the inferior. This is
// fairly unclean as far as the state machine and error reporting go. // fairly unclean as far as the state machine and error reporting go.

View File

@@ -83,7 +83,7 @@ public:
QString remoteFile() const { return m_remoteFile; } QString remoteFile() const { return m_remoteFile; }
private slots: private slots:
void handleSftpOperationFinished(QSsh::SftpJobId, const QString &error); void handleSftpOperationFinished(SftpJobId, const QString &error);
void handleSftpOperationFailed(const QString &errorMessage); void handleSftpOperationFailed(const QString &errorMessage);
void handleConnectionError(const QString &errorMessage); void handleConnectionError(const QString &errorMessage);
void handleRemoteError(const QString &errorMessage); void handleRemoteError(const QString &errorMessage);
@@ -143,7 +143,7 @@ void SelectRemoteFileDialog::attachToDevice(Kit *k)
QTC_ASSERT(k, return); QTC_ASSERT(k, return);
IDevice::ConstPtr device = DeviceKitInformation::device(k); IDevice::ConstPtr device = DeviceKitInformation::device(k);
QTC_ASSERT(device, return); QTC_ASSERT(device, return);
QSsh::SshConnectionParameters sshParams = device->sshParameters(); SshConnectionParameters sshParams = device->sshParameters();
m_fileSystemModel.setSshConnection(sshParams); m_fileSystemModel.setSshConnection(sshParams);
} }
@@ -159,7 +159,7 @@ void SelectRemoteFileDialog::handleConnectionError(const QString &errorMessage)
//reject(); //reject();
} }
void SelectRemoteFileDialog::handleSftpOperationFinished(QSsh::SftpJobId, const QString &error) void SelectRemoteFileDialog::handleSftpOperationFinished(SftpJobId, const QString &error)
{ {
if (error.isEmpty()) { if (error.isEmpty()) {
m_textBrowser->append(tr("Download of remote file succeeded.")); m_textBrowser->append(tr("Download of remote file succeeded."));
@@ -364,7 +364,7 @@ bool AttachCoreDialog::useLocalCoreFile() const
void AttachCoreDialog::coreFileChanged(const QString &core) void AttachCoreDialog::coreFileChanged(const QString &core)
{ {
if (!Utils::HostOsInfo::isWindowsHost() && QFile::exists(core)) { if (!HostOsInfo::isWindowsHost() && QFile::exists(core)) {
Kit *k = d->kitChooser->currentKit(); Kit *k = d->kitChooser->currentKit();
QTC_ASSERT(k, return); QTC_ASSERT(k, return);
FileName cmd = DebuggerKitInformation::debuggerCommand(k); FileName cmd = DebuggerKitInformation::debuggerCommand(k);
@@ -441,7 +441,7 @@ QString AttachCoreDialog::remoteCoreFile() const
return d->remoteCoreFileName->text(); return d->remoteCoreFileName->text();
} }
void AttachCoreDialog::setKitId(Core::Id id) void AttachCoreDialog::setKitId(Id id)
{ {
d->kitChooser->setCurrentKitId(id); d->kitChooser->setCurrentKitId(id);
} }

View File

@@ -189,7 +189,7 @@ bool MemoryAgent::doCreateBinEditor(const MemoryViewSetupData &data)
void MemoryAgent::createBinEditor(const MemoryViewSetupData &data) void MemoryAgent::createBinEditor(const MemoryViewSetupData &data)
{ {
if (!doCreateBinEditor(data)) if (!doCreateBinEditor(data))
Core::AsynchronousMessageBox::warning( AsynchronousMessageBox::warning(
tr("No Memory Viewer Available"), tr("No Memory Viewer Available"),
tr("The memory contents cannot be shown as no viewer plugin " tr("The memory contents cannot be shown as no viewer plugin "
"for binary data has been loaded.")); "for binary data has been loaded."));
@@ -234,7 +234,7 @@ void MemoryAgent::handleWatchpointRequest(quint64 address, uint size)
void MemoryAgent::updateContents() void MemoryAgent::updateContents()
{ {
foreach (const QPointer<Core::IEditor> &e, m_editors) foreach (const QPointer<IEditor> &e, m_editors)
if (e) if (e)
MemoryView::binEditorUpdateContents(e->widget()); MemoryView::binEditorUpdateContents(e->widget());
// Update all views except register views, which trigger on // Update all views except register views, which trigger on

View File

@@ -60,22 +60,22 @@ QmlAdapter::QmlAdapter(DebuggerEngine *engine, QObject *parent)
connect(&m_connectionTimer, &QTimer::timeout, this, &QmlAdapter::checkConnectionState); connect(&m_connectionTimer, &QTimer::timeout, this, &QmlAdapter::checkConnectionState);
m_conn = new QmlDebugConnection(this); m_conn = new QmlDebugConnection(this);
connect(m_conn, &QmlDebug::QmlDebugConnection::stateMessage, connect(m_conn, &QmlDebugConnection::stateMessage,
this, &QmlAdapter::showConnectionStateMessage); this, &QmlAdapter::showConnectionStateMessage);
connect(m_conn, &QmlDebug::QmlDebugConnection::errorMessage, connect(m_conn, &QmlDebugConnection::errorMessage,
this, &QmlAdapter::showConnectionErrorMessage); this, &QmlAdapter::showConnectionErrorMessage);
connect(m_conn, &QmlDebug::QmlDebugConnection::error, connect(m_conn, &QmlDebugConnection::error,
this, &QmlAdapter::connectionErrorOccurred); this, &QmlAdapter::connectionErrorOccurred);
connect(m_conn, &QmlDebug::QmlDebugConnection::opened, connect(m_conn, &QmlDebugConnection::opened,
&m_connectionTimer, &QTimer::stop); &m_connectionTimer, &QTimer::stop);
connect(m_conn, &QmlDebug::QmlDebugConnection::opened, connect(m_conn, &QmlDebugConnection::opened,
this, &QmlAdapter::connected); this, &QmlAdapter::connected);
connect(m_conn, &QmlDebug::QmlDebugConnection::closed, connect(m_conn, &QmlDebugConnection::closed,
this, &QmlAdapter::disconnected); this, &QmlAdapter::disconnected);
createDebuggerClients(); createDebuggerClients();
m_msgClient = new QDebugMessageClient(m_conn); m_msgClient = new QDebugMessageClient(m_conn);
connect(m_msgClient, &QmlDebug::QDebugMessageClient::newState, this, &QmlAdapter::clientStateChanged); connect(m_msgClient, &QDebugMessageClient::newState, this, &QmlAdapter::clientStateChanged);
} }
@@ -129,7 +129,7 @@ void QmlAdapter::clientStateChanged(QmlDebugClient::State state)
void QmlAdapter::debugClientStateChanged(QmlDebugClient::State state) void QmlAdapter::debugClientStateChanged(QmlDebugClient::State state)
{ {
if (state != QmlDebug::QmlDebugClient::Enabled) if (state != QmlDebugClient::Enabled)
return; return;
QmlDebugClient *client = qobject_cast<QmlDebugClient*>(sender()); QmlDebugClient *client = qobject_cast<QmlDebugClient*>(sender());
QTC_ASSERT(client, return); QTC_ASSERT(client, return);
@@ -210,21 +210,21 @@ QDebugMessageClient *QmlAdapter::messageClient() const
} }
void QmlAdapter::logServiceStateChange(const QString &service, float version, void QmlAdapter::logServiceStateChange(const QString &service, float version,
QmlDebug::QmlDebugClient::State newState) QmlDebugClient::State newState)
{ {
switch (newState) { switch (newState) {
case QmlDebug::QmlDebugClient::Unavailable: { case QmlDebugClient::Unavailable: {
showConnectionStateMessage(_("Status of \"%1\" Version: %2 changed to 'unavailable'."). showConnectionStateMessage(_("Status of \"%1\" Version: %2 changed to 'unavailable'.").
arg(service).arg(QString::number(version))); arg(service).arg(QString::number(version)));
break; break;
} }
case QmlDebug::QmlDebugClient::Enabled: { case QmlDebugClient::Enabled: {
showConnectionStateMessage(_("Status of \"%1\" Version: %2 changed to 'enabled'."). showConnectionStateMessage(_("Status of \"%1\" Version: %2 changed to 'enabled'.").
arg(service).arg(QString::number(version))); arg(service).arg(QString::number(version)));
break; break;
} }
case QmlDebug::QmlDebugClient::NotConnected: { case QmlDebugClient::NotConnected: {
showConnectionStateMessage(_("Status of \"%1\" Version: %2 changed to 'not connected'."). showConnectionStateMessage(_("Status of \"%1\" Version: %2 changed to 'not connected'.").
arg(service).arg(QString::number(version))); arg(service).arg(QString::number(version)));
break; break;

View File

@@ -249,9 +249,9 @@ public:
quint32 *column; quint32 *column;
}; };
QmlJS::ConsoleManagerInterface *qmlConsoleManager() ConsoleManagerInterface *qmlConsoleManager()
{ {
return QmlJS::ConsoleManagerInterface::instance(); return ConsoleManagerInterface::instance();
} }
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
@@ -1041,7 +1041,7 @@ void QmlEngine::synchronizeWatchers()
} }
} }
QmlJS::ConsoleItem *constructLogItemTree(QmlJS::ConsoleItem *parent, ConsoleItem *constructLogItemTree(ConsoleItem *parent,
const QVariant &result, const QVariant &result,
const QString &key = QString()) const QString &key = QString())
{ {
@@ -1135,7 +1135,7 @@ void QmlEngine::disconnected()
notifyInferiorExited(); notifyInferiorExited();
} }
void QmlEngine::documentUpdated(QmlJS::Document::Ptr doc) void QmlEngine::documentUpdated(Document::Ptr doc)
{ {
QString fileName = doc->fileName(); QString fileName = doc->fileName();
if (pendingBreakpoints.contains(fileName)) { if (pendingBreakpoints.contains(fileName)) {
@@ -1167,7 +1167,7 @@ void QmlEngine::updateCurrentContext()
synchronizeWatchers(); synchronizeWatchers();
QmlJS::ConsoleManagerInterface *consoleManager = qmlConsoleManager(); ConsoleManagerInterface *consoleManager = qmlConsoleManager();
if (consoleManager) if (consoleManager)
consoleManager->setContext(tr("Context:") + QLatin1Char(' ') + context); consoleManager->setContext(tr("Context:") + QLatin1Char(' ') + context);
} }

View File

@@ -396,13 +396,13 @@ void QmlInspectorAgent::setEngineClient(BaseEngineDebugClient *client)
m_engineClient = client; m_engineClient = client;
if (m_engineClient) { if (m_engineClient) {
connect(m_engineClient, &QmlDebug::BaseEngineDebugClient::newState, connect(m_engineClient, &BaseEngineDebugClient::newState,
this, &QmlInspectorAgent::updateState); this, &QmlInspectorAgent::updateState);
connect(m_engineClient, &QmlDebug::BaseEngineDebugClient::result, connect(m_engineClient, &BaseEngineDebugClient::result,
this, &QmlInspectorAgent::onResult); this, &QmlInspectorAgent::onResult);
connect(m_engineClient, &QmlDebug::BaseEngineDebugClient::newObject, connect(m_engineClient, &BaseEngineDebugClient::newObject,
this, &QmlInspectorAgent::newObject); this, &QmlInspectorAgent::newObject);
connect(m_engineClient, &QmlDebug::BaseEngineDebugClient::valueChanged, connect(m_engineClient, &BaseEngineDebugClient::valueChanged,
this, &QmlInspectorAgent::onValueChanged); this, &QmlInspectorAgent::onValueChanged);
} }

View File

@@ -346,8 +346,8 @@ void MapObjectWithDebugReference::process(UiObjectBinding *ast)
/*! /*!
* Manages a Qml/JS document for the inspector * Manages a Qml/JS document for the inspector
*/ */
QmlLiveTextPreview::QmlLiveTextPreview(const QmlJS::Document::Ptr &doc, QmlLiveTextPreview::QmlLiveTextPreview(const Document::Ptr &doc,
const QmlJS::Document::Ptr &initDoc, const Document::Ptr &initDoc,
QmlInspectorAdapter *inspectorAdapter, QmlInspectorAdapter *inspectorAdapter,
QObject *parent) QObject *parent)
: QObject(parent) : QObject(parent)
@@ -362,8 +362,8 @@ QmlLiveTextPreview::QmlLiveTextPreview(const QmlJS::Document::Ptr &doc,
{ {
QTC_CHECK(doc->fileName() == initDoc->fileName()); QTC_CHECK(doc->fileName() == initDoc->fileName());
QmlJS::ModelManagerInterface *modelManager ModelManagerInterface *modelManager
= QmlJS::ModelManagerInterface::instance(); = ModelManagerInterface::instance();
if (modelManager) { if (modelManager) {
connect(modelManager, SIGNAL(documentChangedOnDisk(QmlJS::Document::Ptr)), connect(modelManager, SIGNAL(documentChangedOnDisk(QmlJS::Document::Ptr)),
SLOT(documentChanged(QmlJS::Document::Ptr))); SLOT(documentChanged(QmlJS::Document::Ptr)));
@@ -424,7 +424,7 @@ void QmlLiveTextPreview::unassociateEditor(Core::IEditor *oldEditor)
} }
} }
void QmlLiveTextPreview::resetInitialDoc(const QmlJS::Document::Ptr &doc) void QmlLiveTextPreview::resetInitialDoc(const Document::Ptr &doc)
{ {
m_initialDoc = doc; m_initialDoc = doc;
m_previousDoc = doc; m_previousDoc = doc;
@@ -463,7 +463,7 @@ void QmlLiveTextPreview::updateDebugIds()
if (it != m_inspectorAdapter->agent()->debugIdHash().constEnd()) { if (it != m_inspectorAdapter->agent()->debugIdHash().constEnd()) {
// Map all the object that comes from the document as it has been loaded // Map all the object that comes from the document as it has been loaded
// by the server. // by the server.
const QmlJS::Document::Ptr &doc = m_initialDoc; const Document::Ptr &doc = m_initialDoc;
MapObjectWithDebugReference visitor; MapObjectWithDebugReference visitor;
visitor.ids = (*it); visitor.ids = (*it);
@@ -477,7 +477,7 @@ void QmlLiveTextPreview::updateDebugIds()
} }
} }
const QmlJS::Document::Ptr &doc = m_previousDoc; const Document::Ptr &doc = m_previousDoc;
if (!doc->qmlProgram()) if (!doc->qmlProgram())
return; return;
@@ -500,7 +500,7 @@ void QmlLiveTextPreview::updateDebugIds()
= m_createdObjects.constBegin(); = m_createdObjects.constBegin();
it != m_createdObjects.constEnd(); ++it) { it != m_createdObjects.constEnd(); ++it) {
const QmlJS::Document::Ptr &doc = it.key(); const Document::Ptr &doc = it.key();
DebugIdHash::const_iterator id_it = m_inspectorAdapter->agent()->debugIdHash().constFind( DebugIdHash::const_iterator id_it = m_inspectorAdapter->agent()->debugIdHash().constFind(
qMakePair<QString, int>(doc->fileName(), doc->editorRevision())); qMakePair<QString, int>(doc->fileName(), doc->editorRevision()));
@@ -527,14 +527,14 @@ void QmlLiveTextPreview::updateDebugIds()
changeSelectedElements(m_lastOffsets, QString()); changeSelectedElements(m_lastOffsets, QString());
} }
void QmlLiveTextPreview::changeSelectedElements(const QList<QmlJS::AST::UiObjectMember*> offsetObjects, void QmlLiveTextPreview::changeSelectedElements(const QList<UiObjectMember*> offsetObjects,
const QString &wordAtCursor) const QString &wordAtCursor)
{ {
if (m_editors.isEmpty() || !m_previousDoc) if (m_editors.isEmpty() || !m_previousDoc)
return; return;
QList<int> offsets; QList<int> offsets;
foreach (QmlJS::AST::UiObjectMember *member, offsetObjects) foreach (UiObjectMember *member, offsetObjects)
offsets << member->firstSourceLocation().offset; offsets << member->firstSourceLocation().offset;
if (!changeSelectedElements(offsets, wordAtCursor) && m_initialDoc && offsetObjects.count()) { if (!changeSelectedElements(offsets, wordAtCursor) && m_initialDoc && offsetObjects.count()) {
@@ -588,7 +588,7 @@ bool QmlLiveTextPreview::changeSelectedElements(const QList<int> offsets,
return true; return true;
} }
void QmlLiveTextPreview::documentChanged(QmlJS::Document::Ptr doc) void QmlLiveTextPreview::documentChanged(Document::Ptr doc)
{ {
if (doc->fileName() != m_previousDoc->fileName()) if (doc->fileName() != m_previousDoc->fileName())
return; return;
@@ -650,11 +650,11 @@ void QmlLiveTextPreview::onAutomaticUpdateFailed()
QList<int> QmlLiveTextPreview::objectReferencesForOffset(quint32 offset) QList<int> QmlLiveTextPreview::objectReferencesForOffset(quint32 offset)
{ {
QList<int> result; QList<int> result;
QHashIterator<QmlJS::AST::UiObjectMember*, QList<int> > iter(m_debugIds); QHashIterator<UiObjectMember*, QList<int> > iter(m_debugIds);
QmlJS::AST::UiObjectMember *possibleNode = 0; UiObjectMember *possibleNode = 0;
while (iter.hasNext()) { while (iter.hasNext()) {
iter.next(); iter.next();
QmlJS::AST::UiObjectMember *member = iter.key(); UiObjectMember *member = iter.key();
quint32 startOffset = member->firstSourceLocation().offset; quint32 startOffset = member->firstSourceLocation().offset;
quint32 endOffset = member->lastSourceLocation().offset; quint32 endOffset = member->lastSourceLocation().offset;
if (startOffset <= offset && offset <= endOffset) { if (startOffset <= offset && offset <= endOffset) {

View File

@@ -152,7 +152,7 @@ UnstartedAppWatcherDialog::UnstartedAppWatcherDialog(QWidget *parent)
connect(m_pathChooser, SIGNAL(pathChanged(QString)), this, SLOT(stopAndCheckExecutable())); connect(m_pathChooser, SIGNAL(pathChanged(QString)), this, SLOT(stopAndCheckExecutable()));
connect(m_closePushButton, SIGNAL(clicked()), this, SLOT(reject())); connect(m_closePushButton, SIGNAL(clicked()), this, SLOT(reject()));
connect(&m_timer, SIGNAL(timeout()), this, SLOT(findProcess())); connect(&m_timer, SIGNAL(timeout()), this, SLOT(findProcess()));
connect(m_kitChooser, &ProjectExplorer::KitChooser::currentIndexChanged, connect(m_kitChooser, &KitChooser::currentIndexChanged,
this, &UnstartedAppWatcherDialog::kitChanged); this, &UnstartedAppWatcherDialog::kitChanged);
kitChanged(); kitChanged();

View File

@@ -256,11 +256,11 @@ WatchModel::WatchModel(WatchHandler *handler)
root->appendChild(m_tooltipRoot = new WatchItem("tooltip", tr("Tooltip"))); root->appendChild(m_tooltipRoot = new WatchItem("tooltip", tr("Tooltip")));
setRootItem(root); setRootItem(root);
connect(action(SortStructMembers), &Utils::SavedAction::valueChanged, connect(action(SortStructMembers), &SavedAction::valueChanged,
this, &WatchModel::reinsertAllData); this, &WatchModel::reinsertAllData);
connect(action(ShowStdNamespace), &Utils::SavedAction::valueChanged, connect(action(ShowStdNamespace), &SavedAction::valueChanged,
this, &WatchModel::reinsertAllData); this, &WatchModel::reinsertAllData);
connect(action(ShowQtNamespace), &Utils::SavedAction::valueChanged, connect(action(ShowQtNamespace), &SavedAction::valueChanged,
this, &WatchModel::reinsertAllData); this, &WatchModel::reinsertAllData);
} }
@@ -1451,7 +1451,7 @@ void WatchHandler::clearWatches()
if (theWatcherNames.isEmpty()) if (theWatcherNames.isEmpty())
return; return;
const QDialogButtonBox::StandardButton ret = Utils::CheckableMessageBox::doNotAskAgainQuestion( const QDialogButtonBox::StandardButton ret = CheckableMessageBox::doNotAskAgainQuestion(
Core::ICore::mainWindow(), tr("Remove All Expression Evaluators"), Core::ICore::mainWindow(), tr("Remove All Expression Evaluators"),
tr("Are you sure you want to remove all expression evaluators?"), tr("Are you sure you want to remove all expression evaluators?"),
Core::ICore::settings(), QLatin1String("RemoveAllWatchers")); Core::ICore::settings(), QLatin1String("RemoveAllWatchers"));