summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-06-11 03:25:10 (UTC)
committer llornkcor <llornkcor>2003-06-11 03:25:10 (UTC)
commitbb6afc95ea64329f8fb9b7af8727b0c13747dde0 (patch) (unidiff)
treecd9285a4860ce024a2f126da4b843c18cdeb533b
parentd47a08d2f8944deb1ee0945075c3443de82442ea (diff)
downloadopie-bb6afc95ea64329f8fb9b7af8727b0c13747dde0.zip
opie-bb6afc95ea64329f8fb9b7af8727b0c13747dde0.tar.gz
opie-bb6afc95ea64329f8fb9b7af8727b0c13747dde0.tar.bz2
fix setDocument handling
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp39
-rw-r--r--core/multimedia/opieplayer/playlistwidget.h1
2 files changed, 26 insertions, 14 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index c6de5e6..5d0f6de 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -364,4 +364,5 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
364 364
365 initializeStates(); 365 initializeStates();
366 // audioUI->setFocus();
366} 367}
367 368
@@ -371,7 +372,7 @@ PlayListWidget::~PlayListWidget() {
371 writeConfig( cfg ); 372 writeConfig( cfg );
372 373
373 if ( d->current ) 374 if ( d->current )
374 delete d->current; 375 delete d->current;
375 delete d; 376 if(d) delete d;
376} 377}
377 378
@@ -495,6 +496,13 @@ void PlayListWidget::addAllVideoToList() {
495 496
496void PlayListWidget::setDocument(const QString& fileref) { 497void PlayListWidget::setDocument(const QString& fileref) {
497 qDebug(fileref); 498 fromSetDocument = true;
498 fromSetDocument = TRUE; 499 d->setDocumentUsed = TRUE;
500 mediaPlayerState->setPlaying( FALSE );
501 qApp->processEvents();
502 mediaPlayerState->setPlaying( TRUE );
503}
504
505void PlayListWidget::setDocumentEx(const QString& fileref) {
506
499 QFileInfo fileInfo(fileref); 507 QFileInfo fileInfo(fileref);
500 if ( !fileInfo.exists() ) { 508 if ( !fileInfo.exists() ) {
@@ -503,5 +511,5 @@ void PlayListWidget::setDocument(const QString& fileref) {
503 return; 511 return;
504 } 512 }
505// qDebug("setDocument "+fileref); 513 qDebug("setDocument "+fileref);
506 QString extension = fileInfo.extension(false); 514 QString extension = fileInfo.extension(false);
507 if( extension.find( "m3u", 0, false) != -1) { //is m3u 515 if( extension.find( "m3u", 0, false) != -1) { //is m3u
@@ -531,5 +539,5 @@ void PlayListWidget::setDocument(const QString& fileref) {
531 qApp->processEvents(); 539 qApp->processEvents();
532 mediaPlayerState->setPlaying( TRUE ); 540 mediaPlayerState->setPlaying( TRUE );
533 qApp->processEvents(); 541 // qApp->processEvents();
534 setCaption(tr("OpiePlayer")); 542 setCaption(tr("OpiePlayer"));
535 } 543 }
@@ -760,5 +768,5 @@ void PlayListWidget::playIt( QListViewItem *) {
760// mediaPlayerState->curPosition =0; 768// mediaPlayerState->curPosition =0;
761 qDebug("playIt"); 769 qDebug("playIt");
762 mediaPlayerState->setPlaying(FALSE); 770 // mediaPlayerState->setPlaying(FALSE);
763 mediaPlayerState->setPlaying(TRUE); 771 mediaPlayerState->setPlaying(TRUE);
764 d->selectedFiles->unSelect(); 772 d->selectedFiles->unSelect();
@@ -783,5 +791,6 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
783 d->selectedFiles->addToSelection( lnk); 791 d->selectedFiles->addToSelection( lnk);
784 792
785 writeCurrentM3u(); 793 if(tabWidget->currentPageIndex() == 0)
794 writeCurrentM3u();
786// tabWidget->setCurrentPage(0); 795// tabWidget->setCurrentPage(0);
787 796
@@ -832,5 +841,5 @@ void PlayListWidget::tabChanged(QWidget *) {
832 841
833void PlayListWidget::btnPlay(bool b) { 842void PlayListWidget::btnPlay(bool b) {
834 qDebug("<<<<<<<<<<<<<<<BtnPlay"); 843 qDebug("<<<<<<<<<<<<<<<BtnPlay %d", b);
835// mediaPlayerState->setPlaying(b); 844// mediaPlayerState->setPlaying(b);
836 switch ( tabWidget->currentPageIndex()) { 845 switch ( tabWidget->currentPageIndex()) {
@@ -853,5 +862,5 @@ void PlayListWidget::btnPlay(bool b) {
853// d->selectedFiles->unSelect(); 862// d->selectedFiles->unSelect();
854 addToSelection( audioView->currentItem() ); 863 addToSelection( audioView->currentItem() );
855 mediaPlayerState->setPlaying(true); 864 mediaPlayerState->setPlaying( b);
856 d->selectedFiles->removeSelected( ); 865 d->selectedFiles->removeSelected( );
857 d->selectedFiles->unSelect(); 866 d->selectedFiles->unSelect();
@@ -865,5 +874,5 @@ void PlayListWidget::btnPlay(bool b) {
865 874
866 addToSelection( videoView->currentItem() ); 875 addToSelection( videoView->currentItem() );
867 mediaPlayerState->setPlaying(true); 876 mediaPlayerState->setPlaying( b);
868// qApp->processEvents(); 877// qApp->processEvents();
869 d->selectedFiles->removeSelected( ); 878 d->selectedFiles->removeSelected( );
@@ -1460,5 +1469,5 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
1460 } else if ( msg == "togglePause()" ) { 1469 } else if ( msg == "togglePause()" ) {
1461 mediaPlayerState->togglePaused(); 1470 mediaPlayerState->togglePaused();
1462 } else if ( msg == "next()" ) { //select next in list 1471 } else if ( msg == "next()" ) { //select next in lis
1463 mediaPlayerState->setNext(); 1472 mediaPlayerState->setNext();
1464 } else if ( msg == "prev()" ) { //select previous in list 1473 } else if ( msg == "prev()" ) { //select previous in list
@@ -1477,5 +1486,5 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
1477 QString file; 1486 QString file;
1478 stream >> file; 1487 stream >> file;
1479 setDocument( (const QString &) file); 1488 setDocumentEx( (const QString &) file);
1480 } else if ( msg == "add(QString)" ) { //add to playlist 1489 } else if ( msg == "add(QString)" ) { //add to playlist
1481 QString file; 1490 QString file;
@@ -1490,4 +1499,6 @@ void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
1490 stream >> file; 1499 stream >> file;
1491 1500
1501 } else if ( msg == "setDocument(QString)" ) { //loop or not loop
1502 QCopEnvelope h("QPE/Application/opieplayer", "raise()");
1492 } 1503 }
1493 1504
diff --git a/core/multimedia/opieplayer/playlistwidget.h b/core/multimedia/opieplayer/playlistwidget.h
index e66bcb9..0c0e367 100644
--- a/core/multimedia/opieplayer/playlistwidget.h
+++ b/core/multimedia/opieplayer/playlistwidget.h
@@ -103,4 +103,5 @@ private slots:
103 void openFile(); 103 void openFile();
104 void setDocument( const QString& fileref ); 104 void setDocument( const QString& fileref );
105 void setDocumentEx( const QString& fileref );
105 void addToSelection( const DocLnk& ); // Add a media file to the playlist 106 void addToSelection( const DocLnk& ); // Add a media file to the playlist
106 void addToSelection( QListViewItem* ); // Add a media file to the playlist 107 void addToSelection( QListViewItem* ); // Add a media file to the playlist