COMMON: Look for translations.dat in Theme path before using SearchMan

This commit is contained in:
Thierry Crozat 2011-06-24 20:20:32 +01:00
parent 2b03a3a0e6
commit b35f4d31a6

View file

@ -223,7 +223,11 @@ String TranslationManager::getLangById(int id) const {
} }
bool TranslationManager::openTranslationsFile(File& inFile) { bool TranslationManager::openTranslationsFile(File& inFile) {
// First try to open it using the SearchMan. // First look in the Themepath if we can find the file.
if (ConfMan.hasKey("themepath") && openTranslationsFile(FSNode(ConfMan.get("themepath")), inFile))
return true;
// Then try to open it using the SearchMan.
ArchiveMemberList fileList; ArchiveMemberList fileList;
SearchMan.listMatchingMembers(fileList, "translations.dat"); SearchMan.listMatchingMembers(fileList, "translations.dat");
for (ArchiveMemberList::iterator it = fileList.begin(); it != fileList.end(); ++it) { for (ArchiveMemberList::iterator it = fileList.begin(); it != fileList.end(); ++it) {
@ -235,10 +239,6 @@ bool TranslationManager::openTranslationsFile(File& inFile) {
} }
} }
// Then look in the Themepath if we can find the file.
if (ConfMan.hasKey("themepath"))
return openTranslationsFile(FSNode(ConfMan.get("themepath")), inFile);
return false; return false;
} }