aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/debugger/stackhandler.h
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2010-05-18 12:12:22 +0200
committerhjk <qtc-committer@nokia.com>2010-05-18 12:13:27 +0200
commit35bfbec79765047e71a36ac728f38e4662c1553c (patch)
treee50fccb29c474bc95728258833055f6727f2d2a2 /src/plugins/debugger/stackhandler.h
parent53e9c4fad694d760484a225460426f1cfe4d8e42 (diff)
debugger: refactor thread related class
Diffstat (limited to 'src/plugins/debugger/stackhandler.h')
-rw-r--r--src/plugins/debugger/stackhandler.h64
1 files changed, 6 insertions, 58 deletions
diff --git a/src/plugins/debugger/stackhandler.h b/src/plugins/debugger/stackhandler.h
index f0aa893ad51..28c5cd1029f 100644
--- a/src/plugins/debugger/stackhandler.h
+++ b/src/plugins/debugger/stackhandler.h
@@ -40,6 +40,12 @@
namespace Debugger {
namespace Internal {
+////////////////////////////////////////////////////////////////////////
+//
+// StackModel
+//
+////////////////////////////////////////////////////////////////////////
+
struct StackCookie
{
StackCookie() : isFull(true), gotoLocation(false) {}
@@ -92,64 +98,6 @@ private:
};
-////////////////////////////////////////////////////////////////////////
-//
-// ThreadsHandler
-//
-////////////////////////////////////////////////////////////////////////
-
-struct ThreadData
-{
- ThreadData(int threadId = 0);
-
- // Permanent data.
- int id;
- QString targetId;
- QString core;
-
- // State information when stopped
- void notifyRunning(); // Clear state information
-
- int frameLevel;
- quint64 address;
- QString function;
- QString fileName;
- QString state;
- int lineNumber;
-};
-
-/*! A model to represent the running threads in a QTreeView or ComboBox */
-class ThreadsHandler : public QAbstractTableModel
-{
- Q_OBJECT
-
-public:
- ThreadsHandler(QObject *parent = 0);
-
- int currentThreadId() const;
- void setCurrentThread(int index);
- void selectThread(int index);
- void setThreads(const QList<ThreadData> &threads);
- void removeAll();
- QList<ThreadData> threads() const;
- QAbstractItemModel *threadsModel() { return this; }
-
- // Clear out all frame information
- void notifyRunning();
-
-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;
- QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
-
-private:
- QList<ThreadData> m_threads;
- int m_currentIndex;
- const QIcon m_positionIcon;
- const QIcon m_emptyIcon;
-};
-
} // namespace Internal
} // namespace Debugger