taskswitcher/client/s60/src/tstaskmonitorhistory.cpp
changeset 127 7b66bc3c6dc9
parent 116 305818acdca4
equal deleted inserted replaced
126:efda7c0771b9 127:7b66bc3c6dc9
    14 * Description: 
    14 * Description: 
    15 *
    15 *
    16 */
    16 */
    17 #include "tstaskmonitorhistory.h"
    17 #include "tstaskmonitorhistory.h"
    18 
    18 
    19 TsTaskMonitorHistory::TsTaskMonitorHistory(const QByteArray &key, 
    19 TsTaskMonitorHistory::TsTaskMonitorHistory(const QSharedPointer< CTsClientEntry > item, int offset) :
    20                                            const QDateTime &updateTime) :
    20 mEntry(item),
    21 mKey(key), mUpdateTime(updateTime)
    21 mOffset(offset)
    22 {
    22 {
    23     
       
    24 }
       
    25 
       
    26 void TsTaskMonitorHistory::setOffset(int offset)
       
    27 {
       
    28     mOffset = offset;
       
    29 }
    23 }
    30 
    24 
    31 int TsTaskMonitorHistory::offset() const
    25 int TsTaskMonitorHistory::offset() const
    32 {
    26 {
    33     return mOffset;
    27     return mOffset;
    34 }
    28 }
    35 
    29 
    36 bool TsTaskMonitorHistory::isEqual(const TsTaskMonitorHistory &item) const
    30 bool TsTaskMonitorHistory::operator == (const TsTaskMonitorHistory &item) const
    37 {
    31 {
    38     if (mKey == item.mKey) {
    32     return mEntry->Key() == item.mEntry->Key();
    39         return true;
       
    40     }
       
    41     return false;
       
    42 }
    33 }
    43 
    34 
    44 bool TsTaskMonitorHistory::isUpdated(const TsTaskMonitorHistory &item) const
    35 bool TsTaskMonitorHistory::isUpdated(const TsTaskMonitorHistory &item) const
    45 {
    36 {
    46     Q_ASSERT(mKey == item.mKey);
    37     return mEntry->TimestampUpdate() != item.mEntry->TimestampUpdate();
    47     if (mUpdateTime != item.mUpdateTime) {
       
    48         return true;
       
    49     }
       
    50     return false;    
       
    51 }
    38 }