videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp
changeset 24 7d93ee07fb27
parent 20 b9e04db066d4
child 28 c48470be1ba7
--- a/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp	Fri May 14 15:53:50 2010 +0300
+++ b/videocollection/mpxmyvideoscollection/src/vcxmyvideosmdsalbums.cpp	Thu May 27 12:53:14 2010 +0300
@@ -50,27 +50,8 @@
 void CVcxMyVideosMdsAlbums::ConstructL()
     {
     GetSchemaDefinitionsL();
-    CActiveScheduler::Add( this );
-    
-    if ( iObserver )
-        {
-        //ENotifyAdd and ENotifyModify are not supported
-        iMdsDb.MdsSessionL().AddRelationItemObserverL( *this, NULL,
-                ENotifyRemove, iMdsDb.iNamespaceDef );
-
-#if 0
-        // We receive only IDs from here. We need to make query to get
-        // relation objects-> slow to use. We use the response from
-        // the add operation instead. This way we don't receive
-        // add events if someone else adds videos to our albums
-        // but the performance is the best possible.
-        iMdsDb.MdsSessionL().AddRelationObserverL( *this, NULL,
-                ENotifyAdd | ENotifyModify | ENotifyRemove );        
-#endif
-        }
-    
-    //TODO: do we need this?
-    //iMdsDb.MdsSessionL().AddRelationPresentObserverL();
+    SetObservingL();
+    CActiveScheduler::Add( this );    
     }
 
 // ---------------------------------------------------------------------------
@@ -160,6 +141,30 @@
     }
 
 // ---------------------------------------------------------------------------
+// CVcxMyVideosMdsAlbums::SetObservingL
+// ---------------------------------------------------------------------------
+//
+void CVcxMyVideosMdsAlbums::SetObservingL()
+    {
+    if ( iObserver )
+        {
+        //ENotifyAdd and ENotifyModify are not supported
+        iMdsDb.MdsSessionL().AddRelationItemObserverL( *this, NULL,
+                ENotifyRemove, iMdsDb.iNamespaceDef );
+
+#if 0
+        // We receive only IDs from here. We need to make query to get
+        // relation objects-> slow to use. We use the response from
+        // the add operation instead. This way we don't receive
+        // add events if someone else adds videos to our albums
+        // but the performance is the best possible.
+        iMdsDb.MdsSessionL().AddRelationObserverL( *this, NULL,
+                ENotifyAdd | ENotifyModify | ENotifyRemove );        
+#endif    
+        }
+    }
+
+// ---------------------------------------------------------------------------
 // CVcxMyVideosMdsAlbums::GetAlbumsL
 // ---------------------------------------------------------------------------
 //