Debugger: Simplify thread switching more

This moves the thread switcher combobox, the only consumer
of part of the threadhandler interface, into the threadhandler.

Change-Id: Icafd72e7777fad9196ce8fb33a79cae26c29a521
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-08-31 18:30:14 +02:00
parent 944aa963a8
commit 86cd29b13c
5 changed files with 21 additions and 39 deletions

View File

@@ -29,6 +29,7 @@
#include <utils/treemodel.h>
#include <QComboBox>
#include <QPointer>
////////////////////////////////////////////////////////////////////////
@@ -77,7 +78,6 @@ class ThreadsHandler : public ThreadsHandlerModel
public:
explicit ThreadsHandler(DebuggerEngine *engine);
int currentThreadIndex() const;
Thread currentThread() const;
Thread threadForId(const QString &id) const;
void setCurrentThread(const Thread &thread);
@@ -95,6 +95,8 @@ public:
void notifyRunning(const QString &id);
void notifyStopped(const QString &id);
QComboBox *threadSwitcher() { return m_comboBox; }
private:
void sort(int column, Qt::SortOrder order) override;
QVariant data(const QModelIndex &index, int role) const override;
@@ -103,6 +105,7 @@ private:
DebuggerEngine *m_engine;
Thread m_currentThread;
QHash<QString, QString> m_pidForGroupId;
QComboBox *m_comboBox;
};
} // namespace Internal