calendarui/server/CalenSvr/src/CalenServer.cpp
branchRCL_3
changeset 15 9711e452b5e9
parent 13 1984aceb8774
child 18 d68a4b5d5885
--- a/calendarui/server/CalenSvr/src/CalenServer.cpp	Wed Apr 14 15:55:57 2010 +0300
+++ b/calendarui/server/CalenSvr/src/CalenServer.cpp	Tue Apr 27 16:36:22 2010 +0300
@@ -51,7 +51,10 @@
 
 
 const TInt KComma( ',' );
-_LIT(KPhoneCalendarName,"PhoneCalendar");
+
+_LIT(KPersonal,"Personal");
+_LIT(KFamily,"Family");
+_LIT(KFriends,"Friends");
 
 // ================= MEMBER FUNCTIONS =======================
 //
@@ -338,7 +341,6 @@
             {
             TBuf<KMaxFileName> calendarFileName;
             calendarFileName.Append(KCalendarDatabaseFilePath);
-            calendarInfo->SetEnabled(EFalse);
             TRAPD(error,session->CreateCalFileL(calendarFileName,*calendarInfo));
 			User::LeaveIfError(error);
             }
@@ -370,49 +372,26 @@
     {
     TRACE_ENTRY_POINT;
     
-    RFs fsSession;
-    CleanupClosePushL( fsSession );
-    RResourceFile resourceFile;
-    CleanupClosePushL( resourceFile );
-    User::LeaveIfError( fsSession.Connect() );
-    TFileName resourceFileName( KMissedAlarmResourceFile );
+    
     
-    BaflUtils::NearestLanguageFile( fsSession, resourceFileName );
-    
-    resourceFile.OpenL(fsSession, resourceFileName );
-    resourceFile.ConfirmSignatureL( 0 );
     
-    //Phone calendar 
-       HBufC* phoneCalendarBuffer = KPhoneCalendarName().AllocLC();
-       aCalendarNames.AppendL(phoneCalendarBuffer->Des());
-       CleanupStack::PopAndDestroy( phoneCalendarBuffer );
+    
         
     // personal
-        HBufC8* personalBuffer = resourceFile.AllocReadLC( R_CALE_DB_PERSONAL );    
-       const TPtrC16 ptrPBuffer(( TText16*) personalBuffer->Ptr(),
-                                         ( personalBuffer->Length()+1 )>>1 );    
-       HBufC *personalCalendar = ptrPBuffer.AllocL();    
-       aCalendarNames.AppendL( personalCalendar->Des() );    
+         HBufC* personalBuffer = KPersonal().AllocLC();    
+        aCalendarNames.AppendL( personalBuffer->Des() );    
        CleanupStack::PopAndDestroy( personalBuffer );
        
     // famliy
-       HBufC8* familyBuffer=resourceFile.AllocReadLC( R_CALE_DB_FAMILY );
-       const TPtrC16 ptrFBuffer(( TText16*) familyBuffer->Ptr(),
-               ( familyBuffer->Length()+1 )>>1 );
-       HBufC *familyCalendar = ptrFBuffer.AllocL();
-       aCalendarNames.AppendL( familyCalendar->Des() );
+        HBufC* familyBuffer = KFamily().AllocLC();    
+       aCalendarNames.AppendL( familyBuffer->Des() );    
        CleanupStack::PopAndDestroy( familyBuffer );
        
     //friends
-       HBufC8* friendsBuffer = resourceFile.AllocReadLC( R_CALE_DB_FRIENDS );
-       const TPtrC16 ptrFrBuffer(( TText16*) friendsBuffer->Ptr(),
-               ( friendsBuffer->Length()+1 )>>1 );
-       HBufC *friendsCalendar = ptrFrBuffer.AllocL();
-       aCalendarNames.AppendL( friendsCalendar->Des() );
-       CleanupStack::PopAndDestroy( friendsBuffer );
+       HBufC* friendBuffer = KFriends().AllocLC();    
+      aCalendarNames.AppendL( friendBuffer->Des() );    
+      CleanupStack::PopAndDestroy( friendBuffer );
    
-    CleanupStack::PopAndDestroy(&resourceFile);
-    CleanupStack::PopAndDestroy(&fsSession);
     
     TRACE_EXIT_POINT;
     }
@@ -472,8 +451,7 @@
     TPtrC marker = aRepositoryBuffer;
     TInt calendarColorOffset;
     
-    //For phone calendar 
-    aCalendarColors.Append(KRgbRed.Value());
+  
     
     while ((calendarColorOffset = marker.Locate(TChar(KComma)))
             != KErrNotFound)