QTfrontend/ui/page/pageeditteam.cpp
changeset 6167 728cabee2c9f
parent 6165 6fe3e922246e
child 6195 6c9ada03602d
--- a/QTfrontend/ui/page/pageeditteam.cpp	Fri Oct 21 08:03:42 2011 +0200
+++ b/QTfrontend/ui/page/pageeditteam.cpp	Fri Oct 21 08:41:21 2011 +0200
@@ -404,25 +404,20 @@
 
     QStringList list = HWDataManager::instance().entryList(
             voiceDir,
-            QDir::Files/*,
+            QDir::Files,
             QStringList() <<
                 "Illgetyou.ogg" <<
                 "Incoming.ogg" <<
                 "Stupid.ogg" <<
                 "Coward.ogg" <<
-                "Firstblood.ogg"*/
+                "Firstblood.ogg"
             );
 
-    if (list.size())
-    {
-        QFile * tmpFile = HWDataManager::instance().findFileForRead(
-                                voiceDir + "/" + list[rand() % list.size()]);
-
-        SDLInteraction::instance().playSoundFile(tmpFile->fileName());
-
-        // this QFile isn't needed any further
-        delete tmpFile;
-    }
+    if (!list.isEmpty())
+        SDLInteraction::instance().playSoundFile(
+            HWDataManager::instance().findFileForRead(voiceDir + "/" +
+                list[rand() % list.size()])
+        );
 }
 
 void PageEditTeam::createTeam(const QString & name, const QString & playerHash)