merge
authorunc0rr
Sat, 25 Jun 2011 17:22:35 +0400
changeset 5310 4622f83623ac
parent 5307 dd53755e0fca (current diff)
parent 5308 c57a8878eebe (diff)
child 5312 85df559b85cd
child 5313 5e18eaef65d0
merge
--- a/QTfrontend/pageeditteam.cpp	Sat Jun 25 17:22:13 2011 +0400
+++ b/QTfrontend/pageeditteam.cpp	Sat Jun 25 17:22:35 2011 +0400
@@ -145,10 +145,13 @@
         CBVoicepack = new QComboBox(GBoxTeam);
         {
             QDir tmpdir;
+            QStringList list;
             tmpdir.cd(cfgdir->absolutePath());
-            tmpdir.cd("Data/Sounds/voices");
-            QStringList list = tmpdir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
-            CBVoicepack->addItems(list);
+            if (tmpdir.cd("Data/Sounds/voices")) 
+            {
+                list = tmpdir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
+                CBVoicepack->addItems(list);
+            }
 
             tmpdir.cd(datadir->absolutePath());
             tmpdir.cd("Sounds/voices");
@@ -182,12 +185,14 @@
     vbox2->addWidget(GBoxFort);
 
     QDir tmpdir;
+    QStringList userforts;
     tmpdir.cd(cfgdir->absolutePath());
-    tmpdir.cd("Data/Forts");
-    tmpdir.setFilter(QDir::Files);
-
-    QStringList userforts = tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1");
-    CBFort->addItems(userforts);
+    if (tmpdir.cd("Data/Forts"))
+    {
+        tmpdir.setFilter(QDir::Files);
+        userforts = tmpdir.entryList(QStringList("*L.png")).replaceInStrings(QRegExp("^(.*)L\\.png"), "\\1");
+        CBFort->addItems(userforts);
+    }
 
     tmpdir.cd("../Graphics/Graves");
     QStringList userlist = tmpdir.entryList(QStringList("*.png"));
@@ -207,7 +212,7 @@
     for (QStringList::Iterator it = tmplist.begin(); it != tmplist.end(); ++it)
         if (!userforts.contains(*it,Qt::CaseInsensitive)) dataforts.append(*it);
 
-    CBVoicepack->addItems(dataforts);
+    CBFort->addItems(dataforts);
     connect(CBFort, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(CBFort_activated(const QString &)));
 
     tmpdir.cd("../Graphics/Graves");