Stumbled across some problems while using the Locale Kit and added TODOs

accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35214 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2010-01-21 11:38:16 +00:00
parent 48e129c9d4
commit 005a5d0bfe
4 changed files with 12 additions and 1 deletions
+4
View File
@@ -121,6 +121,10 @@ BCatalog::GetAppCatalog(BCatalog* catalog)
appNode.ReadAttr(BLocaleRoster::kCatFingerprintAttr, B_UINT32_TYPE, 0,
&fingerprint, sizeof(uint32));
// try to load catalog (with given fingerprint):
// TODO: Not so nice C++ design here, leading to such bugs: The previous
// fCatalog is leaked here. (The whole chain, it looks like.) There should
// be a SetCatalog() method (it can be private), and that should take care
// that internal members are always properly maintained.
catalog->fCatalog
= be_locale_roster->LoadCatalog(sig.String(), NULL, fingerprint);
+2
View File
@@ -132,6 +132,8 @@ BLanguage::GetString(uint32 id) const
status_t
BLanguage::GetName(BString* name)
{
// TODO: This will return the language not in the current be_app_catalog,
// but in the current system wide language! Don't know the exact reason.
UnicodeString s;
fICULocale->getDisplayLanguage(s);
BStringByteSink converter(name);
+4 -1
View File
@@ -45,9 +45,12 @@ BLocale::GetString(uint32 id)
}
status_t
BLocale::GetAppCatalog(BCatalog *catalog) {
BLocale::GetAppCatalog(BCatalog *catalog)
{
if (!catalog)
return B_BAD_VALUE;
// TODO: This is not so nice, and I don't know why it is here, but how
// is it envisioned to switch languages on the fly?
if (be_catalog)
debugger( "GetAppCatalog() has been called while be_catalog != NULL");
return BCatalog::GetAppCatalog(catalog);
+2
View File
@@ -513,6 +513,8 @@ BLocaleRoster::GetInstalledLanguages(BMessage *languages) const
#undef REALLY_ALL_LANGUAGES
#ifdef REALLY_ALL_LANGUAGES
// TODO: Using static variables here looks really weird, and is probably
// the reason why calling this method a second time will crash.
static const char* const* icuLocaleList = Locale::getISOLanguages();
// Loop over the strings and add them to an std::set to remove duplicates