QTfrontend/ui/widget/qpushbuttonwithsound.cpp
changeset 6584 5bb48450b978
parent 6583 4218782d8ca0
child 6700 e04da46ee43c
--- a/QTfrontend/ui/widget/qpushbuttonwithsound.cpp	Tue Jan 17 23:42:30 2012 +0100
+++ b/QTfrontend/ui/widget/qpushbuttonwithsound.cpp	Wed Jan 18 01:07:07 2012 +0100
@@ -1,11 +1,11 @@
-#include "qpushbuttonwithsound.h"
 #include <QMessageBox>
-#include <HWDataManager.h>
 #include <QDir>
-#include <SDLInteraction.h>
-#include <hwform.h>
-#include <QSettings>
-#include <gameuiconfig.h>
+
+#include "qpushbuttonwithsound.h"
+#include "HWDataManager.h"
+#include "SDLInteraction.h"
+#include "hwform.h"
+#include "gameuiconfig.h"
 
 QPushButtonWithSound::QPushButtonWithSound(QWidget *parent) :
     QPushButton(parent),
@@ -21,14 +21,6 @@
 
     HWDataManager & dataMgr = HWDataManager::instance();
 
-    QString soundsDir = QString("Sounds/");
-
-    QStringList list = dataMgr.entryList(
-            soundsDir,
-            QDir::Files,
-            QStringList() <<
-                "shotgunreload.ogg"
-            );
-    if(!list.empty())
-        SDLInteraction::instance().playSoundFile(dataMgr.findFileForRead(soundsDir + "/" + list[0]));
+    if (this->isEnabled())
+        SDLInteraction::instance().playSoundFile(dataMgr.findFileForRead("Sounds/roperelease.ogg"));
 }