Added support for getting a list of all available timezone IDs to LocaleRoster.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38321 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -45,6 +45,7 @@ public:
|
|||||||
// contain the language-name(s)
|
// contain the language-name(s)
|
||||||
|
|
||||||
status_t GetAvailableCountries(BMessage* message) const;
|
status_t GetAvailableCountries(BMessage* message) const;
|
||||||
|
status_t GetAvailableTimeZones(BMessage* message) const;
|
||||||
|
|
||||||
status_t GetInstalledCatalogs(BMessage* message,
|
status_t GetInstalledCatalogs(BMessage* message,
|
||||||
const char* sigPattern = NULL,
|
const char* sigPattern = NULL,
|
||||||
|
|||||||
@@ -229,6 +229,37 @@ BLocaleRoster::GetAvailableCountries(BMessage* countries) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
BLocaleRoster::GetAvailableTimeZones(BMessage* timeZones) const
|
||||||
|
{
|
||||||
|
if (!timeZones)
|
||||||
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
|
status_t status = B_OK;
|
||||||
|
|
||||||
|
int32 i;
|
||||||
|
StringEnumeration* zoneList = TimeZone::createEnumeration();
|
||||||
|
|
||||||
|
UErrorCode icuStatus = U_ZERO_ERROR;
|
||||||
|
int32 count = zoneList->count(icuStatus);
|
||||||
|
if (U_SUCCESS(icuStatus)) {
|
||||||
|
for (i = 0; i < count; ++i) {
|
||||||
|
const char* zoneID = zoneList->next(NULL, icuStatus);
|
||||||
|
if (zoneID == NULL || !U_SUCCESS(icuStatus)) {
|
||||||
|
status = B_ERROR;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
timeZones->AddString("timeZone", zoneID);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
status = B_ERROR;
|
||||||
|
|
||||||
|
delete zoneList;
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BLocaleRoster::GetInstalledCatalogs(BMessage* languageList,
|
BLocaleRoster::GetInstalledCatalogs(BMessage* languageList,
|
||||||
const char* sigPattern, const char* langPattern, int32 fingerprint) const
|
const char* sigPattern, const char* langPattern, int32 fingerprint) const
|
||||||
|
|||||||
Reference in New Issue
Block a user