[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] Animations enable/disable system wide
From:       Rafael =?utf-8?q?Fern=C3=A1ndez_L=C3=B3pez?= <ereslibre () kde ! org>
Date:       2008-02-15 18:52:10
Message-ID: 200802151952.14030.ereslibre () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hi all,

Attached are the patches to kdelibs and kdebase.

OK to commit ?


Bye,
Rafael Fern=C3=A1ndez L=C3=B3pez.

["kdelibs.diff" (text/x-patch)]

Index: kio/kio/kfileitemdelegate.cpp
===================================================================
--- kio/kio/kfileitemdelegate.cpp	(revisión: 775050)
+++ kio/kio/kfileitemdelegate.cpp	(copia de trabajo)
@@ -22,7 +22,6 @@
 #include <config.h>
 
 #include "kfileitemdelegate.h"
-#include "kfileitemdelegate.moc"
 
 #include <QApplication>
 #include <QStyle>
@@ -42,6 +41,7 @@
 #include <kdirmodel.h>
 #include <kfileitem.h>
 #include <kcolorscheme.h>
+#include <kglobalsettings.h>
 
 #include "delegateanimationhandler_p.h"
 
@@ -687,6 +687,9 @@ KIO::AnimationState *KFileItemDelegate::
                                                                 const QModelIndex \
                &index,
                                                                 const \
QAbstractItemView *view) const  {
+    if (!KGlobalSettings::animationsEnabled())
+        return NULL;
+
     if (index.column() == KDirModel::Name)
         return animationHandler->animationState(option, index, view);
 
@@ -1335,4 +1338,7 @@ bool KFileItemDelegate::helpEvent(QHelpE
 }
 
 
+#include "kfileitemdelegate.moc"
+
+
 // kate: space-indent on; indent-width 4; replace-tabs on;
Index: kio/kfile/kimagefilepreview.cpp
===================================================================
--- kio/kfile/kimagefilepreview.cpp	(revisión: 775050)
+++ kio/kfile/kimagefilepreview.cpp	(copia de trabajo)
@@ -2,6 +2,7 @@
  * This file is part of the KDE project
  * Copyright (C) 2001 Martin R. Jones <mjones@kde.org>
  *               2001 Carsten Pfeiffer <pfeiffer@kde.org>
+ *               2008 Rafael Fernández López <ereslibre@kde.org>
  *
  * You can Freely distribute this program under the GNU Library General Public
  * License. See the file "COPYING" for the exact licensing terms.
@@ -19,6 +20,7 @@
 #include <QtCore/QTimeLine>
 
 #include <kapplication.h>
+#include <kglobalsettings.h>
 #include <kconfig.h>
 #include <kglobal.h>
 #include <kiconloader.h>
@@ -176,6 +178,8 @@ KIO::PreviewJob * KImageFilePreview::cre
 void KImageFilePreview::gotPreview( const KFileItem& item, const QPixmap& pm )
 {
     if (item.url() == d->currentURL) {  // should always be the case
+        if (KGlobalSettings::animationsEnabled())
+        {
         if (d->m_timeLine->state() == QTimeLine::Running) {
             d->m_timeLine->setCurrentTime(0);
         }
@@ -186,6 +190,11 @@ void KImageFilePreview::gotPreview( cons
         d->m_timeLine->setDirection(QTimeLine::Forward);
         d->m_timeLine->start();
     }
+        else
+        {
+            d->imageLabel->setPixmap(pm);
+        }
+    }
 }
 
 void KImageFilePreview::KImageFilePreviewPrivate::_k_slotFailed( const KFileItem& \
item ) @@ -250,12 +259,19 @@ void KImageFilePreview::clearPreview()
         return;
     }
 
+    if (KGlobalSettings::animationsEnabled())
+    {
     d->m_pmTransition = QPixmap();
     d->m_timeLine->setCurrentTime(0);
     d->m_timeLine->setDirection(QTimeLine::Backward);
     d->m_timeLine->start();
     d->currentURL = KUrl();
     d->clear = true;
+    }
+    else
+    {
+        d->imageLabel->clear();
+    }
 }
 
 #include "kimagefilepreview.moc"
