1 /* |
1 /* |
2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
333 User::LeaveIfError(apparcSession.Connect()); |
333 User::LeaveIfError(apparcSession.Connect()); |
334 CleanupClosePushL(apparcSession); |
334 CleanupClosePushL(apparcSession); |
335 User::LeaveIfError(apparcSession.AppForDocument(fileName, uid, dataType)); |
335 User::LeaveIfError(apparcSession.AppForDocument(fileName, uid, dataType)); |
336 |
336 |
337 RFile fileHandle; |
337 RFile fileHandle; |
338 fileHandle.Open(iParent.Fs(), uri, EFileRead); |
338 |
|
339 CleanupClosePushL(fileHandle); |
|
340 User::LeaveIfError(fileHandle.Open(iParent.Fs(), uri, EFileRead)); |
|
341 |
339 User::LeaveIfError(apparcSession.AppForDocument(fileHandle, uid, dataType2)); |
342 User::LeaveIfError(apparcSession.AppForDocument(fileHandle, uid, dataType2)); |
340 |
343 |
341 // Pass in a null file name to make sure it doesn't panic |
344 // Pass in a null file name to make sure it doesn't panic |
342 User::LeaveIfError(apparcSession.AppForDocument(nullFileName, uid, dataType3)); |
345 User::LeaveIfError(apparcSession.AppForDocument(nullFileName, uid, dataType3)); |
343 |
346 |
|
347 CleanupStack::PopAndDestroy(&fileHandle); |
344 CleanupStack::PopAndDestroy(&apparcSession); // close |
348 CleanupStack::PopAndDestroy(&apparcSession); // close |
345 |
349 |
346 |
350 |
347 // check mime type of the file (fileName) |
351 // check mime type of the file (fileName) |
348 mimeType.Set(dataType.Des8()); |
352 mimeType.Set(dataType.Des8()); |