avoid recursive calls to updateToolTip by doing what we *really* want to be doing here, which is updating the data. this also prevents the case where a tooltip is updated randomly, causing the tooltip to show. i wonder if that's what has been the cause of the occasional taskbar tooltip showing when it shouldn't?

reviewed by Rafał Miłecki

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=794638
This commit is contained in:
Aaron J. Seigo 2008-04-08 07:20:36 +00:00
parent 30b0cef28a
commit 1f6d6175a7
3 changed files with 11 additions and 3 deletions

View File

@ -230,6 +230,13 @@ ToolTip::~ToolTip()
delete d;
}
void ToolTip::setData(Plasma::Widget *widget, const Plasma::ToolTipData &data)
{
if (d->currentWidget && d->currentWidget == widget) {
setData(data);
}
}
void ToolTip::setData(const Plasma::ToolTipData &data)
{
//reset our size

View File

@ -50,6 +50,7 @@ public:
void hide();
Plasma::Widget *currentWidget() const;
void setData(Plasma::Widget *widget, const Plasma::ToolTipData &data);
protected:
void showEvent(QShowEvent *);

View File

@ -393,13 +393,13 @@ void Widget::setToolTip(const ToolTipData &tip)
*d->toolTip = tip;
if (ToolTip::self()->currentWidget() == this) {
ToolTip::self()->show(this);
}
// this does a check to ensure the current widget is us
ToolTip::self()->setData(this, *d->toolTip);
}
void Widget::updateToolTip(bool update)
{
Q_UNUSED(update)
}
void Widget::paintWidget(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)