* Refresh() should make sure to try and load both "locale" and "timezone"

settings, not give up when one is missing (like on a fresh image)
* try harder to fallback to proper default values when loading the locale
  settings file fails

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38165 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe 2010-08-16 22:48:00 +00:00
parent dbe1e23aa8
commit 803a1f70aa

View File

@ -169,11 +169,10 @@ RosterData::Refresh()
if (!lock.IsLocked())
return B_ERROR;
status_t status = _LoadLocaleSettings();
if (status == B_OK)
status = _LoadTimeSettings();
_LoadLocaleSettings();
_LoadTimeSettings();
return status;
return B_OK;
}
/*
@ -458,8 +457,11 @@ RosterData::_LoadLocaleSettings()
// Something went wrong (no settings file or invalid BMessage), so we
// set everything to default values
fPreferredLanguages.MakeEmpty();
fPreferredLanguages.AddString("language", "en");
log_team(LOG_ERR, "*** No locale settings found!\n");
_SetDefaultLocale("en_US");
fDefaultLanguage.SetTo("en");
return status;
}
@ -491,7 +493,6 @@ RosterData::_LoadTimeSettings()
// Something went wrong (no settings file or invalid BMessage), so we
// set everything to default values
_SetDefaultTimeZone(BTimeZone(BTimeZone::kNameOfGmtZone));
log_team(LOG_ERR, "*** No time settings found!\n");
return status;
}
@ -607,6 +608,8 @@ RosterData::_SetPreferredLanguages(const BMessage* languages)
} else {
fPreferredLanguages.MakeEmpty();
fPreferredLanguages.AddString("language", "en");
fDefaultLocale.SetCollator(BCollator("en"));
fDefaultLanguage.SetTo("en");
}
return B_OK;