diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 399c65e0c60680d45c4e6f91e07cef033f4c52da..7468b48287f10343ac29c9883479e25405f441f7 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -459,6 +459,8 @@ void DebuggerManager::init() watchersView->setModel(d->m_watchHandler->model(WatchersWatch)); connect(theDebuggerAction(AssignValue), SIGNAL(triggered()), this, SLOT(assignValueInDebugger()), Qt::QueuedConnection); + connect(theDebuggerAction(RemoveWatchExpression), SIGNAL(triggered()), + this, SLOT(updateWatchersWindow()), Qt::QueuedConnection); // Log connect(this, SIGNAL(emitShowInput(int, QString)), @@ -1802,6 +1804,8 @@ void DebuggerManager::setState(DebuggerState state, bool forced) theDebuggerAction(ExpandStack)->setEnabled(actionsEnabled); theDebuggerAction(ExecuteCommand)->setEnabled(d->m_state != DebuggerNotReady); + updateWatchersWindow(); + d->m_plugin->handleStateChanged(d->m_state); const bool notbusy = state == InferiorStopped || state == DebuggerNotReady @@ -1925,6 +1929,12 @@ void DebuggerManager::fontSettingsChanged(const TextEditor::FontSettings &settin changeFontSize(d->m_threadsWindow, size); } +void DebuggerManager::updateWatchersWindow() +{ + d->m_watchersWindow->setVisible( + d->m_watchHandler->model(WatchersWatch)->rowCount(QModelIndex()) > 0); +} + ////////////////////////////////////////////////////////////////////// // // AbstractDebuggerEngine diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index b968f4c3933748ef5c7143dcf02b225ba1e5f59c..87e23361ba9e8fe007d49144fb847654e682baa5 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -259,6 +259,7 @@ public slots: // FIXME void showDebuggerOutput(const QString &msg) { showDebuggerOutput(LogDebug, msg); } void ensureLogVisible(); + void updateWatchersWindow(); //private slots: // FIXME void showDebuggerOutput(int channel, const QString &msg); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 66794218e01c75bf9f8ff1cb85f1784fce7dca38..ff7eab54fcbc585372a0874f421a55bd41820f62 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1201,6 +1201,7 @@ void WatchHandler::endCycle() m_locals->endCycle(); m_watchers->endCycle(); m_tooltips->endCycle(); + m_manager->updateWatchersWindow(); } void WatchHandler::cleanup() diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 37a6d174fabc02634a88423dde4b8f3a630917e6..d3e4a3df43edec87da16eebe9446381436b94030 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -174,12 +174,15 @@ private: explicit WatchModel(WatchHandler *handler, WatchType type); virtual ~WatchModel(); +public: + int rowCount(const QModelIndex &idx) const; + int columnCount(const QModelIndex &idx) const; + +private: QVariant data(const QModelIndex &index, int role) const; bool setData(const QModelIndex &index, const QVariant &value, int role); QModelIndex index(int, int, const QModelIndex &idx) const; QModelIndex parent(const QModelIndex &idx) const; - int rowCount(const QModelIndex &idx) const; - int columnCount(const QModelIndex &idx) const; bool hasChildren(const QModelIndex &idx) const; Qt::ItemFlags flags(const QModelIndex &idx) const; QVariant headerData(int section, Qt::Orientation orientation,