1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-25 17:58:27 +02:00

Removed FileLister::insertFile

This was a nasty hack to insert English into the list of translations.
Instead of modifying the scan results, make a copy and modify the copy.
This commit is contained in:
Maarten ter Huurne 2014-08-14 05:08:36 +02:00
parent 85b072ca43
commit a505d3e494
3 changed files with 3 additions and 7 deletions

View File

@ -169,7 +169,3 @@ string FileLister::operator[](uint x)
const auto dirCount = directories.size();
return x < dirCount ? directories[x] : files[x - dirCount];
}
void FileLister::insertFile(const string &file) {
files.insert(files.begin(), file);
}

View File

@ -51,7 +51,6 @@ public:
const std::vector<std::string> &getDirectories() { return directories; }
const std::vector<std::string> &getFiles() { return files; }
void insertFile(const std::string &file);
};
#endif // FILELISTER_H

View File

@ -680,7 +680,8 @@ void GMenu2X::showSettings() {
fl_tr.browse(GMENU2X_SYSTEM_DIR "/translations");
fl_tr.browse(getHome() + "/translations", false);
fl_tr.insertFile("English");
vector<string> translations = fl_tr.getFiles();
translations.insert(translations.begin(), "English");
string lang = tr.lang();
vector<string> encodings;
@ -688,7 +689,7 @@ void GMenu2X::showSettings() {
encodings.push_back("PAL");
SettingsDialog sd(this, input, ts, tr["Settings"]);
sd.addSetting(new MenuSettingMultiString(this, ts, tr["Language"], tr["Set the language used by GMenu2X"], &lang, &fl_tr.getFiles()));
sd.addSetting(new MenuSettingMultiString(this, ts, tr["Language"], tr["Set the language used by GMenu2X"], &lang, &translations));
sd.addSetting(new MenuSettingBool(this, ts, tr["Save last selection"], tr["Save the last selected link and section on exit"], &confInt["saveSelection"]));
#ifdef ENABLE_CPUFREQ
sd.addSetting(new MenuSettingInt(this, ts, tr["Clock for GMenu2X"], tr["Set the cpu working frequency when running GMenu2X"], &confInt["menuClock"], cpuFreqMin, cpuFreqSafeMax, cpuFreqMultiple));