Index: kio/kfile/kimagefilepreview.h
===================================================================
--- kio/kfile/kimagefilepreview.h	(revisión: 775050)
+++ kio/kfile/kimagefilepreview.h	(copia de trabajo)
@@ -3,6 +3,7 @@
  * This file is part of the KDE project.
  * Copyright (C) 2001 Martin R. Jones <mjones@kde.org>
  *               2001 Carsten Pfeiffer <pfeiffer@kde.org>
+ *               2008 Rafael Fernández López <ereslibre@kde.org>
  *
  * You can Freely distribute this program under the GNU Library General Public
  * License. See the file "COPYING" for the exact licensing terms.
Index: kdeui/kernel/kglobalsettings.h
===================================================================
--- kdeui/kernel/kglobalsettings.h	(revisión: 775050)
+++ kdeui/kernel/kglobalsettings.h	(copia de trabajo)
@@ -408,6 +408,24 @@ public:
     static bool showIconsOnPushButtons();
 
     /**
+     * This function determines if the user wishes builtin animations to
+     * be skipped or not.
+     *
+     * @return Returns true if user wants builtin animations to be enabled.
+     *
+     * @since 4.1
+     */
+    static bool animationsEnabled();
+
+    /**
+     * This function should determine depending on the desktop state if
+     * animations should be enabled by default or not.
+     *
+     * @since 4.1
+     */
+    static bool animationsEnabledDefault();
+
+    /**
      * This function determines if the user wishes to see previews
      * for the selected url
      *
Index: kdeui/kernel/kglobalsettings.cpp
===================================================================
--- kdeui/kernel/kglobalsettings.cpp	(revisión: 775050)
+++ kdeui/kernel/kglobalsettings.cpp	(copia de trabajo)
@@ -86,6 +86,7 @@ static QFont *_taskbarFont = 0;
 static QFont *_largeFont = 0;
 static QFont *_smallestReadableFont = 0;
 //static QColor *_buttonBackground = 0;
+static bool _animationsEnabled = false;
 
 static KGlobalSettings::KMouseSettings *s_mouseSettings = 0;
 
@@ -126,17 +127,21 @@ class KGlobalSettings::Private
          */
         static void initPaths();
         /**
-         * drop cached values for fonts (called by KApplication)
+         * drop cached values for fonts
          */
         static void rereadFontSettings();
         /**
-         * drop cached values for paths (called by KApplication)
+         * drop cached values for paths
          */
         static void rereadPathSettings();
         /**
-         * drop cached values for mouse settings (called by KApplication)
+         * drop cached values for mouse settings
          */
         static void rereadMouseSettings();
+        /**
+         * drop cached values for settings that aren't in any of the previous groups
+         */
+        static void rereadOtherSettings();
 
         KGlobalSettings *q;
 };
@@ -736,6 +741,29 @@ bool KGlobalSettings::showIconsOnPushBut
                        KDE_DEFAULT_ICON_ON_PUSHBUTTON);
 }
 
+bool KGlobalSettings::animationsEnabled()
+{
+    // This variable stores whether _animationsEnabled has the default value because \
it has not been +    // loaded yet, or if it has been loaded from the user settings \
or defaults and contains a valid +    // value.
+    static bool _animationsEnabledInitialized = false;
+
+    if (!_animationsEnabledInitialized) {
+        _animationsEnabledInitialized = true;
+        Private::rereadOtherSettings();
+    }
+
+    return _animationsEnabled;
+}
+
+bool KGlobalSettings::animationsEnabledDefault()
+{
+    // For now, let always enable animations by default. The plan is to make
+    // this code a bit smarter. (ereslibre)
+
+    return true;
+}
+
 bool KGlobalSettings::showFilePreview(const KUrl &url)
 {
     KConfigGroup g(KGlobal::config(), "PreviewSettings");
@@ -792,6 +820,7 @@ void KGlobalSettings::Private::_k_slotNo
 
     case SettingsChanged: {
         KGlobal::config()->reparseConfiguration();
+        rereadOtherSettings();
         SettingsCategory category = static_cast<SettingsCategory>(arg);
         if (category == SETTINGS_PATHS) {
             KGlobalSettings::Private::rereadPathSettings();
@@ -988,6 +1017,16 @@ void KGlobalSettings::Private::kdisplayS
 }
 
 
+void KGlobalSettings::Private::rereadOtherSettings()
+{
+    KConfigGroup g( KGlobal::config(), "KDE-Global GUI Settings" );
+
+    // When the method KGlobalSettings::animationsEnabledDefault() becomes more \
heavy, we should +    // consider using here hasKey() method, for calling it only \
when necessary. +    _animationsEnabled = g.readEntry("EnableBuiltinEffects", \
KGlobalSettings::animationsEnabledDefault()); +}
+
+
 void KGlobalSettings::Private::applyCursorTheme()
 {
 #if defined(Q_WS_X11) && defined(HAVE_XCURSOR)
Index: kdeui/widgets/kfadewidgeteffect.cpp
===================================================================
--- kdeui/widgets/kfadewidgeteffect.cpp	(revisión: 775050)
+++ kdeui/widgets/kfadewidgeteffect.cpp	(copia de trabajo)
@@ -22,6 +22,7 @@
 #include "kfadewidgeteffect_p.h"
 #include <QtCore/QEvent>
 #include <QtGui/QPainter>
+#include <kglobalsettings.h>
 
 KFadeWidgetEffectPrivate::KFadeWidgetEffectPrivate(QWidget *_destWidget)
     : destWidget(_destWidget)
@@ -29,9 +30,10 @@ KFadeWidgetEffectPrivate::KFadeWidgetEff
 }
 
 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))
 {
+    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();
+    }
 }
 
 KFadeWidgetEffect::~KFadeWidgetEffect()
