27 #include "castorageproxy.h" |
27 #include "castorageproxy.h" |
28 #include "cadef.h" |
28 #include "cadef.h" |
29 #include "cainnerquery.h" |
29 #include "cainnerquery.h" |
30 #include "cainnerentry.h" |
30 #include "cainnerentry.h" |
31 #include "casqlcommands.h" |
31 #include "casqlcommands.h" |
|
32 #include "cautils.h" |
32 |
33 |
33 |
34 |
34 |
35 |
35 // --------------------------------------------------------------------------- |
36 // --------------------------------------------------------------------------- |
36 // CCaLocalizerScannerProxy::NewL |
37 // CCaLocalizerScannerProxy::NewL |
172 HBufC* CCaLocalizerScannerProxy::GetLocalizedNameLC( |
173 HBufC* CCaLocalizerScannerProxy::GetLocalizedNameLC( |
173 const CCaLocalizationEntry* aLocEntry) |
174 const CCaLocalizationEntry* aLocEntry) |
174 { |
175 { |
175 if( iRecentQmFile.Compare( aLocEntry->GetQmFilename() ) ) |
176 if( iRecentQmFile.Compare( aLocEntry->GetQmFilename() ) ) |
176 { |
177 { |
177 |
178 MenuUtils::InitTextResolverSymbianL(aLocEntry->GetQmFilename()); |
178 if( !HbTextResolverSymbian::Init( aLocEntry->GetQmFilename(), KLocalizationFilepathC ) ) |
|
179 { |
|
180 if( !HbTextResolverSymbian::Init( aLocEntry->GetQmFilename(), KLocalizationFilepathZ ) ) |
|
181 { |
|
182 // this should not be called too often |
|
183 TChar currentDriveLetter; |
|
184 TDriveList driveList; |
|
185 RFs fs; |
|
186 User::LeaveIfError( fs.Connect() ); |
|
187 User::LeaveIfError( fs.DriveList( driveList ) ); |
|
188 |
|
189 RBuf path; |
|
190 path.Create( KLocalizationFilepath().Length() + 1 ); |
|
191 CleanupClosePushL( path ); |
|
192 |
|
193 for ( TInt driveNr=EDriveY; driveNr >= EDriveA; driveNr-- ) |
|
194 { |
|
195 if ( driveList[driveNr] ) |
|
196 { |
|
197 User::LeaveIfError( fs.DriveToChar( driveNr, |
|
198 currentDriveLetter ) ); |
|
199 path.Append( currentDriveLetter ); |
|
200 path.Append( KLocalizationFilepath ); |
|
201 if( HbTextResolverSymbian::Init( aLocEntry->GetQmFilename(), path ) ) |
|
202 { |
|
203 break; |
|
204 } |
|
205 } |
|
206 path.Zero(); |
|
207 } |
|
208 CleanupStack::PopAndDestroy( &path ); |
|
209 fs.Close(); |
|
210 } |
|
211 } |
|
212 |
|
213 // keeping last qm filename to avoid another initialization |
179 // keeping last qm filename to avoid another initialization |
214 iRecentQmFile.Close(); |
180 iRecentQmFile.Close(); |
215 iRecentQmFile.Create( aLocEntry->GetQmFilename().Length() ); |
181 iRecentQmFile.CreateL( aLocEntry->GetQmFilename().Length() ); |
216 iRecentQmFile.Copy( aLocEntry->GetQmFilename() ); |
182 iRecentQmFile.Copy( aLocEntry->GetQmFilename() ); |
217 } |
183 } |
218 return HbTextResolverSymbian::LoadLC( aLocEntry->GetStringId() ); |
184 return HbTextResolverSymbian::LoadLC( aLocEntry->GetStringId() ); |
219 } |
185 } |
220 |
186 |