diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 1d4f4674f9d..38b14d1a6bd 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -229,9 +229,6 @@ enum ModelRoles RequestShowMemoryRole, RequestShowDisassemblerRole, - // Threads - RequestSelectThreadRole, - // Modules RequestReloadModulesRole, RequestExamineModulesRole, diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 15b464d06f5..f9166bad7be 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -228,7 +228,7 @@ public: m_registerHandler(), m_sourceFilesHandler(engine), m_stackHandler(engine), - m_threadsHandler(engine), + m_threadsHandler(), m_watchHandler(engine), m_disassemblerViewAgent(engine), m_isSlaveEngine(false) diff --git a/src/plugins/debugger/threadshandler.cpp b/src/plugins/debugger/threadshandler.cpp index 9b180042e3d..a6e1ce328b0 100644 --- a/src/plugins/debugger/threadshandler.cpp +++ b/src/plugins/debugger/threadshandler.cpp @@ -30,7 +30,6 @@ #include "threadshandler.h" #include "debuggerconstants.h" -#include "debuggerengine.h" #include #include @@ -43,7 +42,8 @@ namespace Internal { // ThreadsHandler // /////////////////////////////////////////////////////////////////////// -static inline QString threadToolTip(const ThreadData &thread) + +static QString threadToolTip(const ThreadData &thread) { const char tableRowStartC[] = ""; const char tableRowSeparatorC[] = ""; @@ -87,9 +87,8 @@ static inline QString threadToolTip(const ThreadData &thread) // /////////////////////////////////////////////////////////////////////// -ThreadsHandler::ThreadsHandler(DebuggerEngine *engine) - : m_engine(engine), - m_currentIndex(0), +ThreadsHandler::ThreadsHandler() + : m_currentIndex(0), m_positionIcon(QLatin1String(":/debugger/images/location_16.png")), m_emptyIcon(QLatin1String(":/debugger/images/debugger_empty_14.png")) { @@ -179,16 +178,6 @@ QVariant ThreadsHandler::headerData return QVariant(); } -bool ThreadsHandler::setData - (const QModelIndex &index, const QVariant &value, int role) -{ - if (role == RequestSelectThreadRole) { - m_engine->selectThread(value.toInt()); - return true; - } - return QAbstractTableModel::setData(index, value, role); -} - int ThreadsHandler::currentThreadId() const { if (m_currentIndex < 0 || m_currentIndex >= m_threads.size()) diff --git a/src/plugins/debugger/threadshandler.h b/src/plugins/debugger/threadshandler.h index 719b7abac20..ec4dee9fcbd 100644 --- a/src/plugins/debugger/threadshandler.h +++ b/src/plugins/debugger/threadshandler.h @@ -38,8 +38,6 @@ #include "threaddata.h" namespace Debugger { -class DebuggerEngine; - namespace Internal { //////////////////////////////////////////////////////////////////////// @@ -54,7 +52,7 @@ class ThreadsHandler : public QAbstractTableModel Q_OBJECT public: - explicit ThreadsHandler(DebuggerEngine *engine); + ThreadsHandler(); int currentThread() const { return m_currentIndex; } void setCurrentThread(int index); @@ -75,12 +73,9 @@ private: int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; - bool setData(const QModelIndex &index, const QVariant &value, int role); QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; -private: - DebuggerEngine *m_engine; Threads m_threads; int m_currentIndex; const QIcon m_positionIcon; diff --git a/src/plugins/debugger/threadswindow.cpp b/src/plugins/debugger/threadswindow.cpp index 517bf824324..6c7ea9cdafd 100644 --- a/src/plugins/debugger/threadswindow.cpp +++ b/src/plugins/debugger/threadswindow.cpp @@ -29,8 +29,11 @@ #include "threadswindow.h" +#include "threadshandler.h" #include "debuggeractions.h" #include "debuggerconstants.h" +#include "debuggerengine.h" +#include "debuggerplugin.h" #include @@ -107,7 +110,8 @@ void ThreadsWindow::setAlwaysResizeColumnsToContents(bool on) void ThreadsWindow::selectThread(int index) { - model()->setData(QModelIndex(), index, RequestSelectThreadRole); + DebuggerPlugin::instance()->currentEngine() + ->threadsHandler()->selectThread(index); } } // namespace Internal