Removed the default value in setAutoExpireDelay, and allow the auto expire timer to be

cancelled by calling setAutoExpireDelay(0).


svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=841701
This commit is contained in:
Rob Scheepmaker 2008-08-03 21:47:21 +00:00
parent bfb9e05b91
commit cfcda8ddf3
2 changed files with 10 additions and 1 deletions

View File

@ -434,6 +434,15 @@ bool ExtenderItem::isCollapsed() const
void ExtenderItem::setAutoExpireDelay(uint time) void ExtenderItem::setAutoExpireDelay(uint time)
{ {
if (!time) {
if (d->expirationTimer) {
d->expirationTimer->stop();
delete d->expirationTimer;
d->expirationTimer = 0;
}
return;
}
if (!isDetached()) { if (!isDetached()) {
if (!d->expirationTimer) { if (!d->expirationTimer) {
d->expirationTimer = new QTimer(this); d->expirationTimer = new QTimer(this);

View File

@ -136,7 +136,7 @@ class PLASMA_EXPORT ExtenderItem : public QGraphicsWidget
* @param time (in ms) before this extender item destroys itself unless it is detached, * @param time (in ms) before this extender item destroys itself unless it is detached,
* in which case this extender stays around. 0 means forever and is the default. * in which case this extender stays around. 0 means forever and is the default.
*/ */
void setAutoExpireDelay(uint time = 0); void setAutoExpireDelay(uint time);
/** /**
* @return whether or not this extender item has an auto expire delay. * @return whether or not this extender item has an auto expire delay.