From f88f4918a49a57ae0f59e804bddbc40fe7d88665 Mon Sep 17 00:00:00 2001 From: dt_ <qtc-committer@nokia.com> Date: Fri, 27 May 2011 14:34:48 +0200 Subject: [PATCH] Fix ProxyAction if layered 2 times Change-Id: Icf17f93deb259bfed85e138311d39300d72ee4b5 Reviewed-on: http://codereview.qt.nokia.com/193 Reviewed-by: hjk <qthjk@ovi.com> --- src/libs/utils/proxyaction.cpp | 10 +++++----- src/libs/utils/proxyaction.h | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libs/utils/proxyaction.cpp b/src/libs/utils/proxyaction.cpp index 90e2989e34a..f4d06076447 100644 --- a/src/libs/utils/proxyaction.cpp +++ b/src/libs/utils/proxyaction.cpp @@ -38,7 +38,8 @@ ProxyAction::ProxyAction(QObject *parent) : QAction(parent), m_action(0), m_attributes(0), - m_showShortcut(false) + m_showShortcut(false), + m_block(false) { connect(this, SIGNAL(changed()), this, SLOT(updateToolTipWithKeySequence())); updateState(); @@ -161,15 +162,14 @@ void ProxyAction::setShortcutVisibleInToolTip(bool visible) void ProxyAction::updateToolTipWithKeySequence() { - static bool block = false; - if (block) + if (m_block) return; - block = true; + m_block = true; if (!m_showShortcut || shortcut().isEmpty()) setToolTip(m_toolTip); else setToolTip(stringWithAppendedShortcut(m_toolTip, shortcut())); - block = false; + m_block = false; } QString ProxyAction::stringWithAppendedShortcut(const QString &str, const QKeySequence &shortcut) diff --git a/src/libs/utils/proxyaction.h b/src/libs/utils/proxyaction.h index 2cd6b70accb..f06682c99a2 100644 --- a/src/libs/utils/proxyaction.h +++ b/src/libs/utils/proxyaction.h @@ -81,6 +81,7 @@ private: Attributes m_attributes; bool m_showShortcut; QString m_toolTip; + bool m_block; }; } // namespace Utils -- GitLab