diff --git a/src/apps/readonlybootprompt/BootPromptWindow.cpp b/src/apps/readonlybootprompt/BootPromptWindow.cpp index c9ed28da25..baa5d801b6 100644 --- a/src/apps/readonlybootprompt/BootPromptWindow.cpp +++ b/src/apps/readonlybootprompt/BootPromptWindow.cpp @@ -177,51 +177,31 @@ BootPromptWindow::MessageReceived(BMessage* message) } } + namespace BPrivate { void ForceUnloadCatalog(); }; + void BootPromptWindow::_InitCatalog(bool saveSettings) { // Initilialize the Locale Kit BPrivate::ForceUnloadCatalog(); - // Generate a settings file - // TODO: This should not be necessary. - // be_locale_roster->SetPreferredLanguages() should take care of things if (!saveSettings) return; - /* - BPath path; - if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) != B_OK - || path.Append("Locale settings") != B_OK) { - return; - } - BMessage settings; - - BFile file; - if (file.SetTo(path.Path(), B_READ_ONLY) == B_OK) - settings.Unflatten(&file); - BString language; - if (fCatalog->GetLanguage(&language) == B_OK) { - settings.RemoveName("language"); + if (be_locale_roster->GetCatalog()->GetLanguage(&language) == B_OK) { settings.AddString("language", language.String()); } - settings.RemoveName("country"); - BCountry country(language.String(), language.ToUpper()); - settings.AddString("country", country.Code()); + mutable_locale_roster->SetPreferredLanguages(&settings); - if (file.SetTo(path.Path(), B_CREATE_FILE | B_ERASE_FILE | B_WRITE_ONLY) - != B_OK - || settings.Flatten(&file) != B_OK) { - fprintf(stderr, "Failed to write Local Kit settings!\n"); - } - */ + BCountry country(language.String(), language.ToUpper()); + mutable_locale_roster->SetDefaultCountry(country); } diff --git a/src/kits/locale/Catalog.cpp b/src/kits/locale/Catalog.cpp index 070f3538c5..17ff900d18 100644 --- a/src/kits/locale/Catalog.cpp +++ b/src/kits/locale/Catalog.cpp @@ -102,7 +102,7 @@ BCatalog::SetCatalog(const char* signature, uint32 fingerprint) { // This is not thread safe. It is used only in ReadOnlyBootPrompt and should // not do harm there, but not sure what to do about it… - delete fCatalog; + mutable_locale_roster->UnloadCatalog(fCatalog); fCatalog = mutable_locale_roster->LoadCatalog(signature, NULL, fingerprint); return B_OK;