summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/playlistwidget.cpp
authorkergoth <kergoth>2003-08-09 16:24:58 (UTC)
committer kergoth <kergoth>2003-08-09 16:24:58 (UTC)
commite16d333ec2e8509fc665921ca106c25325bae9e0 (patch) (side-by-side diff)
tree9e9068190a15bc9b2a52ab33b40881128f732c0e /noncore/multimedia/opieplayer2/playlistwidget.cpp
parent1c58d1407f9584fedcdae390a04e2b37e5853361 (diff)
downloadopie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip
opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz
opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 5f750ba..a1a1016 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -28,37 +28,26 @@
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-#include <qpe/qpetoolbar.h>
-#include <qpe/qpeapplication.h>
-#include <qpe/storage.h>
-#include <qpe/mimetype.h>
-#include <qpe/global.h>
-#include <qpe/resource.h>
-#include <qpe/config.h>
+#include <qtoolbar.h>
#include <opie/ofiledialog.h>
-#include <qdatetime.h>
-#include <qdir.h>
#include <qmessagebox.h>
-#include <qregexp.h>
-#include <qtextstream.h>
#include "playlistselection.h"
#include "playlistwidget.h"
#include "mediaplayerstate.h"
#include "inputDialog.h"
#include "om3u.h"
#include "playlistfileview.h"
//only needed for the random play
-#include <stdlib.h>
#include <assert.h>
PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name )
: PlayListWidgetGui( mediaPlayerState, parent, name ) , currentFileListView( 0 )
{
@@ -664,45 +653,47 @@ void PlayListWidget::openFile() {
Config cfg( "OpiePlayer" );
cfg.setGroup("Dialog");
MimeTypes types;
QStringList audio, video, all;
audio << "audio/*";
audio << "playlist/plain";
+ audio << "application/ogg";
audio << "audio/x-mpegurl";
video << "video/*";
video << "playlist/plain";
all += audio;
all += video;
types.insert("All Media Files", all );
types.insert("Audio", audio );
types.insert("Video", video );
QString str = OFileDialog::getOpenFileName( 1,
- cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"",
- types, 0 );
- if(str.left(2) == "//") str=str.right(str.length()-1);
- cfg.writeEntry("LastDirectory" ,QFileInfo(str).dirPath());
+ cfg.readEntry("LastDirectory",QPEApplication::documentDir()),"",
+ types, 0 );
+ if(str.left(2) == "//") {
+ str=str.right(str.length()-1);
+ }
+ cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() );
if( !str.isEmpty() ) {
+
qDebug( "Selected filename is " + str );
filename = str;
DocLnk lnk;
- Config cfg( "OpiePlayer" );
- cfg.setGroup("PlayList");
if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) {
readListFromFile( filename );
} else {
lnk.setName( QFileInfo(filename).baseName() ); //sets name
lnk.setFile( filename ); //sets file name
- d->selectedFiles->addToSelection( lnk);
+ d->selectedFiles->addToSelection( lnk );
writeCurrentM3u();
- d->selectedFiles->setSelectedItem( lnk.name());
+ d->selectedFiles->setSelectedItem( lnk.name() );
}
}
}
void PlayListWidget::readListFromFile( const QString &filename ) {