radioapp/radiouiengine/inc/radiostation_p.h
changeset 32 189d20c34778
parent 24 6df133bd92e1
child 36 ba22309243a1
child 37 451b2e1545b2
--- a/radioapp/radiouiengine/inc/radiostation_p.h	Fri Jun 11 13:38:32 2010 +0300
+++ b/radioapp/radiouiengine/inc/radiostation_p.h	Wed Jun 23 18:12:57 2010 +0300
@@ -19,6 +19,7 @@
 #define RADIOSTATIONINFO_P_H_
 
 // System includes
+#include <QSharedData>
 #include <QTime>
 
 // User includes
@@ -26,12 +27,13 @@
 #include "radiostationif.h"
 
 // Class declaration
-class RadioStationPrivate : public RadioStationIf
+class RadioStationPrivate : public QSharedData
+                          , public RadioStationIf
 {
 public:
 
     explicit RadioStationPrivate( int presetIndex = RadioStation::Invalid, uint frequency = 0 );
-    explicit RadioStationPrivate( RadioStation::PresetFlag flag );
+    explicit RadioStationPrivate( const RadioStationPrivate& other );
 
     virtual ~RadioStationPrivate();
 
@@ -62,24 +64,11 @@
 
 public: // data
 
-    /**
-     * Reference count used for implicit sharing.
-     * Has to be named "ref" instead having the 'm' prefix like all other member variables in Radio
-     * This is because convenience functions like qAtomicAssign() expect it to be named "ref"
-     */
-    QAtomicInt                  ref;
-
     // ========================================================================
     // Persistent data. Saved to Central repository
     // ========================================================================
 
     /**
-     * Station frequency. The most important bit of information about a radio station.
-     * Is checked to be non-null in the isValid() function
-     */
-    uint                        mFrequency;
-
-    /**
      * Station index in the Preset Utility.
      * Negative values signify an invalid RadioStation that has not and will not be saved.
      * Initialized to -100 by default to indicate and invalid station.
@@ -87,6 +76,12 @@
     int                         mPresetIndex;
 
     /**
+     * Station frequency. The most important bit of information about a radio station.
+     * Is checked to be non-null in the isValid() function
+     */
+    uint                        mFrequency;
+
+    /**
      * Station name. Contains a name that is set in one of the following ways:
      *  1) Received through RDS as the stations PS name and station does not use dynamic PS
      *  2) Entered by the user. In this case the mRenamedByUser flag will be set and the name