[haiku-commits] r37768 - in haiku/trunk: headers/os/locale src/kits/locale src/preferences/time

  • From: pulkomandy@xxxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 27 Jul 2010 11:45:52 +0200 (CEST)

Author: pulkomandy
Date: 2010-07-27 11:45:52 +0200 (Tue, 27 Jul 2010)
New Revision: 37768
Changeset: http://dev.haiku-os.org/changeset/37768

Modified:
   haiku/trunk/headers/os/locale/LocaleRoster.h
   haiku/trunk/src/kits/locale/LocaleRoster.cpp
   haiku/trunk/src/preferences/time/ZoneView.cpp
Log:
 * Set the ICU default time zone from the locale preflet. Unfortunately it 
looks like this doesn't solve all the problems 
yet.


Modified: haiku/trunk/headers/os/locale/LocaleRoster.h
===================================================================
--- haiku/trunk/headers/os/locale/LocaleRoster.h        2010-07-27 09:19:24 UTC 
(rev 37767)
+++ haiku/trunk/headers/os/locale/LocaleRoster.h        2010-07-27 09:45:52 UTC 
(rev 37768)
@@ -42,6 +42,7 @@
                status_t GetDefaultTimeZone(BTimeZone**timezone) const;
 
                void SetDefaultCountry(BCountry *) const;
+               void SetDefaultTimeZone(const char* zone) const;
                void UpdateSettings(BMessage* newSettings);
 
                status_t GetLanguage(const char* languageCode, BLanguage** 
_language)

Modified: haiku/trunk/src/kits/locale/LocaleRoster.cpp
===================================================================
--- haiku/trunk/src/kits/locale/LocaleRoster.cpp        2010-07-27 09:19:24 UTC 
(rev 37767)
+++ haiku/trunk/src/kits/locale/LocaleRoster.cpp        2010-07-27 09:45:52 UTC 
(rev 37768)
@@ -37,6 +37,7 @@
 
 // ICU includes
 #include <unicode/locid.h>
+#include <unicode/timezone.h>
 
 
 /*
@@ -545,6 +546,13 @@
 
 
 void
+BLocaleRoster::SetDefaultTimeZone(const char* zone) const
+{
+       TimeZone::adoptDefault(TimeZone::createTimeZone(zone));
+}
+
+
+void
 BLocaleRoster::UpdateSettings(BMessage* newSettings)
 {
        gRosterData.UpdateSettings(newSettings);

Modified: haiku/trunk/src/preferences/time/ZoneView.cpp
===================================================================
--- haiku/trunk/src/preferences/time/ZoneView.cpp       2010-07-27 09:19:24 UTC 
(rev 37767)
+++ haiku/trunk/src/preferences/time/ZoneView.cpp       2010-07-27 09:45:52 UTC 
(rev 37768)
@@ -374,5 +374,7 @@
 {
        putenv(BString("TZ=").Append(zone).String());
        tzset();
+
+       be_locale_roster->SetDefaultTimeZone(zone);
 }
 


Other related posts:

  • » [haiku-commits] r37768 - in haiku/trunk: headers/os/locale src/kits/locale src/preferences/time - pulkomandy