deviceupdatesui/deviceupdates/src/dminforetrieval.cpp
changeset 42 aa33c2cb9a50
parent 18 7d11f9a6646f
child 53 1273bf2c520c
--- a/deviceupdatesui/deviceupdates/src/dminforetrieval.cpp	Wed Jun 23 18:03:02 2010 +0300
+++ b/deviceupdatesui/deviceupdates/src/dminforetrieval.cpp	Tue Jul 06 14:06:19 2010 +0300
@@ -483,6 +483,15 @@
     if(error == KErrNone)   {}             
     }
 
+void DmInfo::sync(int aProfileId)
+    {
+    int itemNum = findProfile(aProfileId);
+    if(itemNum!=KErrNotFound)
+        {
+        synchronize(itemNum);
+        }
+    }
+
 void DmInfo::synccomplete(int jobstatus)
     {
     if (jobstatus == ENSmlSyncComplete)
@@ -491,7 +500,10 @@
         //Update profile list
         refreshProfileList();
         }
-    serversView->syncCompleted(jobstatus);
+    if(serversView!=NULL)
+        {
+        serversView->syncCompleted(jobstatus);
+        }
     iDbEventsBlocked = EFalse;
     }
 
@@ -543,3 +555,14 @@
     FLOG( "[OMADM] DmInfo::DisableDbNotifications() completed" );
     }
 
+TInt DmInfo::findProfile(TInt aProfileId)
+    {
+    for(TInt i=0;i<iProfileList->Count();i++)
+        {
+        if(iProfileList->At(i).iProfileId == aProfileId)
+            {
+            return i;
+            }
+        }
+    return KErrNotFound;
+    }