* Allow ReadOnlyBootPrompt to change languages at runtime again.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37862 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues 2010-08-03 08:48:34 +00:00
parent 1ffa502964
commit 5dbb457c09
3 changed files with 15 additions and 7 deletions

View File

@ -177,13 +177,15 @@ BootPromptWindow::MessageReceived(BMessage* message)
}
}
namespace BPrivate {
void ForceUnloadCatalog();
};
void
BootPromptWindow::_InitCatalog(bool saveSettings)
{
// Initilialize the Locale Kit
// TODO : not possible with the current API !
// sCatalogInitOnce = false;
BPrivate::ForceUnloadCatalog();
// Generate a settings file
// TODO: This should not be necessary.

View File

@ -100,11 +100,9 @@ BCatalog::GetData(uint32 id, BMessage *msg)
status_t
BCatalog::SetCatalog(const char* signature, uint32 fingerprint)
{
// TODO: The previous fCatalog is leaked here. (The whole chain, it
// looks like.) We should take care that internal members are always
// properly maintained.
// No other method should touch fCatalog directly, either (constructor for
// example)
// 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;
fCatalog = mutable_locale_roster->LoadCatalog(signature, NULL, fingerprint);
return B_OK;

View File

@ -24,3 +24,11 @@ BLocaleRoster::GetCatalog()
return _GetCatalog(&sCatalog, &sCatalogInitOnce);
}
namespace BPrivate{
void ForceUnloadCatalog()
{
sCatalogInitOnce = false;
}
}