1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-09-30 01:09:27 +03:00

Remove unnecessary file existence check in GMenu2X::showSettings()

Browsing the user's translations directory will simply add no new files
to the list of translations available if the directory doesn't exist.
GMenu2X::showSettings() doesn't need to care about that.

Because translations are files, not directories, also don't return
directories in the result. The code that makes the translations list
calls FileLister::getFiles and ignores directories anyway.
This commit is contained in:
Nebuleon Fumika 2014-08-13 06:41:47 +00:00 committed by Maarten ter Huurne
parent a60a529de6
commit cf896e6175

View File

@ -676,12 +676,9 @@ void GMenu2X::showSettings() {
#endif
FileLister fl_tr;
fl_tr.setShowDirectories(false);
fl_tr.browse(GMENU2X_SYSTEM_DIR "/translations");
string tr_path = getHome() + "/translations";
if (fileExists(tr_path)) {
fl_tr.browse(tr_path, false);
}
fl_tr.browse(getHome() + "/translations", false);
fl_tr.insertFile("English");
string lang = tr.lang();