diff -r c2b8a5ae6ed5 -r e6e896426eac omads/omadsappui/AspSyncUtil/src/AspProfile.cpp --- a/omads/omadsappui/AspSyncUtil/src/AspProfile.cpp Mon Jan 18 20:08:41 2010 +0200 +++ b/omads/omadsappui/AspSyncUtil/src/AspProfile.cpp Tue Feb 02 00:02:49 2010 +0000 @@ -1258,8 +1258,13 @@ { if (aDataProviderId == KUidNSmlAdapterCalendar.iUid ) { - TBuf<128> calLocalDb ; - CreateCalLocalDatabaseL(calLocalDb); + TBuf calLocalDb ; + TRAPD(err ,RetrieveCalLocalDatabaseL(calLocalDb)); + if (err != KErrNone) + { + CreateCalLocalDatabaseL(calLocalDb); + } + task.CreateL(iProfile->Profile(), aDataProviderId, aRemoteDatabase, calLocalDb); } @@ -1334,9 +1339,23 @@ aCalName.Copy(KDrive); - TBuf<128> buffer; + TBuf buffer; iProfile->GetName(buffer); - + + TInt currentProfileId = iProfile->ProfileId(); + + if (buffer.Compare(KAutoSyncProfileName) == 0) + { + CAspSchedule* schedule = CAspSchedule::NewLC(); + currentProfileId = schedule->ProfileId(); + TAspParam param(iApplicationId, iSyncSession); + CAspProfile* selectedProfile = CAspProfile::NewLC(param); + selectedProfile->OpenL(currentProfileId, CAspProfile::EOpenRead, CAspProfile::EAllProperties); + selectedProfile->GetName(buffer); + CleanupStack::PopAndDestroy(selectedProfile); + CleanupStack::PopAndDestroy(schedule); + } + CCalSession* calSession = CCalSession::NewL(); CleanupStack::PushL(calSession); @@ -1424,7 +1443,7 @@ keyBuff.Zero(); keyBuff.AppendNum( EDeviceSyncProfileID ); - TPckgC pckgProfileIdValue( iProfile->ProfileId() ); + TPckgC pckgProfileIdValue( currentProfileId ); calinfo->SetPropertyL( keyBuff, pckgProfileIdValue ); @@ -1507,10 +1526,21 @@ keyBuff.AppendNum( EDeviceSyncProfileID ); TPckgC intBuf(profileId); TRAP_IGNORE(intBuf.Set(caleninfo->PropertyValueL(keyBuff))); - profileId = intBuf(); - - if ( profileId == iProfile->ProfileId()) + + TBuf buffer; + iProfile->GetName(buffer); + + TInt currentProfileId = iProfile->ProfileId(); + + if (buffer.Compare(KAutoSyncProfileName) == 0) + { + CAspSchedule* schedule = CAspSchedule::NewLC(); + currentProfileId = schedule->ProfileId(); + CleanupStack::PopAndDestroy(schedule); + } + + if ( profileId == currentProfileId) { aCalName.Append(caleninfo->FileNameL()); dbFound = ETrue; @@ -2255,12 +2285,31 @@ TInt count = arr.Count(); + //Hiding OVI Sync profile + const TUid KUidOtaSyncCenRep = { 0x20016C06 }; + const TUid KCRUidOtaSyncProfileId = { 0x102 }; + TInt oviProfileId = KErrNotFound; + CRepository* centRep = NULL; + + TRAPD(err ,centRep = CRepository::NewL(KUidOtaSyncCenRep)); + if (err == KErrNone) + { + CleanupStack::PushL(centRep); + centRep->Get(KCRUidOtaSyncProfileId.iUid, oviProfileId); + CleanupStack::PopAndDestroy();// centRep + } for (TInt i=0; iOpenL(id, CAspProfile::EOpenRead, CAspProfile::EBaseProperties);