* 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
@@ -177,13 +177,15 @@ BootPromptWindow::MessageReceived(BMessage* message)
} }
} }
namespace BPrivate {
void ForceUnloadCatalog();
};
void void
BootPromptWindow::_InitCatalog(bool saveSettings) BootPromptWindow::_InitCatalog(bool saveSettings)
{ {
// Initilialize the Locale Kit // Initilialize the Locale Kit
// TODO : not possible with the current API ! BPrivate::ForceUnloadCatalog();
// sCatalogInitOnce = false;
// Generate a settings file // Generate a settings file
// TODO: This should not be necessary. // TODO: This should not be necessary.
+3 -5
View File
@@ -100,11 +100,9 @@ BCatalog::GetData(uint32 id, BMessage *msg)
status_t status_t
BCatalog::SetCatalog(const char* signature, uint32 fingerprint) BCatalog::SetCatalog(const char* signature, uint32 fingerprint)
{ {
// TODO: The previous fCatalog is leaked here. (The whole chain, it // This is not thread safe. It is used only in ReadOnlyBootPrompt and should
// looks like.) We should take care that internal members are always // not do harm there, but not sure what to do about it…
// properly maintained. delete fCatalog;
// No other method should touch fCatalog directly, either (constructor for
// example)
fCatalog = mutable_locale_roster->LoadCatalog(signature, NULL, fingerprint); fCatalog = mutable_locale_roster->LoadCatalog(signature, NULL, fingerprint);
return B_OK; return B_OK;
+8
View File
@@ -24,3 +24,11 @@ BLocaleRoster::GetCatalog()
return _GetCatalog(&sCatalog, &sCatalogInitOnce); return _GetCatalog(&sCatalog, &sCatalogInitOnce);
} }
namespace BPrivate{
void ForceUnloadCatalog()
{
sCatalogInitOnce = false;
}
}