small cleanup of helloSounds; note: physfs:// prefix will break sound paths since playSoundFile uses physfs for finding files already
authorsheepluva
Thu, 17 Jan 2013 18:12:30 +0100
changeset 8395 0b357c57e01c
parent 8394 26f0d7ab5adf
child 8396 5123eac2f9d6
small cleanup of helloSounds; note: physfs:// prefix will break sound paths since playSoundFile uses physfs for finding files already
QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/ui/widget/chatwidget.cpp	Thu Jan 17 11:16:03 2013 +0400
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Thu Jan 17 18:12:30 2013 +0100
@@ -187,18 +187,15 @@
     m_isAdmin = false;
     m_autoKickEnabled = false;
 
-    {
-        QStringList vpList =
-             QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
+    QStringList vpList =
+         QStringList() << "Classic" << "Default" << "Mobster" << "Russian";
 
-        foreach (QString vp, vpList)
-        {
-            m_helloSounds.append(QString("physfs://Sounds/voices/%1/Hello.ogg").arg(vp));
-        }
+    foreach (const QString & vp, vpList)
+    {
+        m_helloSounds.append(QString("/Sounds/voices/%1/Hello.ogg").arg(vp));
+    }
 
-        m_hilightSound = "physfs://Sounds/beep.ogg";
-
-    }
+    m_hilightSound = "/Sounds/beep.ogg";
 
     mainLayout.setSpacing(1);
     mainLayout.setMargin(1);
@@ -500,7 +497,7 @@
 
     emit nickCountUpdate(chatNicks->model()->rowCount());
 
-    if(notifyNick && notify && gameSettings->value("frontend/sound", true).toBool())
+    if (notifyNick && notify && (m_helloSounds.size() > 0))
     {
         SDLInteraction::instance().playSoundFile(
                             m_helloSounds.at(rand() % m_helloSounds.size()));