QTfrontend/ui/page/pageoptions.cpp
changeset 8098 4efee370e2de
parent 7703 78d2ac987f41
child 8151 25b95d6224fc
--- a/QTfrontend/ui/page/pageoptions.cpp	Thu Nov 22 02:15:23 2012 +0100
+++ b/QTfrontend/ui/page/pageoptions.cpp	Thu Nov 22 15:24:10 2012 +0400
@@ -191,11 +191,7 @@
 
             // List of installed languages
             CBLanguage = new QComboBox(groupMisc);
-            QDir tmpdir;
-            tmpdir.cd(cfgdir->absolutePath());
-            tmpdir.cd("Data/Locale");
-            tmpdir.setFilter(QDir::Files);
-            QStringList locs = tmpdir.entryList(QStringList("hedgewars_*.qm"));
+            QStringList locs = DataManager::instance().entryList("Locale", QDir::Files, QStringList("hedgewars_*.qm"));
             CBLanguage->addItem(QComboBox::tr("(System default)"), QString(""));
             for(int i = 0; i < locs.count(); i++)
             {
@@ -203,17 +199,6 @@
                 CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
             }
 
-            tmpdir.cd(datadir->absolutePath());
-            tmpdir.cd("Locale");
-            tmpdir.setFilter(QDir::Files);
-            QStringList tmplist = tmpdir.entryList(QStringList("hedgewars_*.qm"));
-            for(int i = 0; i < tmplist.count(); i++)
-            {
-                if (locs.contains(tmplist[i])) continue;
-                QLocale loc(tmplist[i].replace(QRegExp("hedgewars_(.*)\\.qm"), "\\1"));
-                CBLanguage->addItem(QLocale::languageToString(loc.language()) + " (" + QLocale::countryToString(loc.country()) + ")", loc.name());
-            }
-
             MiscLayout->addWidget(CBLanguage, 0, 1);
 
             // Label and field for net nick