Largish cleanup sweep concerning the Locale Kit (sorry it got so big):

* refactored private/mutable stuff out of LocaleRoster into MutableLocaleRoster
* moved management of Locale/Time settings file and broadcasting of any changes 
  out of preflets and into MutableLocaleRoster
* added proper sorting to the listviews of the Locale preflet
* the Time preflet no longer overlaps long timezone names into the actual time
* several fixes with respect to leaking ICU objects, esp. in BCountry
* the locale roster no longer passes out references to its own BCountry object,
  but uses copies, instead - this makes locking superfluous, as the clients'
  BCountry objects can no longer be changed by the setting a new default 
  country in the locale roster
* removed pretty useless POSIX-style symbol fetching from BCountry - if we
  need that at all, it should live in the dedicated formatter classes
* adjusted readonlybootprompt, dstcheck and Deskbar to the changed Locale API
* refactored existing Time-formatter into TimeUnitFormat and DurationFormat
  (the latter of which is now used by AboutSystem)
* added stubs for Date, DateTime and Time formatters
* lots of coding style fixes throughout the Locale Kit and the Locale and Time 
  preflets
This will probably break most external apps making use of the Locale Kit - it
does break WebPositive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37831 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2010-08-01 20:28:19 +00:00
parent 98dc4f9c65
commit 38ac8def5a
53 changed files with 2488 additions and 2135 deletions
+6 -4
View File
@@ -22,6 +22,7 @@
#include <AppFileInfo.h>
#include <Application.h>
#include <Bitmap.h>
#include <DurationFormat.h>
#include <File.h>
#include <FindDirectory.h>
#include <Font.h>
@@ -36,7 +37,6 @@
#include <ScrollView.h>
#include <String.h>
#include <StringView.h>
#include <TimeFormat.h>
#include <TranslationUtils.h>
#include <TranslatorFormats.h>
#include <View.h>
@@ -1724,12 +1724,14 @@ MemUsageToString(char string[], size_t size, system_info* info)
static const char*
UptimeToString(char string[], size_t size)
{
BTimeFormat formatter;
BDurationFormat formatter;
BString str;
formatter.Format(system_time() / 1000000, &str);
bigtime_t uptime = system_time();
bigtime_t now = (bigtime_t)time(NULL) * 1000000;
formatter.Format(now - uptime, now, &str);
str.CopyInto(string, 0, size);
string[str.Length()] = '\0';
string[std::min((size_t)str.Length(), size)] = '\0';
return string;
}