diff options
author | hjk <[email protected]> | 2014-07-28 14:23:52 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2014-07-28 15:48:15 +0200 |
commit | 5ac407eeccc446b9ba958cea2cc1fb47e4090dd4 (patch) | |
tree | 6e48d9fe5a335efc8d5208b5000885ba2db710ba /src/plugins/debugger/debuggerplugin.cpp | |
parent | 15fcdabc1d18f55a68a91251e8c581791c1aff8f (diff) |
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 <[email protected]>
Reviewed-by: hjk <[email protected]>
Diffstat (limited to 'src/plugins/debugger/debuggerplugin.cpp')
-rw-r--r-- | src/plugins/debugger/debuggerplugin.cpp | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 5b556e6462d..99f46413a4d 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -533,7 +533,7 @@ public: static QWidget *addSearch(BaseTreeView *treeView, const QString &title, const char *objectName) { - QAction *act = debuggerCore()->action(UseAlternatingRowColors); + QAction *act = action(UseAlternatingRowColors); treeView->setAlternatingRowColors(act->isChecked()); QObject::connect(act, SIGNAL(toggled(bool)), treeView, SLOT(setAlternatingRowColorsHelper(bool))); @@ -715,7 +715,6 @@ public: void connectEngine(DebuggerEngine *engine); void disconnectEngine() { connectEngine(0); } - DebuggerEngine *currentEngine() const { return m_currentEngine; } DebuggerEngine *dummyEngine(); void setThreads(const QStringList &list, int index) @@ -897,9 +896,6 @@ public slots: bool isReverseDebugging() const; - BreakHandler *breakHandler() const { return m_breakHandler; } - SnapshotHandler *snapshotHandler() const { return m_snapshotHandler; } - void displayDebugger(DebuggerEngine *engine, bool updateEngine = true); void dumpLog(); @@ -1158,11 +1154,6 @@ public slots: void openTextEditor(const QString &titlePattern0, const QString &contents); void showMessage(const QString &msg, int channel, int timeout = -1); - SavedAction *action(int code) const; - bool boolSetting(int code) const; - QString stringSetting(int code) const; - QStringList stringListSetting(int code) const; - void showModuleSymbols(const QString &moduleName, const Symbols &symbols); void showModuleSections(const QString &moduleName, const Sections §ions); @@ -1497,12 +1488,12 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, return true; } -void DebuggerCore::setConfigValue(const QByteArray &name, const QVariant &value) +void setConfigValue(const QByteArray &name, const QVariant &value) { ICore::settings()->setValue(_("DebugMode/" + name), value); } -QVariant DebuggerCore::configValue(const QByteArray &name) +QVariant configValue(const QByteArray &name) { return ICore::settings()->value(_("DebugMode/" + name)); } @@ -2029,7 +2020,7 @@ void DebuggerPluginPrivate::toggleBreakpointByFileAndLine(const QString &fileNam handler->removeBreakpoint(id); } else { BreakpointParameters data(BreakpointByFileAndLine); - if (debuggerCore()->boolSetting(BreakpointsFullPathByDefault)) + if (boolSetting(BreakpointsFullPathByDefault)) data.pathUsage = BreakpointUseFullPath; data.tracepoint = !tracePointMessage.isEmpty(); data.message = tracePointMessage; @@ -2536,12 +2527,12 @@ const CPlusPlus::Snapshot &DebuggerPluginPrivate::cppCodeModelSnapshot() const return m_codeModelSnapshot; } -void DebuggerCore::setSessionValue(const QByteArray &key, const QVariant &value) +void setSessionValue(const QByteArray &key, const QVariant &value) { SessionManager::setValue(QString::fromUtf8(key), value); } -QVariant DebuggerCore::sessionValue(const QByteArray &key) +QVariant sessionValue(const QByteArray &key) { return SessionManager::value(QString::fromUtf8(key)); } @@ -3366,25 +3357,35 @@ void DebuggerPluginPrivate::extensionsInitialized() // time gdb -i mi -ex 'b debuggerplugin.cpp:800' -ex r -ex q bin/qtcreator.bin } -SavedAction *DebuggerPluginPrivate::action(int code) const +DebuggerEngine *currentEngine() +{ + return theDebuggerCore->m_currentEngine; +} + +SavedAction *action(int code) { - return m_debuggerSettings->item(code); + return theDebuggerCore->m_debuggerSettings->item(code); } -bool DebuggerPluginPrivate::boolSetting(int code) const +bool boolSetting(int code) { - return m_debuggerSettings->item(code)->value().toBool(); + return theDebuggerCore->m_debuggerSettings->item(code)->value().toBool(); } -QString DebuggerPluginPrivate::stringSetting(int code) const +QString stringSetting(int code) { - QString raw = m_debuggerSettings->item(code)->value().toString(); + QString raw = theDebuggerCore->m_debuggerSettings->item(code)->value().toString(); return VariableManager::expandedString(raw); } -QStringList DebuggerPluginPrivate::stringListSetting(int code) const +QStringList stringListSetting(int code) +{ + return theDebuggerCore->m_debuggerSettings->item(code)->value().toStringList(); +} + +BreakHandler *breakHandler() { - return m_debuggerSettings->item(code)->value().toStringList(); + return theDebuggerCore->m_breakHandler; } void DebuggerPluginPrivate::showModuleSymbols(const QString &moduleName, |