* changed BTimeZone to use BLanguage instead of BLocale, as that what represents
the locale of messages (timezone names in this case) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38340 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
4f5f77e6e4
commit
aa8372c486
@ -13,13 +13,13 @@ namespace icu_44 {
|
|||||||
class Locale;
|
class Locale;
|
||||||
class TimeZone;
|
class TimeZone;
|
||||||
}
|
}
|
||||||
class BLocale;
|
class BLanguage;
|
||||||
|
|
||||||
|
|
||||||
class BTimeZone {
|
class BTimeZone {
|
||||||
public:
|
public:
|
||||||
BTimeZone(const char* zoneID = NULL,
|
BTimeZone(const char* zoneID = NULL,
|
||||||
const BLocale* locale = NULL);
|
const BLanguage* language = NULL);
|
||||||
BTimeZone(const BTimeZone& other);
|
BTimeZone(const BTimeZone& other);
|
||||||
~BTimeZone();
|
~BTimeZone();
|
||||||
|
|
||||||
@ -36,9 +36,9 @@ public:
|
|||||||
status_t InitCheck() const;
|
status_t InitCheck() const;
|
||||||
|
|
||||||
status_t SetTo(const char* zoneID,
|
status_t SetTo(const char* zoneID,
|
||||||
const BLocale* locale = NULL);
|
const BLanguage* language = NULL);
|
||||||
|
|
||||||
status_t SetLocale(const BLocale* locale);
|
status_t SetLanguage(const BLanguage* language);
|
||||||
|
|
||||||
static const char* kNameOfGmtZone;
|
static const char* kNameOfGmtZone;
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <unicode/timezone.h>
|
#include <unicode/timezone.h>
|
||||||
#include <ICUWrapper.h>
|
#include <ICUWrapper.h>
|
||||||
|
|
||||||
#include <Locale.h>
|
#include <Language.h>
|
||||||
|
|
||||||
|
|
||||||
const char* BTimeZone::kNameOfGmtZone = "GMT";
|
const char* BTimeZone::kNameOfGmtZone = "GMT";
|
||||||
@ -36,14 +36,14 @@ static const uint32 skSupportsDaylightSavingField = 1U << 7;
|
|||||||
static const uint32 skOffsetFromGMTField = 1U << 8;
|
static const uint32 skOffsetFromGMTField = 1U << 8;
|
||||||
|
|
||||||
|
|
||||||
BTimeZone::BTimeZone(const char* zoneID, const BLocale* locale)
|
BTimeZone::BTimeZone(const char* zoneID, const BLanguage* language)
|
||||||
:
|
:
|
||||||
fIcuTimeZone(NULL),
|
fIcuTimeZone(NULL),
|
||||||
fIcuLocale(NULL),
|
fIcuLocale(NULL),
|
||||||
fInitStatus(B_NO_INIT),
|
fInitStatus(B_NO_INIT),
|
||||||
fInitializedFields(0)
|
fInitializedFields(0)
|
||||||
{
|
{
|
||||||
SetTo(zoneID, locale);
|
SetTo(zoneID, language);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -232,14 +232,14 @@ BTimeZone::InitCheck() const
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BTimeZone::SetLocale(const BLocale* locale)
|
BTimeZone::SetLanguage(const BLanguage* language)
|
||||||
{
|
{
|
||||||
return SetTo(fZoneID, locale);
|
return SetTo(fZoneID, language);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BTimeZone::SetTo(const char* zoneID, const BLocale* locale)
|
BTimeZone::SetTo(const char* zoneID, const BLanguage* language)
|
||||||
{
|
{
|
||||||
delete fIcuLocale;
|
delete fIcuLocale;
|
||||||
fIcuLocale = NULL;
|
fIcuLocale = NULL;
|
||||||
@ -256,8 +256,8 @@ BTimeZone::SetTo(const char* zoneID, const BLocale* locale)
|
|||||||
return fInitStatus;
|
return fInitStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (locale != NULL) {
|
if (language != NULL) {
|
||||||
fIcuLocale = new Locale(locale->Code());
|
fIcuLocale = new Locale(language->Code());
|
||||||
if (fIcuLocale == NULL) {
|
if (fIcuLocale == NULL) {
|
||||||
fInitStatus = B_NO_MEMORY;
|
fInitStatus = B_NO_MEMORY;
|
||||||
return fInitStatus;
|
return fInitStatus;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user