radioapp/radiouiengine/src/radiohistoryitem.cpp
changeset 51 bbebb0235466
parent 34 bc10a61bd7d3
child 57 21be958eb3ce
equal deleted inserted replaced
47:74b7c6e79031 51:bbebb0235466
    17 
    17 
    18 // User includes
    18 // User includes
    19 #include "radiohistoryitem.h"
    19 #include "radiohistoryitem.h"
    20 #include "radiohistoryitem_p.h"
    20 #include "radiohistoryitem_p.h"
    21 
    21 
    22 /**
       
    23  * Static shared data instance that is used by all default-constructed RadioStation instances
       
    24  */
       
    25 Q_GLOBAL_STATIC( RadioHistoryItemPrivate, shared_null )
       
    26 
       
    27 
       
    28 /*!
    22 /*!
    29  *
    23  *
    30  */
    24  */
    31 RadioHistoryItem::RadioHistoryItem() :
    25 RadioHistoryItem::RadioHistoryItem() :
    32     mData( shared_null() )
    26     mData( new RadioHistoryItemPrivate() )
    33 {
    27 {
    34     mData->ref.ref();
    28     mData->ref.ref();
    35 }
    29 }
    36 
    30 
    37 /*!
    31 /*!
    77 /*!
    71 /*!
    78  *
    72  *
    79  */
    73  */
    80 void RadioHistoryItem::reset()
    74 void RadioHistoryItem::reset()
    81 {
    75 {
    82     mData = shared_null();
    76     mData->ref.deref();
       
    77     mData = NULL;
       
    78     mData = new RadioHistoryItemPrivate();
       
    79     mData->ref.ref();
    83 }
    80 }
    84 
    81 
    85 /*!
    82 /*!
    86  *
    83  *
    87  */
    84  */