locationpickerservice/src/locationpickerdatamanager.cpp
changeset 20 cd10d5b85554
parent 17 0f22fb80ebba
child 31 8db05346071b
--- a/locationpickerservice/src/locationpickerdatamanager.cpp	Mon May 03 12:27:22 2010 +0300
+++ b/locationpickerservice/src/locationpickerdatamanager.cpp	Fri May 14 15:47:27 2010 +0300
@@ -20,21 +20,20 @@
 
 
 // ----------------------------------------------------------------------------
-// LocationPickerDataManager::LocationPickerDataManager()
+// LocationPickerDataManager::getInstance()
 // ----------------------------------------------------------------------------
-
-LocationPickerDataManager::LocationPickerDataManager() :
-    d_ptr( new LocationPickerDataManagerPrivate() )
+LocationPickerDataManager* LocationPickerDataManager::getInstance()
 {
+    static LocationPickerDataManager singletonInstance;
+    return &singletonInstance;
 }
 
 // ----------------------------------------------------------------------------
 // LocationPickerDataManager::LocationPickerDataManager()
 // ----------------------------------------------------------------------------
 
-LocationPickerDataManager::LocationPickerDataManager(
-        QStandardItemModel &aModel, TViewType aViewType ) :
-        d_ptr( new LocationPickerDataManagerPrivate( aModel, aViewType) )
+LocationPickerDataManager::LocationPickerDataManager() :
+    d_ptr( new LocationPickerDataManagerPrivate() )
 {
 }
 
@@ -50,21 +49,11 @@
 // ----------------------------------------------------------------------------
 // LocationPickerDataManager::populateModel()
 // ----------------------------------------------------------------------------
-bool LocationPickerDataManager::populateModel(Qt::Orientations aOrientation, quint32 aCollectionId)
+bool LocationPickerDataManager::populateModel( QStandardItemModel &aModel, TViewType aViewType, 
+        Qt::Orientations aOrientation, quint32 aCollectionId )
 {   
     Q_D( LocationPickerDataManager);
-    return( d->populateModel(aOrientation, aCollectionId) );
-}
-
-
-// ----------------------------------------------------------------------------
-// LocationPickerDataManager::getData()
-// ----------------------------------------------------------------------------
-
-void LocationPickerDataManager::getData( int aIndex, quint32& aValue )
-{
-    Q_D( LocationPickerDataManager);
-    return( d->getData( aIndex, aValue ) );
+    return( d->populateModel( aModel, aViewType, aOrientation, aCollectionId) );
 }
 
 // ----------------------------------------------------------------------------