17 |
17 |
18 #include "emailtrace.h" |
18 #include "emailtrace.h" |
19 #include "cesmrsendui.h" |
19 #include "cesmrsendui.h" |
20 #include "esmrvcalexport.h" |
20 #include "esmrvcalexport.h" |
21 |
21 |
22 #include <caleninterimutils2.h> |
22 #include <CalenInterimUtils2.h> |
23 #include <eikenv.h> |
23 #include <eikenv.h> |
24 #include <msgbiouids.h> |
24 #include <MsgBioUids.h> |
25 #include <sendui.h> |
25 #include <sendui.h> |
26 #include <tsendingcapabilities.h> |
26 #include <TSendingCapabilities.h> |
27 #include <cmessagedata.h> |
27 #include <CMessageData.h> |
28 #include <cmessageaddress.h> |
28 #include <CMessageAddress.h> |
29 #include <senduiconsts.h> |
29 #include <SendUiConsts.h> |
30 #include <sysutil.h> |
30 #include <sysutil.h> |
31 #include <txtrich.h> |
31 #include <txtrich.h> |
32 #include <calsession.h> |
32 #include <calsession.h> |
33 //<cmail> hardcoded paths removal |
|
34 #include <pathinfo.h> |
33 #include <pathinfo.h> |
35 //</cmail> |
|
36 |
34 |
37 // Unnamed namespace for local definitions |
35 // Unnamed namespace for local definitions |
38 namespace { |
36 namespace { |
39 //<cmail> hardcoded paths removal from cmail |
37 |
40 _LIT( KVCalAttachmentFile, |
38 _LIT( KVCalAttachmentFile, |
41 "\\private\\10005901\\Calendar.vcs" ); |
39 "\\private\\10005901\\Calendar.vcs" ); |
42 //</cmail> |
40 |
43 |
41 |
44 _LIT( KCalendarDatabaseFilePath, "c:Calendar" ); |
42 _LIT( KCalendarDatabaseFilePath, "c:Calendar" ); |
45 |
43 |
46 const TInt KNumMtmsToDim =6; |
44 const TInt KNumMtmsToDim =6; |
47 |
45 |
184 { |
182 { |
185 RFs fs; |
183 RFs fs; |
186 User::LeaveIfError( fs.Connect() ); |
184 User::LeaveIfError( fs.Connect() ); |
187 CleanupClosePushL( fs ); |
185 CleanupClosePushL( fs ); |
188 // must share the handle between processes |
186 // must share the handle between processes |
189 User::LeaveIfError( fs.ShareProtected() ); |
187 User::LeaveIfError( fs.ShareProtected() ); |
190 //<cmail> hardcoded paths removal from cmail |
|
191 TFileName fileName(PathInfo::PhoneMemoryRootPath().Left(2)); |
188 TFileName fileName(PathInfo::PhoneMemoryRootPath().Left(2)); |
192 fileName.Append(KVCalAttachmentFile); |
189 fileName.Append(KVCalAttachmentFile); |
193 fs.MkDirAll(fileName); |
190 fs.MkDirAll(fileName); |
194 //</cmail> |
|
195 RFile file; |
191 RFile file; |
196 User::LeaveIfError(file.Replace(//<cmail> |
192 User::LeaveIfError(file.Replace( |
197 fs,fileName,EFileWrite | EFileShareAny ));//</cmail> |
193 fs,fileName,EFileWrite | EFileShareAny )); |
198 CleanupClosePushL(file); |
194 CleanupClosePushL(file); |
199 TInt spaceNeeded = vcal->Size(); |
195 TInt spaceNeeded = vcal->Size(); |
200 if ( SysUtil::FFSSpaceBelowCriticalLevelL( &fs, spaceNeeded ) ) |
196 if ( SysUtil::FFSSpaceBelowCriticalLevelL( &fs, spaceNeeded ) ) |
201 { |
197 { |
202 // don't show any own notes here |
198 // don't show any own notes here |
203 User::Leave( KErrDiskFull ); |
199 User::Leave( KErrDiskFull ); |
204 } |
200 } |
205 |
201 |
206 User::LeaveIfError(file.Write(*vcal)); |
202 User::LeaveIfError(file.Write(*vcal)); |
207 |
203 |
208 TParse parse;//<cmail> |
204 TParse parse; |
209 User::LeaveIfError(parse.SetNoWild(fileName,//</cmail> |
205 User::LeaveIfError(parse.SetNoWild(fileName, |
210 NULL, NULL)); |
206 NULL, NULL)); |
211 |
207 |
212 TRAPD(err, DoSendAsAttachmentHandleL(file)); |
208 TRAPD(err, DoSendAsAttachmentHandleL(file)); |
213 |
209 |
214 CleanupStack::PopAndDestroy(&file); |
210 CleanupStack::PopAndDestroy(&file); |