122 return exclusionList; |
124 return exclusionList; |
123 } |
125 } |
124 |
126 |
125 void CMTPDeviceDpConfigMgr::GetDriveInfoL(TInt aDriveNo, TDes& aVolumeName, TDes& aRootDirPath) |
127 void CMTPDeviceDpConfigMgr::GetDriveInfoL(TInt aDriveNo, TDes& aVolumeName, TDes& aRootDirPath) |
126 { |
128 { |
127 __FLOG(_L8("GetDriveInfoL - Entry")); |
129 OstTraceFunctionEntry0( CMTPDEVICEDPCONFIGMGR_GETDRIVEINFOL_ENTRY ); |
128 RResourceFile resFile; |
130 RResourceFile resFile; |
129 resFile.OpenL(iFramework.Fs(), iFramework.DataProviderConfig().DesCValue(MMTPDataProviderConfig::EResourceFileName)); |
131 resFile.OpenL(iFramework.Fs(), iFramework.DataProviderConfig().DesCValue(MMTPDataProviderConfig::EResourceFileName)); |
130 CleanupClosePushL(resFile); |
132 CleanupClosePushL(resFile); |
131 HBufC8* dataBuffer=resFile.AllocReadLC(DRIVES); |
133 HBufC8* dataBuffer=resFile.AllocReadLC(DRIVES); |
132 |
134 |
133 TResourceReader reader; |
135 TResourceReader reader; |
134 reader.SetBuffer(dataBuffer); |
136 reader.SetBuffer(dataBuffer); |
135 TInt maxDrives = reader.ReadInt16(); |
137 TInt maxDrives = reader.ReadInt16(); |
136 __FLOG_VA((_L8("aDriveNo = %d"), aDriveNo)); |
138 OstTrace1(TRACE_NORMAL, CMTPDEVICEDPCONFIGMGR_GETDRIVEINFOL, "aDriveNo = %d", aDriveNo); |
137 TBool found = EFalse; |
139 TBool found = EFalse; |
138 for(TInt driveIndex = 0; driveIndex < maxDrives; driveIndex++) |
140 for(TInt driveIndex = 0; driveIndex < maxDrives; driveIndex++) |
139 { |
141 { |
140 TInt driveNumber = reader.ReadInt16(); |
142 TInt driveNumber = reader.ReadInt16(); |
141 TPtrC volumeName = reader.ReadTPtrC(); |
143 TPtrC volumeName = reader.ReadTPtrC(); |
142 TPtrC rootDirName = reader.ReadTPtrC(); |
144 TPtrC rootDirName = reader.ReadTPtrC(); |
143 |
145 |
144 if(driveNumber == aDriveNo) |
146 if(driveNumber == aDriveNo) |
145 { |
147 { |
146 found = ETrue; |
148 found = ETrue; |
147 __FLOG_VA((_L8("Found the drive! Drive Number = %d"), driveNumber)); |
149 OstTrace1(TRACE_NORMAL, DUP1_CMTPDEVICEDPCONFIGMGR_GETDRIVEINFOL, |
|
150 "Found the drive! Drive Number = %d", driveNumber); |
148 if ((KMaxFileName > volumeName.Length()) && |
151 if ((KMaxFileName > volumeName.Length()) && |
149 (KMaxFileName > rootDirName.Length()) |
152 (KMaxFileName > rootDirName.Length()) |
150 ) |
153 ) |
151 { |
154 { |
152 aVolumeName = volumeName; |
155 aVolumeName = volumeName; |
153 aRootDirPath = rootDirName; |
156 aRootDirPath = rootDirName; |
154 } |
157 } |
155 else |
158 else |
156 { |
159 { |
157 __FLOG(_L8("VolumeName or RootDirName length is more than KMaxFileName")); |
160 OstTrace0(TRACE_NORMAL, DUP2_CMTPDEVICEDPCONFIGMGR_GETDRIVEINFOL, |
|
161 "VolumeName or RootDirName length is more than KMaxFileName"); |
158 // volumeName and/or rootDirName specified in resource file is too lengthy. |
162 // volumeName and/or rootDirName specified in resource file is too lengthy. |
159 User::Leave(KErrArgument); |
163 User::Leave(KErrArgument); |
160 } |
164 } |
161 break; |
165 break; |
162 } |
166 } |
163 } |
167 } |
164 |
168 |
165 if (!found) |
169 if (!found) |
166 { |
170 { |
167 __FLOG_VA((_L8("No match in resource file for Drive Number = %d"), aDriveNo)); |
171 OstTrace1(TRACE_NORMAL, DUP3_CMTPDEVICEDPCONFIGMGR_GETDRIVEINFOL, |
|
172 "No match in resource file for Drive Number = %d", aDriveNo); |
168 // Matching drive number was not found in resource file. |
173 // Matching drive number was not found in resource file. |
169 User::Leave(KErrNotFound); |
174 User::Leave(KErrNotFound); |
170 } |
175 } |
171 |
176 |
172 CleanupStack::PopAndDestroy(dataBuffer); |
177 CleanupStack::PopAndDestroy(dataBuffer); |
173 CleanupStack::PopAndDestroy(&resFile); |
178 CleanupStack::PopAndDestroy(&resFile); |
174 __FLOG(_L8("GetDriveInfoL - Exit")); |
179 OstTraceFunctionExit0( CMTPDEVICEDPCONFIGMGR_GETDRIVEINFOL_EXIT ); |
175 } |
180 } |
176 |
181 |
177 void CMTPDeviceDpConfigMgr::GetFriendlyVolumeNameL(TInt aDriveNo, TDes& aVolumeName) |
182 void CMTPDeviceDpConfigMgr::GetFriendlyVolumeNameL(TInt aDriveNo, TDes& aVolumeName) |
178 { |
183 { |
179 __FLOG(_L8("GetFriendlyVolumeNameL - Entry")); |
184 OstTraceFunctionEntry0( CMTPDEVICEDPCONFIGMGR_GETFRIENDLYVOLUMENAMEL_ENTRY ); |
180 RBuf rootDirPath; |
185 RBuf rootDirPath; |
181 rootDirPath.CreateL(KMaxFileName); |
186 rootDirPath.CreateL(KMaxFileName); |
182 rootDirPath.CleanupClosePushL(); |
187 rootDirPath.CleanupClosePushL(); |
183 GetDriveInfoL(aDriveNo, aVolumeName, rootDirPath); |
188 GetDriveInfoL(aDriveNo, aVolumeName, rootDirPath); |
184 CleanupStack::PopAndDestroy(); |
189 CleanupStack::PopAndDestroy(); |
185 __FLOG(_L8("GetFriendlyVolumeNameL - Exit")); |
190 OstTraceFunctionExit0( CMTPDEVICEDPCONFIGMGR_GETFRIENDLYVOLUMENAMEL_EXIT ); |
186 } |
191 } |
187 |
192 |
188 void CMTPDeviceDpConfigMgr::GetRootDirPathL(TInt aDriveNo, TDes& aRootDirPath) |
193 void CMTPDeviceDpConfigMgr::GetRootDirPathL(TInt aDriveNo, TDes& aRootDirPath) |
189 { |
194 { |
190 __FLOG(_L8("GetRootDirPathL - Entry")); |
195 OstTraceFunctionEntry0( CMTPDEVICEDPCONFIGMGR_GETROOTDIRPATHL_ENTRY ); |
191 RBuf volumeName; |
196 RBuf volumeName; |
192 volumeName.CreateL(KMaxFileName); |
197 volumeName.CreateL(KMaxFileName); |
193 volumeName.CleanupClosePushL(); |
198 volumeName.CleanupClosePushL(); |
194 GetDriveInfoL(aDriveNo, volumeName, aRootDirPath); |
199 GetDriveInfoL(aDriveNo, volumeName, aRootDirPath); |
195 CleanupStack::PopAndDestroy(); |
200 CleanupStack::PopAndDestroy(); |
196 __FLOG(_L8("GetRootDirPathL - Exit")); |
201 OstTraceFunctionExit0( CMTPDEVICEDPCONFIGMGR_GETROOTDIRPATHL_EXIT ); |
197 } |
202 } |
198 |
203 |
199 /** |
204 /** |
200 *This method is to get the ordered format from the rss file |
205 *This method is to get the ordered format from the rss file |
201 * |
206 * |
202 *@param aOrderInfoArray : is an array for storing ordered formats(out param). |
207 *@param aOrderInfoArray : is an array for storing ordered formats(out param). |
203 * |
208 * |
204 */ |
209 */ |
205 void CMTPDeviceDpConfigMgr::GetRssConfigInfoArrayL(RArray<TUint>& aOrderInfoArray, TDevDPConfigRSSParams aParam) |
210 void CMTPDeviceDpConfigMgr::GetRssConfigInfoArrayL(RArray<TUint>& aOrderInfoArray, TDevDPConfigRSSParams aParam) |
206 { |
211 { |
207 __FLOG(_L8("GetOrderedFormatInfo - Entry")); |
212 OstTraceFunctionEntry0( CMTPDEVICEDPCONFIGMGR_GETRSSCONFIGINFOARRAYL_ENTRY ); |
208 RResourceFile resFile; |
213 RResourceFile resFile; |
209 resFile.OpenL(iFramework.Fs(), iFramework.DataProviderConfig().DesCValue(MMTPDataProviderConfig::EResourceFileName)); |
214 resFile.OpenL(iFramework.Fs(), iFramework.DataProviderConfig().DesCValue(MMTPDataProviderConfig::EResourceFileName)); |
210 CleanupClosePushL(resFile); |
215 CleanupClosePushL(resFile); |
211 HBufC8* dataBuffer = NULL; |
216 HBufC8* dataBuffer = NULL; |
212 |
217 |