Index: kdeui/widgets/klineedit.cpp
===================================================================
--- kdeui/widgets/klineedit.cpp	(revisión: 775050)
+++ kdeui/widgets/klineedit.cpp	(copia de trabajo)
@@ -89,6 +89,15 @@ public:
 //        delete completionBox;
     }
 
+    void _k_slotSettingsChanged(int category)
+    {
+        Q_UNUSED(category);
+
+        if (clearButton) {
+            clearButton->setAnimationsEnabled(KGlobalSettings::animationsEnabled());
+        }
+    }
+
     static bool initialized;
     static bool backspacePerformsCompletion; // Configuration option
 
@@ -186,6 +195,8 @@ void KLineEdit::init()
                       mode == KGlobalSettings::CompletionAuto);
     connect( this, SIGNAL(selectionChanged()), this, \
SLOT(slotRestoreSelectionColors()));  
+    connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)), this, \
SLOT(_k_slotSettingsChanged(int))); +
     QPalette p = palette();
     if ( !d->previousHighlightedTextColor.isValid() )
       d->previousHighlightedTextColor=p.color(QPalette::Normal,QPalette::HighlightedText);
                
Index: kdeui/widgets/kmainwindow_p.h
===================================================================
--- kdeui/widgets/kmainwindow_p.h	(revisión: 775050)
+++ kdeui/widgets/kmainwindow_p.h	(copia de trabajo)
@@ -52,6 +52,9 @@ public:
     QString dbusName;
 
     void _k_shuttingDown();
+    // This slot will be called when the style KCM changes settings that need
+    // to be set on the already running applications.
+    void _k_slotSettingsChanged(int category);
 
     void init(KMainWindow *_q);
     void polish(KMainWindow *q);
Index: kdeui/widgets/kmainwindow.h
===================================================================
--- kdeui/widgets/kmainwindow.h	(revisión: 775050)
+++ kdeui/widgets/kmainwindow.h	(copia de trabajo)
@@ -701,6 +701,7 @@ protected:
     KMainWindowPrivate * const k_ptr;
 private:
     Q_PRIVATE_SLOT(k_func(), void _k_shuttingDown())
+    Q_PRIVATE_SLOT(k_func(), void _k_slotSettingsChanged(int))
 };
 
 #define RESTORE(type) { int n = 1;\
Index: kdeui/widgets/klineedit.h
===================================================================
--- kdeui/widgets/klineedit.h	(revisión: 775050)
+++ kdeui/widgets/klineedit.h	(copia de trabajo)
@@ -628,6 +628,8 @@ private:
 private:
     class KLineEditPrivate;
     KLineEditPrivate *const d;
+
+    Q_PRIVATE_SLOT( d, void _k_slotSettingsChanged( int category ) );
 };
 
 #endif
Index: kdeui/widgets/kmainwindow.cpp
===================================================================
--- kdeui/widgets/kmainwindow.cpp	(revisión: 775050)
+++ kdeui/widgets/kmainwindow.cpp	(copia de trabajo)
@@ -58,6 +58,7 @@
 #include <ktoolbar.h>
 #include <kwindowsystem.h>
 #include <kconfiggroup.h>
