QTfrontend/ui/page/pageeditteam.cpp
changeset 6167 728cabee2c9f
parent 6165 6fe3e922246e
child 6195 6c9ada03602d
equal deleted inserted replaced
6166:701c5b8fac56 6167:728cabee2c9f
   402 {
   402 {
   403     QString voiceDir = QString("Sounds/voices/") + CBVoicepack->currentText();
   403     QString voiceDir = QString("Sounds/voices/") + CBVoicepack->currentText();
   404 
   404 
   405     QStringList list = HWDataManager::instance().entryList(
   405     QStringList list = HWDataManager::instance().entryList(
   406             voiceDir,
   406             voiceDir,
   407             QDir::Files/*,
   407             QDir::Files,
   408             QStringList() <<
   408             QStringList() <<
   409                 "Illgetyou.ogg" <<
   409                 "Illgetyou.ogg" <<
   410                 "Incoming.ogg" <<
   410                 "Incoming.ogg" <<
   411                 "Stupid.ogg" <<
   411                 "Stupid.ogg" <<
   412                 "Coward.ogg" <<
   412                 "Coward.ogg" <<
   413                 "Firstblood.ogg"*/
   413                 "Firstblood.ogg"
   414             );
   414             );
   415 
   415 
   416     if (list.size())
   416     if (!list.isEmpty())
   417     {
   417         SDLInteraction::instance().playSoundFile(
   418         QFile * tmpFile = HWDataManager::instance().findFileForRead(
   418             HWDataManager::instance().findFileForRead(voiceDir + "/" +
   419                                 voiceDir + "/" + list[rand() % list.size()]);
   419                 list[rand() % list.size()])
   420 
   420         );
   421         SDLInteraction::instance().playSoundFile(tmpFile->fileName());
       
   422 
       
   423         // this QFile isn't needed any further
       
   424         delete tmpFile;
       
   425     }
       
   426 }
   421 }
   427 
   422 
   428 void PageEditTeam::createTeam(const QString & name, const QString & playerHash)
   423 void PageEditTeam::createTeam(const QString & name, const QString & playerHash)
   429 {
   424 {
   430     m_playerHash = playerHash;
   425     m_playerHash = playerHash;