radioapp/radiouiengine/src/radiohistoryitem.cpp
changeset 19 afea38384506
parent 16 f54ebcfc1b80
child 37 451b2e1545b2
equal deleted inserted replaced
16:f54ebcfc1b80 19:afea38384506
    72 }
    72 }
    73 
    73 
    74 /*!
    74 /*!
    75  *
    75  *
    76  */
    76  */
       
    77 bool RadioHistoryItem::isValid() const
       
    78 {
       
    79     return id() != 0 && !title().isEmpty();
       
    80 }
       
    81 
       
    82 /*!
       
    83  *
       
    84  */
       
    85 void RadioHistoryItem::reset()
       
    86 {
       
    87     decrementReferenceCount();
       
    88     mData = shared_null();
       
    89     mData->ref.ref();
       
    90 }
       
    91 
       
    92 /*!
       
    93  *
       
    94  */
       
    95 int RadioHistoryItem::id() const
       
    96 {
       
    97     return mData->mId;
       
    98 }
       
    99 
       
   100 /*!
       
   101  *
       
   102  */
    77 QString RadioHistoryItem::artist() const
   103 QString RadioHistoryItem::artist() const
    78 {
   104 {
    79     return mData->mArtist;
   105     return mData->mArtist;
    80 }
   106 }
    81 
   107 
   166 
   192 
   167 
   193 
   168 /*!
   194 /*!
   169  *
   195  *
   170  */
   196  */
   171 bool RadioHistoryItem::isFavorite() const
   197 bool RadioHistoryItem::isTagged() const
   172 {
   198 {
   173     return mData->mFavorite;
   199     return mData->mTagged;
   174 }
   200 }
   175 
   201 
   176 /*!
   202 /*!
   177  *
   203  *
   178  */
   204  */
   179 void RadioHistoryItem::setFavorite()
   205 bool RadioHistoryItem::isRecognizedByRds() const
   180 {
   206 {
   181     if ( !mData->mFavorite ) {
   207     return mData->mFromRds;
   182         detach();
       
   183         mData->mFavorite = true;
       
   184     }
       
   185 }
       
   186 
       
   187 /*!
       
   188  *
       
   189  */
       
   190 void RadioHistoryItem::increasePlayCount()
       
   191 {
       
   192     detach();
       
   193     ++mData->mPlayCount;
       
   194 }
       
   195 
       
   196 /*!
       
   197  *
       
   198  */
       
   199 int RadioHistoryItem::playCount() const
       
   200 {
       
   201     return mData->mPlayCount;
       
   202 }
   208 }
   203 
   209 
   204 /**
   210 /**
   205  * Decrements the reference count of the implicitly shared data.
   211  * Decrements the reference count of the implicitly shared data.
   206  */
   212  */