From 0dc07e4a7de165ca4393a49acb39427b327c8736 Mon Sep 17 00:00:00 2001 From: tmarki Date: Thu, 19 Aug 2010 17:58:06 +0200 Subject: [PATCH] better extensioncheck --- tomamp/mainwindow.cpp | 3 ++- tomamp/mainwindow.h | 8 ++++++++ tomamp/playlistmanager.cpp | 6 ++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tomamp/mainwindow.cpp b/tomamp/mainwindow.cpp index 349cce5..b7b6c9f 100644 --- a/tomamp/mainwindow.cpp +++ b/tomamp/mainwindow.cpp @@ -132,7 +132,8 @@ void MainWindow::about() tr("TomAmp is a simple playlist-based music player.\n\n" "(c) 2010 Tamas Marki \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 */) diff --git a/tomamp/mainwindow.h b/tomamp/mainwindow.h index 59e247e..b9c1f11 100644 --- a/tomamp/mainwindow.h +++ b/tomamp/mainwindow.h @@ -44,11 +44,19 @@ #include #include +#if QT_VERSION < 0x040600 +#include +#include +#include +#include +#include +#else #include #include #include #include #include +#endif #include #include "playlistmanager.h" diff --git a/tomamp/playlistmanager.cpp b/tomamp/playlistmanager.cpp index 61681a2..371af00 100644 --- a/tomamp/playlistmanager.cpp +++ b/tomamp/playlistmanager.cpp @@ -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) -- 1.7.9.5