+#include <kglobalsettings.h>
 
 #if defined Q_WS_X11
 #include <qx11info_x11.h>
@@ -219,6 +220,8 @@ void KMainWindowPrivate::init(KMainWindo
 {
     q = _q;
 
+    q->setAnimated(KGlobalSettings::animationsEnabled());
+
     q->setAttribute( Qt::WA_DeleteOnClose );
 
     KWhatsThisManager::init ();
@@ -227,6 +230,8 @@ void KMainWindowPrivate::init(KMainWindo
 
     //actionCollection()->setWidget( this );
     QObject::connect(qApp, SIGNAL(aboutToQuit()), q, SLOT(_k_shuttingDown()));
+    QObject::connect(KGlobalSettings::self(), SIGNAL(settingsChanged(int)),
+                     q, SLOT(_k_slotSettingsChanged(int)));
 
     // force KMWSessionManager creation - someone a better idea?
     ksm->dummyInit();
@@ -860,6 +865,8 @@ void KMainWindow::setSettingsDirty()
         d->settingsTimer->setSingleShot(true);
         d->settingsTimer->start();
     }
+
+kDebug(1000) << "yeah, here again..";
 }
 
 bool KMainWindow::settingsDirty() const
@@ -1006,6 +1013,19 @@ void KMainWindowPrivate::_k_shuttingDown
     }
 }
 
+void KMainWindowPrivate::_k_slotSettingsChanged(int category)
+{
+    Q_UNUSED(category);
+
+    // This slot will be called when the style KCM changes settings that need
+    // to be set on the already running applications.
+
+    // At this level (KMainWindow) the only thing we need to restore is the
+    // animations setting (whether the user wants builtin animations or not).
+
+    q->setAnimated(KGlobalSettings::animationsEnabled());
+}
+
 KToolBar *KMainWindow::toolBar( const QString& name )
 {
     QString childName = name;
Index: kdeui/widgets/klineedit_p.h
===================================================================
--- kdeui/widgets/klineedit_p.h	(revisión: 775050)
+++ kdeui/widgets/klineedit_p.h	(copia de trabajo)
@@ -27,6 +27,8 @@
 #include <QPaintEvent>
 #include <QTimeLine>
 
+#include <kglobalsettings.h>
+
 class KLineEditButton : public QWidget
 {
     Q_OBJECT
@@ -67,8 +69,12 @@ public:
             m_timeline->setDuration(250);
         }
 
+        if (KGlobalSettings::animationsEnabled()) {
         if (m_timeline->state() != QTimeLine::Running)
             m_timeline->start();
+        } else {
+            setVisible(m_timeline->direction() == QTimeLine::Forward);
+        }
     }
 
     void setPixmap(const QPixmap& p)
@@ -81,11 +87,24 @@ public:
         return m_pixmap;
     }
 
+    void setAnimationsEnabled(bool animationsEnabled)
+    {
+        // We need to set the current time in the case that we had the clear
+        // button shown, for it being painted on the paintEvent(). Otherwise
+        // it wont be painted, resulting (m->timeLine->currentTime() == 0) true,
+        // and therefore a bad painting. This is needed for the case that we
+        // come from a non animated widget and want it animated. (ereslibre)
+        if (KGlobalSettings::animationsEnabled() && m_timeline->direction() == \
QTimeLine::Forward) { +            m_timeline->setCurrentTime(150);
+        }
+    }
+
 protected:
     void paintEvent(QPaintEvent *event)
     {
         Q_UNUSED(event)
 
+        if (KGlobalSettings::animationsEnabled()) {
         if (m_pixmap.isNull() || m_timeline->currentTime() == 0) {
             return;
         }
@@ -95,6 +114,13 @@ protected:
         p.drawPixmap((width() - m_pixmap.width()) / 2,
                      (height() - m_pixmap.height()) / 2,
                      m_pixmap);
+        } else {
+            QPainter p(this);
+            p.setOpacity(1); // make sure
+            p.drawPixmap((width() - m_pixmap.width()) / 2,
+                        (height() - m_pixmap.height()) / 2,
+                        m_pixmap);
+        }
     }
 
 protected slots:


