|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: This file implements class CFileSystemInfo. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 #include "emailtrace.h" |
|
21 #include "FreestyleEmailUiFileSystemInfo.h" |
|
22 #include <coemain.h> |
|
23 #include <apgcli.h> |
|
24 |
|
25 // ========================= MEMBER FUNCTIONS ================================ |
|
26 |
|
27 // ---------------------------------------------------------- |
|
28 // CFileSystemInfo::NewL() |
|
29 // ---------------------------------------------------------- |
|
30 // |
|
31 CFileSystemInfo* CFileSystemInfo::NewL(const TUid & aApplicationUid) |
|
32 { |
|
33 FUNC_LOG; |
|
34 CFileSystemInfo* self = CFileSystemInfo::NewLC(aApplicationUid); |
|
35 CleanupStack::Pop( self ); |
|
36 return self; |
|
37 } |
|
38 |
|
39 // ---------------------------------------------------------- |
|
40 // CFileSystemInfo::NewLC() |
|
41 // ---------------------------------------------------------- |
|
42 // |
|
43 CFileSystemInfo* CFileSystemInfo::NewLC(const TUid & aApplicationUid) |
|
44 { |
|
45 FUNC_LOG; |
|
46 CFileSystemInfo* self = new (ELeave) CFileSystemInfo(); |
|
47 CleanupStack::PushL( self ); |
|
48 self->ConstructL(aApplicationUid); |
|
49 return self; |
|
50 } |
|
51 |
|
52 // --------------------------------------------------------- |
|
53 // CFileSystemInfo::CFileSystemInfo() |
|
54 // --------------------------------------------------------- |
|
55 // |
|
56 CFileSystemInfo::CFileSystemInfo() |
|
57 { |
|
58 FUNC_LOG; |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------- |
|
62 // CFileSystemInfo::~CFileSystemInfo() |
|
63 // --------------------------------------------------------- |
|
64 // |
|
65 CFileSystemInfo::~CFileSystemInfo() |
|
66 { |
|
67 FUNC_LOG; |
|
68 } |
|
69 |
|
70 // --------------------------------------------------------- |
|
71 // CFileSystemInfo::PrivatePath() |
|
72 // --------------------------------------------------------- |
|
73 // |
|
74 TFileName CFileSystemInfo::PrivatePath() const |
|
75 { |
|
76 FUNC_LOG; |
|
77 return iPrivatePath; |
|
78 } |
|
79 |
|
80 // --------------------------------------------------------- |
|
81 // CFileSystemInfo::ConstructL() |
|
82 // --------------------------------------------------------- |
|
83 // |
|
84 void CFileSystemInfo::ConstructL(const TUid & aApplicationUid) |
|
85 { |
|
86 FUNC_LOG; |
|
87 RApaLsSession apaSession; |
|
88 |
|
89 // Connect to application architecture service. |
|
90 User::LeaveIfError( apaSession.Connect() ); |
|
91 |
|
92 // Retrieve the application info |
|
93 TApaAppInfo appInfo; |
|
94 User::LeaveIfError( apaSession.GetAppInfo( appInfo, aApplicationUid ) ); |
|
95 |
|
96 // Close connection to application architecture service. |
|
97 apaSession.Close(); |
|
98 |
|
99 RFs fs; |
|
100 User::LeaveIfError(fs.Connect()); |
|
101 |
|
102 // Parse the installation drive from the application path. |
|
103 TParse driveParse; |
|
104 driveParse.Set( appInfo.iFullName, NULL, NULL ); |
|
105 iPrivatePath.Append( driveParse.Drive() ); |
|
106 |
|
107 // Append the private path to installation drive. |
|
108 TFileName privatePath; |
|
109 fs.PrivatePath( privatePath ); |
|
110 iPrivatePath.Append( privatePath ); |
|
111 fs.Close(); |
|
112 |
|
113 } |
|
114 |
|
115 // End of file |
|
116 |