src/hbcore/utils/hbtimer.cpp
changeset 5 627c4a0fd0e7
parent 0 16d8024aca5e
child 21 4633027730f5
equal deleted inserted replaced
3:11d3954df52a 5:627c4a0fd0e7
    37 // order to use the animation fw's QUnifiedTimer under the hood.
    37 // order to use the animation fw's QUnifiedTimer under the hood.
    38 class HbTimerAnim : public QAbstractAnimation
    38 class HbTimerAnim : public QAbstractAnimation
    39 {
    39 {
    40 public:
    40 public:
    41     HbTimerAnim(HbTimerEntry *entry) : mEntry(entry), mDuration(entry->interval()) { }
    41     HbTimerAnim(HbTimerEntry *entry) : mEntry(entry), mDuration(entry->interval()) { }
    42     int duration() const { return mDuration; }
    42     int duration() const {
       
    43         return mDuration;
       
    44     }
    43     void updateCurrentTime(int) { }
    45     void updateCurrentTime(int) { }
    44     void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState)
    46     void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) {
    45         {
    47         if (oldState != QAbstractAnimation::Stopped && newState == QAbstractAnimation::Stopped && mEntry) {
    46             if (oldState != QAbstractAnimation::Stopped && newState == QAbstractAnimation::Stopped && mEntry) {
    48             mEntry->timerFired();
    47                 mEntry->timerFired();
    49             mEntry->mAnim = 0; // to prevent confusing unregisterEntry() and double deletion
    48                 mEntry->mAnim = 0; // to prevent confusing unregisterEntry() and double deletion
    50             HbTimer::instance()->unregisterEntry(mEntry);
    49                 HbTimer::instance()->unregisterEntry(mEntry);
    51             if (mEntry->mDeleteWhenFinishedNormally) {
    50                 if (mEntry->mDeleteWhenFinishedNormally) {
    52                 delete mEntry;
    51                     delete mEntry;
       
    52                 }
       
    53             }
    53             }
    54         }
    54         }
       
    55     }
    55     HbTimerEntry *mEntry;
    56     HbTimerEntry *mEntry;
    56     int mDuration;
    57     int mDuration;
    57 };
    58 };
    58 
    59 
    59 /*!
    60 /*!