equal
deleted
inserted
replaced
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
15 |
15 |
16 #include "TzLocalizationResourceReader.h" //CTzLocalizationResourceReader |
16 #include "TzLocalizationResourceReader.h" //CTzLocalizationResourceReader |
17 #include "TzLocalizationDataTypes.h" //CTzLocalizedCity etc |
17 #include "TzLocalizationDataTypes.h" //CTzLocalizedCity etc |
18 #include "TzLocalizer.h" //TTzLocalizerPanics |
18 #include "TzLocalizer.h" //TTzLocalizerPanics |
19 |
19 |
20 #include <bautils.h> //BaflUtils::NearestLanguageFile |
20 #include <bautils.h> |
|
21 #include "OstTraceDefinitions.h" |
|
22 #ifdef OST_TRACE_COMPILER_IN_USE |
|
23 #include "TzLocalizationResourceReaderTraces.h" |
|
24 #endif |
|
25 //BaflUtils::NearestLanguageFile |
21 |
26 |
22 // Resource File locations |
27 // Resource File locations |
23 _LIT(KTzLocalizationTimeZoneResourceFileName,"\\Resource\\TimeZoneLocalization\\timezones.rSC"); |
28 _LIT(KTzLocalizationTimeZoneResourceFileName,"\\Resource\\TimeZoneLocalization\\timezones.rSC"); |
24 _LIT(KTzLocalizationGroupResourceFileName,"\\Resource\\TimeZoneLocalization\\timezonegroups.rSC"); |
29 _LIT(KTzLocalizationGroupResourceFileName,"\\Resource\\TimeZoneLocalization\\timezonegroups.rSC"); |
25 _LIT(KFlashPath,"c:\\Resource\\TimeZoneLocalization\\"); |
30 _LIT(KFlashPath,"c:\\Resource\\TimeZoneLocalization\\"); |
56 Second phase contructor |
61 Second phase contructor |
57 @internalTechnology |
62 @internalTechnology |
58 */ |
63 */ |
59 void CTzLocalizationResourceReader::ConstructL() |
64 void CTzLocalizationResourceReader::ConstructL() |
60 { |
65 { |
|
66 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_CONSTRUCTL_ENTRY, "CTzLocalizationResourceReader::ConstructL Entry" ); |
|
67 |
61 User::LeaveIfError(iFs.Connect()); |
68 User::LeaveIfError(iFs.Connect()); |
62 |
69 |
63 // Assign Panic category, in case it's needed |
70 // Assign Panic category, in case it's needed |
64 _LIT(KTzLocalizationCategory,"TZLOCALIZATION"); |
71 _LIT(KTzLocalizationCategory,"TZLOCALIZATION"); |
65 |
72 |
113 |
120 |
114 // Open resource files - this can be done now, as it is opened in EFileShareReadersOnly mode |
121 // Open resource files - this can be done now, as it is opened in EFileShareReadersOnly mode |
115 TRAPD(timeZoneResErr,iTimeZoneResourceFile.OpenL(iFs,*timeZoneResourceFileName)); |
122 TRAPD(timeZoneResErr,iTimeZoneResourceFile.OpenL(iFs,*timeZoneResourceFileName)); |
116 if(timeZoneResErr == KErrNotFound || timeZoneResErr == KErrPathNotFound) |
123 if(timeZoneResErr == KErrNotFound || timeZoneResErr == KErrPathNotFound) |
117 { |
124 { |
|
125 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FATAL, CTZLOCALIZATIONRESOURCEREADER_CONSTRUCTL, "CTzLocalizationResourceReader::ConstructL:Panic : ETzLocalizerPanicResourceFileNotFound" ); |
|
126 |
118 User::Panic(KTzLocalizationCategory,CTzLocalizer::ETzLocalizerPanicResourceFileNotFound); |
127 User::Panic(KTzLocalizationCategory,CTzLocalizer::ETzLocalizerPanicResourceFileNotFound); |
119 } |
128 } |
120 User::LeaveIfError(timeZoneResErr); |
129 User::LeaveIfError(timeZoneResErr); |
121 iTimeZoneResourceFile.ConfirmSignatureL(); |
130 iTimeZoneResourceFile.ConfirmSignatureL(); |
122 |
131 |
129 { |
138 { |
130 iGroupResourceFile.ConfirmSignatureL(); |
139 iGroupResourceFile.ConfirmSignatureL(); |
131 iGroupResourceFileExists = ETrue; |
140 iGroupResourceFileExists = ETrue; |
132 } |
141 } |
133 CleanupStack::PopAndDestroy(3, dirList); // groupResourceFileName, timeZoneResourceFileName, dirList |
142 CleanupStack::PopAndDestroy(3, dirList); // groupResourceFileName, timeZoneResourceFileName, dirList |
|
143 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_CONSTRUCTL_EXIT, "CTzLocalizationResourceReader::ConstructL Exit" ); |
|
144 |
134 } |
145 } |
135 |
146 |
136 /** |
147 /** |
137 Destructor |
148 Destructor |
138 @internalTechnology |
149 @internalTechnology |
155 @return The resource ID or KErrNotFound. |
166 @return The resource ID or KErrNotFound. |
156 @internalTechnology |
167 @internalTechnology |
157 */ |
168 */ |
158 TInt CTzLocalizationResourceReader::FindTimeZoneResourceIdL(const TInt aTimeZoneId) |
169 TInt CTzLocalizationResourceReader::FindTimeZoneResourceIdL(const TInt aTimeZoneId) |
159 { |
170 { |
|
171 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_FINDTIMEZONERESOURCEIDL_ENTRY, "CTzLocalizationResourceReader::FindTimeZoneResourceIdL Entry;aTimeZoneId=%d", aTimeZoneId ); |
|
172 |
160 TInt initialOffset = FirstTimeZoneResourceIdL(); |
173 TInt initialOffset = FirstTimeZoneResourceIdL(); |
161 |
174 |
162 TInt idToCheck; |
175 TInt idToCheck; |
163 |
176 |
164 // Search through all resources |
177 // Search through all resources |
176 |
189 |
177 // perform check |
190 // perform check |
178 if(idToCheck == aTimeZoneId) |
191 if(idToCheck == aTimeZoneId) |
179 { |
192 { |
180 // return the current resource ID |
193 // return the current resource ID |
|
194 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_FINDTIMEZONERESOURCEIDL_EXIT, "CTzLocalizationResourceReader::FindTimeZoneResourceIdL Exit" ); |
|
195 |
181 return initialOffset + i; |
196 return initialOffset + i; |
182 } |
197 } |
183 ++i; |
198 ++i; |
184 } |
199 } |
185 |
200 |
186 // If it's got to here the aId hasn't been found, so leave |
201 // If it's got to here the aId hasn't been found, so leave |
|
202 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_ERROR, CTZLOCALIZATIONRESOURCEREADER_FINDTIMEZONERESOURCEIDL, "CTzLocalizationResourceReader::FindTimeZoneResourceIdL:Error: Time zone id = %d not found" ,aTimeZoneId); |
|
203 |
187 User::Leave(KErrNotFound); |
204 User::Leave(KErrNotFound); |
|
205 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_FINDTIMEZONERESOURCEIDL_EXIT2, "CTzLocalizationResourceReader::FindTimeZoneResourceIdL Exit;KErrNotFound=%d", KErrNotFound ); |
|
206 |
188 |
207 |
189 return KErrNotFound; // To satisfy compiler |
208 return KErrNotFound; // To satisfy compiler |
190 } |
209 } |
191 |
210 |
192 /** |
211 /** |
204 // Skip on the relevant number of resources, using the Offset enum |
223 // Skip on the relevant number of resources, using the Offset enum |
205 resourceIdToReturn += aOffset; |
224 resourceIdToReturn += aOffset; |
206 |
225 |
207 if(!aResourceFile.OwnsResourceIdL(resourceIdToReturn)) |
226 if(!aResourceFile.OwnsResourceIdL(resourceIdToReturn)) |
208 { |
227 { |
|
228 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_ERROR, CTZLOCALIZATIONRESOURCEREADER_LOCALIZEDRESOURCEIDL, "CTzLocalizationResourceReader::LocalizedResourceIdL:Error : Resource id = %d not found",resourceIdToReturn ); |
|
229 |
209 User::Leave(KErrNotFound); |
230 User::Leave(KErrNotFound); |
210 } |
231 } |
211 |
232 |
212 return resourceIdToReturn; |
233 return resourceIdToReturn; |
213 } |
234 } |
258 */ |
279 */ |
259 void CTzLocalizationResourceReader::BufferResourceL(const RResourceFile& aResourceFile, const TInt aResourceId) |
280 void CTzLocalizationResourceReader::BufferResourceL(const RResourceFile& aResourceFile, const TInt aResourceId) |
260 { |
281 { |
261 if(!aResourceFile.OwnsResourceIdL(aResourceId)) |
282 if(!aResourceFile.OwnsResourceIdL(aResourceId)) |
262 { |
283 { |
|
284 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_ERROR, CTZLOCALIZATIONRESOURCEREADER_BUFFERRESOURCEL, "CTzLocalizationResourceReader::BufferResourceL:Error; resource id=%d not found", aResourceId ); |
|
285 |
263 User::Leave(KErrNotFound); |
286 User::Leave(KErrNotFound); |
264 } |
287 } |
265 |
288 |
266 // Assign buffer for holding resource |
289 // Assign buffer for holding resource |
267 iResourceBuffer = aResourceFile.AllocReadL(aResourceId); |
290 iResourceBuffer = aResourceFile.AllocReadL(aResourceId); |
332 @leave KErrNotFound Leaves if the no time zones are found in the resource file. |
355 @leave KErrNotFound Leaves if the no time zones are found in the resource file. |
333 @internalTechnology |
356 @internalTechnology |
334 */ |
357 */ |
335 void CTzLocalizationResourceReader::ReadAllTimeZonesL(CTzLocalizedTimeZoneArray& aTimeZones) |
358 void CTzLocalizationResourceReader::ReadAllTimeZonesL(CTzLocalizedTimeZoneArray& aTimeZones) |
336 { |
359 { |
|
360 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_READALLTIMEZONESL_ENTRY, "CTzLocalizationResourceReader::ReadAllTimeZonesL Entry" ); |
|
361 |
337 TInt initialOffset = FirstTimeZoneResourceIdL(); |
362 TInt initialOffset = FirstTimeZoneResourceIdL(); |
338 |
363 |
339 // Variables for us in loop |
364 // Variables for us in loop |
340 CTzLocalizedTimeZone* timeZone; |
365 CTzLocalizedTimeZone* timeZone; |
341 |
366 |
356 } |
381 } |
357 |
382 |
358 // If no owned resources were found - Leave |
383 // If no owned resources were found - Leave |
359 if(i == 0) |
384 if(i == 0) |
360 { |
385 { |
|
386 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_ERROR, CTZLOCALIZATIONRESOURCEREADER_READALLTIMEZONESL, "CTzLocalizationResourceReader::ReadAllTimeZonesL;Error : No owned resources found" ); |
|
387 |
361 User::Leave(KErrNotFound); |
388 User::Leave(KErrNotFound); |
362 } |
389 } |
|
390 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_READALLTIMEZONESL_EXIT, "CTzLocalizationResourceReader::ReadAllTimeZonesL Exit" ); |
|
391 |
363 } |
392 } |
364 |
393 |
365 /** |
394 /** |
366 Reads in and returns a localized time zone found at the specified resource id. |
395 Reads in and returns a localized time zone found at the specified resource id. |
367 @param aResourceId The resource ID of the time zone in the time zone resource |
396 @param aResourceId The resource ID of the time zone in the time zone resource |
514 currently found in iResourceReader. |
543 currently found in iResourceReader. |
515 @internalTechnology |
544 @internalTechnology |
516 */ |
545 */ |
517 void CTzLocalizationResourceReader::AddCityArrayFromResourceL(CTzLocalizedCityArray& aCities, const TInt aResourceId) |
546 void CTzLocalizationResourceReader::AddCityArrayFromResourceL(CTzLocalizedCityArray& aCities, const TInt aResourceId) |
518 { |
547 { |
|
548 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_ADDCITYARRAYFROMRESOURCEL_ENTRY, "CTzLocalizationResourceReader::AddCityArrayFromResourceL Entry;aResourceId=%d", aResourceId ); |
|
549 |
519 // Eat up the localised time zone info from the resource |
550 // Eat up the localised time zone info from the resource |
520 CTzLocalizedTimeZone* timeZone = CreateTimeZoneFromResourceL(aResourceId); |
551 CTzLocalizedTimeZone* timeZone = CreateTimeZoneFromResourceL(aResourceId); |
521 |
552 |
522 // Create a TTZlocalizedId to give to all the cities |
553 // Create a TTZlocalizedId to give to all the cities |
523 TTzLocalizedId tzLocalizedId(timeZone->TimeZoneId(),aResourceId); |
554 TTzLocalizedId tzLocalizedId(timeZone->TimeZoneId(),aResourceId); |
530 TInt numCities = iResourceReader.ReadInt16(); |
561 TInt numCities = iResourceReader.ReadInt16(); |
531 |
562 |
532 // Leave if no cities are found |
563 // Leave if no cities are found |
533 if(numCities < 1) |
564 if(numCities < 1) |
534 { |
565 { |
|
566 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_ERROR, CTZLOCALIZATIONRESOURCEREADER_ADDCITYARRAYFROMRESOURCEL, "CTzLocalizationResourceReader::AddCityArrayFromResourceL:No cities found" ); |
|
567 |
535 User::Leave(KErrNotFound); |
568 User::Leave(KErrNotFound); |
536 } |
569 } |
537 |
570 |
538 // variables for use in the loop |
571 // variables for use in the loop |
539 TUint8 groupId; |
572 TUint8 groupId; |
552 aCities.AppendL(city); |
585 aCities.AppendL(city); |
553 |
586 |
554 CleanupStack::Pop(city); |
587 CleanupStack::Pop(city); |
555 city = NULL; |
588 city = NULL; |
556 } |
589 } |
|
590 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, DUP1_CTZLOCALIZATIONRESOURCEREADER_ADDCITYARRAYFROMRESOURCEL_EXIT, "CTzLocalizationResourceReader::AddCityArrayFromResourceL Exit" ); |
|
591 |
557 } |
592 } |
558 |
593 |
559 /** |
594 /** |
560 From MTzLocalizationReader |
595 From MTzLocalizationReader |
561 Reads the cities from the specified city group and adds them to the specified city array. |
596 Reads the cities from the specified city group and adds them to the specified city array. |
565 the group numbering in the resource file is incorrect. |
600 the group numbering in the resource file is incorrect. |
566 @internalTechnology |
601 @internalTechnology |
567 */ |
602 */ |
568 void CTzLocalizationResourceReader::ReadCitiesInGroupL(CTzLocalizedCityArray& aCities, const TUint8 aGroupId) |
603 void CTzLocalizationResourceReader::ReadCitiesInGroupL(CTzLocalizedCityArray& aCities, const TUint8 aGroupId) |
569 { |
604 { |
|
605 OstTraceDef0( OST_TRACE_CATEGORY_DEBUG,TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_READCITIESINGROUPL_ENTRY, "CTzLocalizationResourceReader::ReadCitiesInGroupL Entry" ); |
|
606 |
570 if(iGroupResourceFileExists) |
607 if(iGroupResourceFileExists) |
571 // Only do this if a groups resource file exists - otherwise no groups have been specified |
608 // Only do this if a groups resource file exists - otherwise no groups have been specified |
572 { |
609 { |
573 TInt initialOffset = FirstTimeZoneResourceIdL(); |
610 TInt initialOffset = FirstTimeZoneResourceIdL(); |
574 |
611 |
611 ++i; |
648 ++i; |
612 } |
649 } |
613 CleanupStack::PopAndDestroy(citiesInTimeZone); |
650 CleanupStack::PopAndDestroy(citiesInTimeZone); |
614 citiesInTimeZone = NULL; |
651 citiesInTimeZone = NULL; |
615 } |
652 } |
|
653 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_READCITIESINGROUPL_EXIT, "CTzLocalizationResourceReader::ReadCitiesInGroupL Exit" ); |
|
654 |
616 } |
655 } |
617 |
656 |
618 /** |
657 /** |
619 From MTzLocalizationReader |
658 From MTzLocalizationReader |
620 Reads all groups from the resource file and adds them to the specified group array. |
659 Reads all groups from the resource file and adds them to the specified group array. |
657 */ |
696 */ |
658 CTzLocalizedCityGroup* CTzLocalizationResourceReader::ReadGroupL(const TUint8 aGroupId) |
697 CTzLocalizedCityGroup* CTzLocalizationResourceReader::ReadGroupL(const TUint8 aGroupId) |
659 { |
698 { |
660 if(aGroupId < 1) |
699 if(aGroupId < 1) |
661 { |
700 { |
|
701 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_ERROR, CTZLOCALIZATIONRESOURCEREADER_READGROUPL, "CTzLocalizationResourceReader::ReadGroupL:Error;Invalid groud id = %d",aGroupId ); |
|
702 |
662 User::Leave(KErrArgument); |
703 User::Leave(KErrArgument); |
663 } |
704 } |
664 |
705 |
665 CTzLocalizedCityGroup* group = NULL; |
706 CTzLocalizedCityGroup* group = NULL; |
666 |
707 |
678 // The group resource file doesn't exist - leave with KErrNotFound |
719 // The group resource file doesn't exist - leave with KErrNotFound |
679 // This means that it is transparent to the user, whether the groups |
720 // This means that it is transparent to the user, whether the groups |
680 // resource file exists or not, because this function already leaves |
721 // resource file exists or not, because this function already leaves |
681 // with KErrNotFound if the specified Group ID is not found. |
722 // with KErrNotFound if the specified Group ID is not found. |
682 { |
723 { |
|
724 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_ERROR, DUP1_CTZLOCALIZATIONRESOURCEREADER_READGROUPL, "CTzLocalizationResourceReader::ReadGroupL:Error;Group resource file not found" ); |
|
725 |
683 User::Leave(KErrNotFound); |
726 User::Leave(KErrNotFound); |
684 } |
727 } |
685 |
728 |
686 return group; |
729 return group; |
687 } |
730 } |
778 @return The specified cached zone. |
821 @return The specified cached zone. |
779 @internalTechnology |
822 @internalTechnology |
780 */ |
823 */ |
781 CTzLocalizedTimeZone* CTzLocalizationResourceReader::ReadFrequentlyUsedZoneL(const CTzLocalizedTimeZone::TTzFrequentlyUsedZone aFrequentlyUsedZone) |
824 CTzLocalizedTimeZone* CTzLocalizationResourceReader::ReadFrequentlyUsedZoneL(const CTzLocalizedTimeZone::TTzFrequentlyUsedZone aFrequentlyUsedZone) |
782 { |
825 { |
|
826 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_READFREQUENTLYUSEDZONEL_ENTRY, "CTzLocalizationResourceReader::ReadFrequentlyUsedZoneL Entry;aFrequentlyUsedZone=%u", aFrequentlyUsedZone ); |
|
827 |
783 // You cannot pass ECachedTimeZones in as the argument, because it is only |
828 // You cannot pass ECachedTimeZones in as the argument, because it is only |
784 // used to keep count of how many cached zones there are. |
829 // used to keep count of how many cached zones there are. |
785 __ASSERT_ALWAYS(aFrequentlyUsedZone != CTzLocalizedTimeZone::ECachedTimeZones, User::Leave(KErrArgument)); |
830 __ASSERT_ALWAYS(aFrequentlyUsedZone != CTzLocalizedTimeZone::ECachedTimeZones, User::Leave(KErrArgument)); |
786 |
831 |
787 TInt offset = CachedTimeZoneResourceIdL(); |
832 TInt offset = CachedTimeZoneResourceIdL(); |
811 case CTzLocalizedTimeZone::ERecentZone2: |
856 case CTzLocalizedTimeZone::ERecentZone2: |
812 cachedTimeZone = ReadTimeZoneL(defaultRecentZone2Id); |
857 cachedTimeZone = ReadTimeZoneL(defaultRecentZone2Id); |
813 break; |
858 break; |
814 case CTzLocalizedTimeZone::ECurrentZone: // FALL THROUGH to default - current zone not supported |
859 case CTzLocalizedTimeZone::ECurrentZone: // FALL THROUGH to default - current zone not supported |
815 default: |
860 default: |
|
861 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_ERROR, CTZLOCALIZATIONRESOURCEREADER_READFREQUENTLYUSEDZONEL, "CTzLocalizationResourceReader::ReadFrequentlyUsedZoneL:Error:Invalid zone " ); |
|
862 |
816 User::Leave(KErrArgument); |
863 User::Leave(KErrArgument); |
817 } |
864 } |
|
865 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_READFREQUENTLYUSEDZONEL_EXIT, "CTzLocalizationResourceReader::ReadFrequentlyUsedZoneL Exit" ); |
|
866 |
818 |
867 |
819 return cachedTimeZone; |
868 return cachedTimeZone; |
820 } |
869 } |
821 |
870 |
822 /** |
871 /** |
826 @return The city used to set thespecified cached zone. |
875 @return The city used to set thespecified cached zone. |
827 @internalTechnology |
876 @internalTechnology |
828 */ |
877 */ |
829 CTzLocalizedCity* CTzLocalizationResourceReader::ReadCachedTimeZoneCityL(const CTzLocalizedTimeZone::TTzFrequentlyUsedZone aFrequentlyUsedZone) |
878 CTzLocalizedCity* CTzLocalizationResourceReader::ReadCachedTimeZoneCityL(const CTzLocalizedTimeZone::TTzFrequentlyUsedZone aFrequentlyUsedZone) |
830 { |
879 { |
|
880 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_READCACHEDTIMEZONECITYL_ENTRY, "CTzLocalizationResourceReader::ReadCachedTimeZoneCityL Entry;aFrequentlyUsedZone=%u", aFrequentlyUsedZone ); |
|
881 |
831 // You cannot pass ECachedTimeZones in as the argument, because it is only |
882 // You cannot pass ECachedTimeZones in as the argument, because it is only |
832 // used to keep count of how many cached zones there are. |
883 // used to keep count of how many cached zones there are. |
833 __ASSERT_ALWAYS(aFrequentlyUsedZone != CTzLocalizedTimeZone::ECachedTimeZones, User::Leave(KErrArgument)); |
884 __ASSERT_ALWAYS(aFrequentlyUsedZone != CTzLocalizedTimeZone::ECachedTimeZones, User::Leave(KErrArgument)); |
834 |
885 |
835 TInt offset = CachedTimeZoneResourceIdL(); |
886 TInt offset = CachedTimeZoneResourceIdL(); |
859 case CTzLocalizedTimeZone::ERecentZone2: |
910 case CTzLocalizedTimeZone::ERecentZone2: |
860 cachedCity = ReadDefaultCityL(defaultRecentZone2Id); |
911 cachedCity = ReadDefaultCityL(defaultRecentZone2Id); |
861 break; |
912 break; |
862 case CTzLocalizedTimeZone::ECurrentZone: // FALL THROUGH to default - current zone not supported |
913 case CTzLocalizedTimeZone::ECurrentZone: // FALL THROUGH to default - current zone not supported |
863 default: |
914 default: |
|
915 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_ERROR, CTZLOCALIZATIONRESOURCEREADER_READCACHEDTIMEZONECITYL, "CTzLocalizationResourceReader::ReadCachedTimeZoneCityL:Invalid zone" ); |
|
916 |
864 User::Leave(KErrArgument); |
917 User::Leave(KErrArgument); |
865 } |
918 } |
|
919 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_FLOW_PARAM, CTZLOCALIZATIONRESOURCEREADER_READCACHEDTIMEZONECITYL_EXIT, "CTzLocalizationResourceReader::ReadCachedTimeZoneCityL Exit" ); |
|
920 |
866 |
921 |
867 return cachedCity; |
922 return cachedCity; |
868 } |
923 } |
869 //============================================================================ |
924 //============================================================================ |
870 // End of file |
925 // End of file |