24 #include <calcalendariterator.h> |
24 #include <calcalendariterator.h> |
25 // user include. |
25 // user include. |
26 #include "multicaluidialogmodel.h" |
26 #include "multicaluidialogmodel.h" |
27 #include "calendarui_debug.h" |
27 #include "calendarui_debug.h" |
28 |
28 |
29 _LIT( KCalendarDatabaseFilePath, "c:calendar" ); |
|
30 |
|
31 // ---------------------------------------------------------------------------- |
29 // ---------------------------------------------------------------------------- |
32 // CMultiCalUiDialogModel::CMultiCalUiDialogModel |
30 // CMultiCalUiDialogModel::CMultiCalUiDialogModel |
33 // Constructor |
31 // Constructor |
34 // ---------------------------------------------------------------------------- |
32 // ---------------------------------------------------------------------------- |
35 // |
33 // |
148 |
146 |
149 for (TInt index = 0; index < iCalendarInfoList.Count(); index++) |
147 for (TInt index = 0; index < iCalendarInfoList.Count(); index++) |
150 { |
148 { |
151 iCalendarStatus.Append(0); |
149 iCalendarStatus.Append(0); |
152 |
150 |
153 /* if (!index) //First create the default session |
151 if (!index) //First create the default session |
154 { |
152 { |
155 const TPtrC name = iCalendarInfoList[index]->FileNameL(); |
153 const TPtrC name = iCalendarInfoList[index]->FileNameL(); |
156 defaultSession->OpenL(name); |
154 defaultSession->OpenL(name); |
157 iCalSessionArray.Append(defaultSession); |
155 iCalSessionArray.Append(defaultSession); |
158 CCalEntryView* entryView = CCalEntryView::NewL(*defaultSession); |
156 CCalEntryView* entryView = CCalEntryView::NewL(*defaultSession); |
159 CleanupStack::PushL(entryView); |
157 CleanupStack::PushL(entryView); |
160 iCalEntryViewArray.Append(entryView); |
158 iCalEntryViewArray.Append(entryView); |
161 CleanupStack::Pop(entryView); |
159 CleanupStack::Pop(entryView); |
162 } |
160 } |
163 else*/ |
161 else |
164 { |
162 { |
165 CCalSession* session = CCalSession::NewL(*defaultSession); |
163 CCalSession* session = CCalSession::NewL(*defaultSession); |
166 CleanupStack::PushL(session); |
164 CleanupStack::PushL(session); |
167 const TPtrC name = iCalendarInfoList[index]->FileNameL(); |
165 const TPtrC name = iCalendarInfoList[index]->FileNameL(); |
168 session->OpenL(name); |
166 session->OpenL(name); |
305 *iCalendarsSession); |
303 *iCalendarsSession); |
306 CleanupStack::PushL(calIter); |
304 CleanupStack::PushL(calIter); |
307 CCalCalendarInfo* calendarInfo = calIter->FirstL(); |
305 CCalCalendarInfo* calendarInfo = calIter->FirstL(); |
308 while (calendarInfo) |
306 while (calendarInfo) |
309 { |
307 { |
310 TPtrC fileNamePtr = calendarInfo->FileNameL(); |
308 aCalendarInfoList.AppendL(calendarInfo); |
311 if(fileNamePtr.CompareF(KCalendarDatabaseFilePath)) |
|
312 { |
|
313 aCalendarInfoList.AppendL(calendarInfo); |
|
314 } |
|
315 else |
|
316 { |
|
317 delete calendarInfo; |
|
318 } |
|
319 calendarInfo = calIter->NextL(); |
309 calendarInfo = calIter->NextL(); |
320 } |
310 } |
321 CleanupStack::PopAndDestroy(calIter); |
311 CleanupStack::PopAndDestroy(calIter); |
322 |
312 |
323 TRACE_EXIT_POINT; |
313 TRACE_EXIT_POINT; |