self(), not instance(), in line with all other singletons in plasma

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=758186
This commit is contained in:
Aaron J. Seigo 2008-01-07 04:39:36 +00:00
parent e9b9ccf11e
commit 402cfc7d26
3 changed files with 9 additions and 9 deletions

View File

@ -68,7 +68,7 @@ class ToolTipSingleton
}; };
K_GLOBAL_STATIC( ToolTipSingleton, privateInstance ) K_GLOBAL_STATIC( ToolTipSingleton, privateInstance )
ToolTip *ToolTip::instance() ToolTip *ToolTip::self()
{ {
return &privateInstance->self; return &privateInstance->self;
} }

View File

@ -43,7 +43,7 @@ public:
ToolTip(); ToolTip();
~ToolTip(); ~ToolTip();
static ToolTip *instance(); static ToolTip *self();
void show(const QPoint &location, Plasma::Widget *widget); void show(const QPoint &location, Plasma::Widget *widget);
void hide(); void hide();

View File

@ -140,8 +140,8 @@ Widget::Widget(QGraphicsItem *parent, QObject* parentObject)
Widget::~Widget() Widget::~Widget()
{ {
if (ToolTip::instance()->currentWidget() == this) { if (ToolTip::self()->currentWidget() == this) {
ToolTip::instance()->hide(); ToolTip::self()->hide();
} }
delete d; delete d;
} }
@ -503,10 +503,10 @@ ToolTipData Widget::toolTip() const
void Widget::setToolTip(const ToolTipData &tip) void Widget::setToolTip(const ToolTipData &tip)
{ {
d->toolTip = tip; d->toolTip = tip;
if (ToolTip::instance()->currentWidget() == this) { if (ToolTip::self()->currentWidget() == this) {
QPoint viewPos = view()->mapFromScene(scenePos()); QPoint viewPos = view()->mapFromScene(scenePos());
QPoint globalPos = view()->mapToGlobal(viewPos); QPoint globalPos = view()->mapToGlobal(viewPos);
ToolTip::instance()->show(globalPos, this); ToolTip::self()->show(globalPos, this);
} }
} }
@ -560,7 +560,7 @@ bool Widget::sceneEvent(QEvent *event)
case QEvent::GraphicsSceneHoverMove: case QEvent::GraphicsSceneHoverMove:
// If the tooltip isn't visible, run through showing the tooltip again // If the tooltip isn't visible, run through showing the tooltip again
// so that it only becomes visible after a stationary hover // so that it only becomes visible after a stationary hover
if (ToolTip::instance()->isVisible()) { if (ToolTip::self()->isVisible()) {
break; break;
} }
@ -580,7 +580,7 @@ bool Widget::sceneEvent(QEvent *event)
if (parentView) { if (parentView) {
QPoint viewPos = parentView->mapFromScene(scenePos()); QPoint viewPos = parentView->mapFromScene(scenePos());
QPoint globalPos = parentView->mapToGlobal(viewPos); QPoint globalPos = parentView->mapToGlobal(viewPos);
ToolTip::instance()->show(globalPos, this); ToolTip::self()->show(globalPos, this);
} }
break; break;
@ -589,7 +589,7 @@ bool Widget::sceneEvent(QEvent *event)
case QEvent::GraphicsSceneHoverLeave: case QEvent::GraphicsSceneHoverLeave:
case QEvent::GraphicsSceneMousePress: case QEvent::GraphicsSceneMousePress:
case QEvent::GraphicsSceneWheel: case QEvent::GraphicsSceneWheel:
ToolTip::instance()->hide(); ToolTip::self()->hide();
default: default:
break; break;