messagingfw/msgsrvnstore/server/src/CMsvAttachmentManager.cpp
changeset 47 d176b53f330f
parent 0 8e480a14352b
child 46 d51193d814ea
equal deleted inserted replaced
40:320ec5cd0227 47:d176b53f330f
   434 		iStoreManager.OpenAttachmentL(iEntryId, attachment->FilePath(), attachmentFile);
   434 		iStoreManager.OpenAttachmentL(iEntryId, attachment->FilePath(), attachmentFile);
   435 		}
   435 		}
   436 	else // attachment->iType == ELinkedFile
   436 	else // attachment->iType == ELinkedFile
   437 		{
   437 		{
   438 		RFs fs;
   438 		RFs fs;
   439 		fs.Connect();
   439 		User::LeaveIfError(fs.Connect());
   440 		fs.ShareProtected();
   440 		User::LeaveIfError(fs.ShareProtected());  		
   441 		User::LeaveIfError(attachmentFile.Open(fs, attachment->FilePath(), EFileRead | EFileShareReadersOnly));
   441 		User::LeaveIfError(attachmentFile.Open(fs, attachment->FilePath(), EFileRead | EFileShareReadersOnly));
   442 		}
   442 		}
   443 	
   443 	
   444 	// handle to attachment file allocated, return to caller
   444 	// handle to attachment file allocated, return to caller
   445 	return attachmentFile;
   445 	return attachmentFile;
   468 		iStoreManager.OpenAttachmentForWriteL(iEntryId, attachment->FilePath(), attachmentFile);
   468 		iStoreManager.OpenAttachmentForWriteL(iEntryId, attachment->FilePath(), attachmentFile);
   469 		}
   469 		}
   470 	else // attachment->iType == ELinkedFile
   470 	else // attachment->iType == ELinkedFile
   471 		{
   471 		{
   472 		RFs fs;
   472 		RFs fs;
   473 		fs.Connect();
   473 		User::LeaveIfError(fs.Connect());
   474 		fs.ShareProtected();
   474 		User::LeaveIfError(fs.ShareProtected());
   475 		User::LeaveIfError(attachmentFile.Open(fs, attachment->FilePath(), EFileWrite));
   475 		User::LeaveIfError(attachmentFile.Open(fs, attachment->FilePath(), EFileWrite));
   476 		}
   476 		}
   477 	
   477 	
   478 	// handle to attachment file allocated, return to caller
   478 	// handle to attachment file allocated, return to caller
   479 	return attachmentFile;
   479 	return attachmentFile;