KFadeWidgetEffect bugfix

Matthias Kretz kretz at kde.org
Thu Feb 21 13:48:51 GMT 2008


On Friday 15 February 2008, Rafael Fernández López wrote:
>  KFadeWidgetEffect::KFadeWidgetEffect(QWidget *destWidget)
> -    : QWidget(destWidget ? destWidget->parentWidget() : 0),
> -    d_ptr(new KFadeWidgetEffectPrivate(destWidget))
> +    : QWidget(destWidget && destWidget->parentWidget() ? 
destWidget->parentWidget() : destWidget)
> +    , d_ptr(new KFadeWidgetEffectPrivate(destWidget))

Please keep the comma where it was (I would've liked to specify that in the 
coding style guidelines, but for brevity it was omitted).

Did you notice the Q_ASSERT a few lines down? If destWidget were 0 it would 
abort() (in a debug build). There must be a different problem you're looking 
for.

>  {
> +    if (KGlobalSettings::animationsEnabled()) {
>      Q_D(KFadeWidgetEffect);
>      d->q_ptr = this;
>      Q_ASSERT(destWidget && destWidget->parentWidget());
> @@ -41,6 +43,9 @@ KFadeWidgetEffect::KFadeWidgetEffect(QWi
>      connect(&d->timeLine, SIGNAL(finished()), SLOT(finished()));
>      connect(&d->timeLine, SIGNAL(frameChanged(int)), SLOT(repaint()));
>      show();
> +    } else {
> +        deleteLater();
> +    }

Uhm, what if this deleteLater gets carried out before start() gets called? 
Better move the deleteLater into start().

>  }
>  
>  KFadeWidgetEffect::~KFadeWidgetEffect()

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080221/d6f8cad3/attachment.sig>


More information about the kde-core-devel mailing list