Author: zooey Date: 2010-08-30 16:30:22 +0200 (Mon, 30 Aug 2010) New Revision: 38449 Changeset: http://dev.haiku-os.org/changeset/38449 Added: haiku/trunk/headers/private/locale/TimeZonePrivate.h Removed: haiku/trunk/headers/private/locale/TimeZoneAccessor.h Modified: haiku/trunk/headers/os/locale/TimeZone.h haiku/trunk/src/kits/locale/DurationFormat.cpp Log: * rename BTimeZone::Accessor to BTimeZone::Private to match the other private accessor classes * adjust style in BTimeZone::Private implementation to match other classes of this kind Modified: haiku/trunk/headers/os/locale/TimeZone.h =================================================================== --- haiku/trunk/headers/os/locale/TimeZone.h 2010-08-30 13:02:48 UTC (rev 38448) +++ haiku/trunk/headers/os/locale/TimeZone.h 2010-08-30 14:30:22 UTC (rev 38449) @@ -42,9 +42,10 @@ static const char* kNameOfGmtZone; - struct Accessor; - friend struct BTimeZone::Accessor; + class Private; private: + friend class Private; + icu_44::TimeZone* fIcuTimeZone; icu_44::Locale* fIcuLocale; status_t fInitStatus; Copied: haiku/trunk/headers/private/locale/TimeZonePrivate.h (from rev 38427, haiku/trunk/headers/private/locale/TimeZoneAccessor.h) =================================================================== --- haiku/trunk/headers/private/locale/TimeZonePrivate.h (rev 0) +++ haiku/trunk/headers/private/locale/TimeZonePrivate.h 2010-08-30 14:30:22 UTC (rev 38449) @@ -0,0 +1,37 @@ +/* + * Copyright 2010, Oliver Tappe <zooey@xxxxxxxxxxxxxxx> + * Distributed under the terms of the MIT License. + */ +#ifndef _TIME_ZONE_PRIVATE_H +#define _TIME_ZONE_PRIVATE_H + + +#include <TimeZone.h> + + +class BTimeZone::Private { +public: + Private(const BTimeZone* timeZone = NULL) + : + fTimeZone(timeZone) + { + } + + void + SetTo(const BTimeZone* timeZone) + { + fTimeZone = timeZone; + } + + icu_44::TimeZone* + IcuTimeZone() + { + return fTimeZone->fIcuTimeZone; + } + +private: + const BTimeZone* fTimeZone; +}; + + +#endif // _TIME_ZONE_PRIVATE_H Modified: haiku/trunk/src/kits/locale/DurationFormat.cpp =================================================================== --- haiku/trunk/src/kits/locale/DurationFormat.cpp 2010-08-30 13:02:48 UTC (rev 38448) +++ haiku/trunk/src/kits/locale/DurationFormat.cpp 2010-08-30 14:30:22 UTC (rev 38449) @@ -18,7 +18,7 @@ #include <LocaleRoster.h> #include <TimeZone.h> -#include <TimeZoneAccessor.h> +#include <TimeZonePrivate.h> // maps our unit element to the corresponding ICU unit @@ -112,18 +112,18 @@ if (fCalendar == NULL) return B_NO_INIT; - BTimeZone::Accessor zoneAccessor; + BTimeZone::Private zonePrivate; if (timeZone == NULL) { BTimeZone defaultTimeZone; status_t result = be_locale_roster->GetDefaultTimeZone(&defaultTimeZone); if (result != B_OK) return result; - zoneAccessor.SetTo(&defaultTimeZone); + zonePrivate.SetTo(&defaultTimeZone); } else - zoneAccessor.SetTo(timeZone); + zonePrivate.SetTo(timeZone); - TimeZone* icuTimeZone = zoneAccessor.IcuTimeZone(); + TimeZone* icuTimeZone = zonePrivate.IcuTimeZone(); if (icuTimeZone != NULL) fCalendar->setTimeZone(*icuTimeZone);