Debugger: Reduce line noise

Move some function out of the DebuggerCore "namespace", to avoid one
indirection and removes clutter in the calling code.

Change-Id: I1c870d5c7eeade32fa63dedf581490fbb090cd6a
Reviewed-by: Christian Stenger <christian.stenger@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
hjk
2014-07-28 14:23:52 +02:00
parent 15fcdabc1d
commit 5ac407eecc
30 changed files with 286 additions and 325 deletions

View File

@@ -55,20 +55,15 @@
namespace Debugger {
namespace Internal {
static DebuggerEngine *currentEngine()
{
return debuggerCore()->currentEngine();
}
StackTreeView::StackTreeView()
{
setWindowTitle(tr("Stack"));
connect(debuggerCore()->action(UseAddressInStackView), SIGNAL(toggled(bool)),
connect(action(UseAddressInStackView), SIGNAL(toggled(bool)),
SLOT(showAddressColumn(bool)));
connect(debuggerCore()->action(ExpandStack), SIGNAL(triggered()),
connect(action(ExpandStack), SIGNAL(triggered()),
SLOT(reloadFullStack()));
connect(debuggerCore()->action(MaximalStackDepth), SIGNAL(triggered()),
connect(action(MaximalStackDepth), SIGNAL(triggered()),
SLOT(reloadFullStack()));
showAddressColumn(false);
}
@@ -88,7 +83,7 @@ void StackTreeView::setModel(QAbstractItemModel *model)
BaseTreeView::setModel(model);
resizeColumnToContents(0);
resizeColumnToContents(3);
showAddressColumn(debuggerCore()->action(UseAddressInStackView)->isChecked());
showAddressColumn(action(UseAddressInStackView)->isChecked());
}
// Input a function to be disassembled. Accept CDB syntax
@@ -155,7 +150,7 @@ void StackTreeView::contextMenuEvent(QContextMenuEvent *ev)
const quint64 address = frame.address;
QMenu menu;
menu.addAction(debuggerCore()->action(ExpandStack));
menu.addAction(action(ExpandStack));
QAction *actCopyContents = menu.addAction(tr("Copy Contents to Clipboard"));
actCopyContents->setEnabled(model() != 0);
@@ -164,7 +159,7 @@ void StackTreeView::contextMenuEvent(QContextMenuEvent *ev)
actSaveTaskFile->setEnabled(model() != 0);
if (engine->hasCapability(CreateFullBacktraceCapability))
menu.addAction(debuggerCore()->action(CreateFullBacktrace));
menu.addAction(action(CreateFullBacktrace));
QAction *additionalQmlStackAction = 0;
if (engine->hasCapability(AdditionalQmlStackCapability))
@@ -204,12 +199,12 @@ void StackTreeView::contextMenuEvent(QContextMenuEvent *ev)
actLoadSymbols = menu.addAction(tr("Try to Load Unknown Symbols"));
if (engine->hasCapability(MemoryAddressCapability))
menu.addAction(debuggerCore()->action(UseAddressInStackView));
menu.addAction(action(UseAddressInStackView));
menu.addSeparator();
menu.addAction(debuggerCore()->action(UseToolTipsInStackView));
menu.addAction(action(UseToolTipsInStackView));
menu.addSeparator();
menu.addAction(debuggerCore()->action(SettingsDialog));
menu.addAction(action(SettingsDialog));
QAction *act = menu.exec(ev->globalPos());
if (!act)