summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/playlistwidget.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index a6202bc..3171a84 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -415,19 +415,27 @@ void PlayListWidget::addAllVideoToList() {
void PlayListWidget::setDocument(const QString& fileref) {
if ( fileref.isNull() ) {
QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) );
return;
}
+ if(fileref.find("playlist",0,TRUE) == -1) {
addToSelection( DocLnk( fileref ) );
d->setDocumentUsed = TRUE;
qApp->processEvents();
mediaPlayerState->setPlaying( FALSE );
qApp->processEvents();
mediaPlayerState->setPlaying( TRUE );
d->selectedFiles->removeSelected( );
+ } else {
+ loadList(DocLnk(fileref));
+ d->selectedFiles->first();
+// mediaPlayerState->setPlaying( TRUE );
+// mediaPlayerState->setPlaying( FALSE );
+
+ }
}
void PlayListWidget::setActiveWindow() {
// When we get raised we need to ensure that it switches views
char origView = mediaPlayerState->view();
@@ -526,36 +534,27 @@ void PlayListWidget::saveList() {
InputDialog *fileDlg;
fileDlg=new InputDialog(this,"Save Playlist",TRUE, 0);
fileDlg->exec();
if( fileDlg->result() == 1 ) {
filename = fileDlg->LineEdit1->text();//+".playlist";
qDebug("saving playlist "+filename+".playlist");
-
-// DocLnk *lnk;
-// lnk.setName( filename); //sets file name
-// // lnk.setComment(title);
-// lnk.setFile( filename+".playlist"); //sets File property
-// lnk.setType("player/plain");// hey is this a REGISTERED mime type?!?!? ;D
-// lnk.setIcon("MPEGPlayer");
-// if(!lnk.writeLink())
-// qDebug("Writing doclink did not work");
-
Config cfg( filename +".playlist");
writeConfig( cfg );
- }
DocLnk lnk;
lnk.setName( filename); //sets file name
-// lnk.setComment(title);
+// lnk.setComment( "");
lnk.setFile(QPEApplication::qpeDir()+"Settings/"+filename+".playlist.conf"); //sets File property
lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D
- lnk.setIcon("MPEGPlayer");
+ lnk.setIcon("mpegplayer/playlist2");
if(!lnk.writeLink())
qDebug("Writing doclink did not work");
+ }
if(fileDlg)
delete fileDlg;
+
}
void PlayListWidget::loadList( const DocLnk & lnk) {
qDebug("load list "+ lnk.name()+".playlist");
clearList();