["kdebase.diff" (text/x-patch)]

Index: workspace/kcontrol/style/kcmstyle.h
===================================================================
--- workspace/kcontrol/style/kcmstyle.h	(revisión: 775050)
+++ workspace/kcontrol/style/kcmstyle.h	(copia de trabajo)
@@ -152,6 +152,7 @@ private:
 	QComboBox* comboToolbarIcons;
 
 	QCheckBox* cbIconsOnButtons;
+	QCheckBox* cbBuiltinEffects;
 	QCheckBox* cbTearOffHandles;
 };
 
Index: workspace/kcontrol/style/kcmstyle.cpp
===================================================================
--- workspace/kcontrol/style/kcmstyle.cpp	(revisión: 775050)
+++ workspace/kcontrol/style/kcmstyle.cpp	(copia de trabajo)
@@ -210,6 +210,8 @@ KCMStyle::KCMStyle( QWidget* parent, con
 
 	cbIconsOnButtons = new QCheckBox( i18n("Sho&w icons on buttons"), gbWidgetStyle );
 	gbWidgetStyleLayout->addWidget( cbIconsOnButtons );
+	cbBuiltinEffects = new QCheckBox( i18n("Enable builtin animations"), gbWidgetStyle \
); +	gbWidgetStyleLayout->addWidget( cbBuiltinEffects );
 	cbEnableTooltips = new QCheckBox( i18n("E&nable tooltips"), gbWidgetStyle );
 	gbWidgetStyleLayout->addWidget( cbEnableTooltips );
 	cbTearOffHandles = new QCheckBox( i18n("Show tear-off handles in &popup menus"), \
gbWidgetStyle ); @@ -401,6 +403,7 @@ KCMStyle::KCMStyle( QWidget* parent, con
 	connect( cbTransparentToolbars, SIGNAL(toggled(bool)),   this, \
SLOT(setToolbarsDirty()));  connect( cbEnableTooltips,     SIGNAL(toggled(bool)),   \
this, SLOT(setEffectsDirty()));  connect( cbIconsOnButtons,     \
SIGNAL(toggled(bool)),   this, SLOT(setEffectsDirty())); +	connect( cbBuiltinEffects, \
SIGNAL(toggled(bool)),   this, SLOT(setEffectsDirty()));  connect( cbTearOffHandles,  \
SIGNAL(toggled(bool)),   this, SLOT(setEffectsDirty()));  connect( comboToolbarIcons, \
SIGNAL(activated(int)), this, SLOT(setToolbarsDirty()));  
@@ -614,6 +617,8 @@ void KCMStyle::save()
 
 	// Misc page
 	config.writeEntry( "ShowIconsOnPushButtons", cbIconsOnButtons->isChecked(), \
KConfig::Normal|KConfig::Global); +    KConfigGroup g( &_config, "KDE-Global GUI \
Settings" ); +    g.writeEntry( "EnableBuiltinEffects", \
cbBuiltinEffects->isChecked(), KConfig::Normal|KConfig::Global);  config.writeEntry( \
"EffectNoTooltip", !cbEnableTooltips->isChecked(), KConfig::Normal|KConfig::Global);  \
  KConfigGroup generalGroup(&_config, "General");
@@ -734,6 +739,7 @@ void KCMStyle::defaults()
 	cbEnableTooltips->setChecked(true);
 	comboToolbarIcons->setCurrentIndex(0);
 	cbIconsOnButtons->setChecked(true);
+	cbBuiltinEffects->setChecked(KGlobalSettings::animationsEnabledDefault());
 	cbTearOffHandles->setChecked(false);
 }
 
@@ -1067,6 +1073,8 @@ void KCMStyle::loadMisc( KConfig& config
 	cbIconsOnButtons->setChecked(configGroup.readEntry("ShowIconsOnPushButtons", \
true));  cbEnableTooltips->setChecked(!configGroup.readEntry("EffectNoTooltip", \
false));  cbTearOffHandles->setChecked(configGroup.readEntry("InsertTearOffHandle", \
false)); +    configGroup = config.group("KDE-Global GUI Settings");
+    cbBuiltinEffects->setChecked(configGroup.readEntry("EnableBuiltinEffects", \
KGlobalSettings::animationsEnabledDefault()));  
 	m_bToolbarsDirty = false;
 }
@@ -1123,6 +1131,8 @@ void KCMStyle::addWhatsThis()
 							"Text is aligned below the icon.") );
 	cbIconsOnButtons->setWhatsThis( i18n( "If you enable this option, KDE Applications \
will "  "show small icons alongside some important buttons.") );
+	cbBuiltinEffects->setWhatsThis( i18n( "If you enable this option, KDE Applications \
will " +							"run internal animations.") );
 	cbTearOffHandles->setWhatsThis( i18n( "If you enable this option some pop-up menus \
                will "
 							"show so called tear-off handles. If you click them, you get the menu "
 							"inside a widget. This can be very helpful when performing "
Index: workspace/libs/plasma/phase.cpp
===================================================================
--- workspace/libs/plasma/phase.cpp	(revisión: 775050)
+++ workspace/libs/plasma/phase.cpp	(copia de trabajo)
@@ -26,6 +26,7 @@
 #include <KConfigGroup>
 #include <KService>
 #include <KServiceTypeTrader>
+#include <KGlobalSettings>
 
 #include "animator.h"
 #include "widgets/widget.h"
@@ -117,6 +118,10 @@ class Phase::Private
 
         qreal calculateProgress(int frames, int currentFrame)
         {
+            if (!KGlobalSettings::animationsEnabled()) {
+                return qreal(1.0);
+            }
+
             qreal progress = frames;
             progress = currentFrame / progress;
             progress = qMin(qreal(1.0), qMax(qreal(0.0), progress));
@@ -156,6 +161,7 @@ class Phase::Private
                     break;
             }
         }
+
         Animator* animator;
         int animId;
         int timerId;
@@ -497,7 +503,7 @@ void Phase::timerEvent(QTimerEvent *even
     foreach (AnimationState* state, d->animatedItems) {
         if (state->currentInterval <= elapsed) {
             // we need to step forward!
-            state->currentFrame += qMax(1, elapsed / state->interval);
+            state->currentFrame += KGlobalSettings::animationsEnabled() ? qMax(1, \
elapsed / state->interval) : state->frames - state->currentFrame;  
             if (state->currentFrame < state->frames) {
                 qreal progress = d->calculateProgress(state->frames, \
state->currentFrame); @@ -521,7 +527,7 @@ void Phase::timerEvent(QTimerEvent *even
     foreach (MovementState* state, d->movingItems) {
         if (state->currentInterval <= elapsed) {
             // we need to step forward!
-            state->currentFrame += qMax(1, elapsed / state->interval);
+            state->currentFrame += KGlobalSettings::animationsEnabled() ? qMax(1, \
elapsed / state->interval) : state->frames - state->currentFrame;  
             if (state->currentFrame < state->frames) {
                 d->performMovement(d->calculateProgress(state->frames, \
state->currentFrame), state); @@ -555,7 +561,7 @@ void Phase::timerEvent(QTimerEvent \
                *even
             /*kDebug() << "stepping forwards element anim " << state->id << " from " \
                << state->currentFrame
                     << " by " << qMax(1, elapsed / state->interval) << " to "
                     << state->currentFrame + qMax(1, elapsed / state->interval) << \
                endl;*/
-            state->currentFrame += qMax(1, elapsed / state->interval);
+            state->currentFrame += KGlobalSettings::animationsEnabled() ? qMax(1, \
elapsed / state->interval) : state->frames - state->currentFrame;  // nasty hack \
                because QGraphicsItem::update isn't virtual!
             // FIXME: remove in 4.1 as we will no longer need the caching in \
                Plasma::Widget with Qt 4.4
             Plasma::Widget *widget = dynamic_cast<Plasma::Widget*>(state->item);
@@ -584,7 +590,7 @@ void Phase::timerEvent(QTimerEvent *even
     foreach (CustomAnimationState *state, d->customAnims) {
         if (state->currentInterval <= elapsed) {
             // advance the frame
-            state->currentFrame += qMax(1, elapsed / state->interval);
+            state->currentFrame += KGlobalSettings::animationsEnabled() ? qMax(1, \
                elapsed / state->interval) : state->frames - state->currentFrame;
             /*kDebug() << "custom anim for" << state->receiver << "to slot" << \
                state->slot
                      << "with interval of" << state->interval << "at frame" << \
state->currentFrame;*/  


["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic