author | zecke <zecke> | 2005-05-12 21:21:14 (UTC) |
---|---|---|
committer | zecke <zecke> | 2005-05-12 21:21:14 (UTC) |
commit | ed2d14794cee66441f06be923623694f4ad2e06b (patch) (unidiff) | |
tree | 92a30a25343f9aa97285ed4f8d95209923ab1c0d | |
parent | 9d1113376da0ba95a5b4121bd953756311ac5a97 (diff) | |
download | opie-ed2d14794cee66441f06be923623694f4ad2e06b.zip opie-ed2d14794cee66441f06be923623694f4ad2e06b.tar.gz opie-ed2d14794cee66441f06be923623694f4ad2e06b.tar.bz2 |
Fix for #1657 to show the play button when we've playable files
patch courtsey Gints Polis
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 83eb83b..98326a8 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -753,32 +753,38 @@ void PlayListWidget::openDirectory() { | |||
753 | if(str.isEmpty() ) | 753 | if(str.isEmpty() ) |
754 | return; | 754 | return; |
755 | 755 | ||
756 | if(str.left(2) == "//") str=str.right(str.length()-1); | 756 | if(str.left(2) == "//") str=str.right(str.length()-1); |
757 | QDir dir( str ); | 757 | QDir dir( str ); |
758 | QStringList lst = dir.entryList(QDir::Files|QDir::Readable); | 758 | QStringList lst = dir.entryList(QDir::Files|QDir::Readable); |
759 | 759 | ||
760 | for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { | 760 | for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { |
761 | QString filename = str + "/" + *it; | 761 | QString filename = str + "/" + *it; |
762 | 762 | ||
763 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) | 763 | if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) |
764 | readListFromFile( filename ); | 764 | readListFromFile( filename ); |
765 | else { | 765 | else { |
766 | addFileToPlaylist( filename, QFileInfo(*it).baseName() ); | 766 | addFileToPlaylist( filename, QFileInfo(*it).baseName() ); |
767 | } | 767 | } |
768 | } | 768 | } |
769 | |||
770 | if (!d->selectedFiles->isEmpty()) { | ||
771 | d->selectedFiles->first(); | ||
772 | |||
773 | setButtons(); | ||
774 | } | ||
769 | } | 775 | } |
770 | 776 | ||
771 | void PlayListWidget::readListFromFile( const QString &filename ) { | 777 | void PlayListWidget::readListFromFile( const QString &filename ) { |
772 | odebug << "read list filename " + filename << oendl; | 778 | odebug << "read list filename " + filename << oendl; |
773 | QFileInfo fi(filename); | 779 | QFileInfo fi(filename); |
774 | Om3u *m3uList; | 780 | Om3u *m3uList; |
775 | QString s, name; | 781 | QString s, name; |
776 | m3uList = new Om3u( filename, IO_ReadOnly ); | 782 | m3uList = new Om3u( filename, IO_ReadOnly ); |
777 | if(fi.extension(false).find("m3u",0,false) != -1 ) | 783 | if(fi.extension(false).find("m3u",0,false) != -1 ) |
778 | m3uList->readM3u(); | 784 | m3uList->readM3u(); |
779 | else if(fi.extension(false).find("pls",0,false) != -1 ) | 785 | else if(fi.extension(false).find("pls",0,false) != -1 ) |
780 | m3uList->readPls(); | 786 | m3uList->readPls(); |
781 | 787 | ||
782 | DocLnk lnk; | 788 | DocLnk lnk; |
783 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 789 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
784 | s = *it; | 790 | s = *it; |