better extensioncheck
authortmarki <tmarki@gmail.com>
Thu, 19 Aug 2010 15:58:06 +0000 (17:58 +0200)
committertmarki <tmarki@gmail.com>
Thu, 19 Aug 2010 15:58:06 +0000 (17:58 +0200)
tomamp/mainwindow.cpp
tomamp/mainwindow.h
tomamp/playlistmanager.cpp

index 349cce5..b7b6c9f 100644 (file)
@@ -132,7 +132,8 @@ void MainWindow::about()
         tr("TomAmp is a simple playlist-based music player.\n\n"
         "(c) 2010 Tamas Marki <tmarki@gmail.com>\n\n"
         "Please send comments and bug reports to the above e-mail address.\n\n"
-        "Icons by http://itweek.deviantart.com/"));
+        "Icons by http://itweek.deviantart.com/\n\n"
+        "Thanks to Attila Csipa for the Diablo build"));
 }
 
 void MainWindow::stateChanged(Phonon::State newState, Phonon::State /* oldState */)
index 59e247e..b9c1f11 100644 (file)
 
 #include <QMainWindow>
 #include <QSettings>
+#if QT_VERSION < 0x040600
+#include <audiooutput.h>
+#include <seekslider.h>
+#include <mediaobject.h>
+#include <volumeslider.h>
+#include <backendcapabilities.h>
+#else
 #include <phonon/audiooutput.h>
 #include <phonon/seekslider.h>
 #include <phonon/mediaobject.h>
 #include <phonon/volumeslider.h>
 #include <phonon/backendcapabilities.h>
+#endif
 #include <QList>
 #include "playlistmanager.h"
 
index 61681a2..371af00 100644 (file)
@@ -9,7 +9,7 @@ QStringList allowedExtensions;
 PlaylistManager::PlaylistManager(QWidget* parent)
     : parentWidget (parent), lastMetaRead (-1)
 {
-    allowedExtensions << "mp3" << "ogg" << "wav" << "wmv" << "wma";
+    allowedExtensions << "mp3" << "ogg" << "wav" << "wmv" << "wma" << "flac";
 //    qDebug () << Phonon::BackendCapabilities::availableMimeTypes();
     metaInformationResolver = new Phonon::MediaObject(parent);
     connect(metaInformationResolver, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
@@ -312,7 +312,9 @@ void PlaylistManager::removeItem(int i)
 
 bool PlaylistManager::fileSupported (const QString& fname) const
 {
-    QString ext = fname.right(3).toLower();
+    if (fname.lastIndexOf('.') < 0)
+        return false;
+    QString ext = fname.right(fname.size() - fname.lastIndexOf('.') - 1).toLower();
     foreach (QString e, allowedExtensions)
     {
         if (ext == e)