From 9c57b1000f51719a44e64d4edf9c2af912877f11 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 7 Feb 2012 15:39:27 +0100 Subject: [PATCH] debugger: Do not display empty tooltips Task-number: QTCREATORBUG-6893 Change-Id: Idb780e97c23f6cc5d1bcede149959b2e58f9eaa2 Reviewed-by: hjk <qthjk@ovi.com> --- src/plugins/debugger/gdb/gdbengine.cpp | 5 ++--- src/plugins/debugger/watchhandler.cpp | 6 ++++++ src/plugins/debugger/watchhandler.h | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index c0e642e7950..af0a011fad3 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3734,10 +3734,9 @@ bool GdbEngine::showToolTip() return true; } - const QModelIndex index = watchHandler()->itemIndex(iname); - if (!index.isValid()) { + if (!watchHandler()->isValidToolTip(iname)) { watchHandler()->removeData(iname); - return false; + return true; } DebuggerToolTipWidget *tw = new DebuggerToolTipWidget; tw->setExpression(expression); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index b925766366f..542b7d2469a 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -1893,5 +1893,11 @@ void WatchHandler::resetLocation() } } +bool WatchHandler::isValidToolTip(const QByteArray &iname) const +{ + WatchItem *item = m_tooltips->findItem(iname, m_tooltips->m_root); + return item && !item->type.trimmed().isEmpty(); +} + } // namespace Internal } // namespace Debugger diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 8127c424bd9..3922d6866e9 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -203,6 +203,7 @@ public: void scheduleResetLocation(); void resetLocation(); + bool isValidToolTip(const QByteArray &iname) const; private: friend class WatchModel; -- GitLab