author | llornkcor <llornkcor> | 2003-06-11 03:38:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-06-11 03:38:10 (UTC) |
commit | 22be97432c25bad67b4fb241977670657facb3af (patch) (unidiff) | |
tree | 19826054782bdf38590af084c29e77f2314daed6 /core/multimedia/opieplayer/playlistwidget.cpp | |
parent | bb6afc95ea64329f8fb9b7af8727b0c13747dde0 (diff) | |
download | opie-22be97432c25bad67b4fb241977670657facb3af.zip opie-22be97432c25bad67b4fb241977670657facb3af.tar.gz opie-22be97432c25bad67b4fb241977670657facb3af.tar.bz2 |
fix setDocument for lists
Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 5d0f6de..7ea95ab 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -452,96 +452,97 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { | |||
452 | 452 | ||
453 | void PlayListWidget::clearList() { | 453 | void PlayListWidget::clearList() { |
454 | while ( first() ) | 454 | while ( first() ) |
455 | d->selectedFiles->removeSelected(); | 455 | d->selectedFiles->removeSelected(); |
456 | } | 456 | } |
457 | 457 | ||
458 | 458 | ||
459 | void PlayListWidget::addAllToList() { | 459 | void PlayListWidget::addAllToList() { |
460 | DocLnkSet filesAll; | 460 | DocLnkSet filesAll; |
461 | Global::findDocuments(&filesAll, "video/*;audio/*"); | 461 | Global::findDocuments(&filesAll, "video/*;audio/*"); |
462 | QListIterator<DocLnk> Adit( filesAll.children() ); | 462 | QListIterator<DocLnk> Adit( filesAll.children() ); |
463 | for ( ; Adit.current(); ++Adit ) | 463 | for ( ; Adit.current(); ++Adit ) |
464 | if(QFileInfo(Adit.current()->file()).exists()) | 464 | if(QFileInfo(Adit.current()->file()).exists()) |
465 | d->selectedFiles->addToSelection( **Adit ); | 465 | d->selectedFiles->addToSelection( **Adit ); |
466 | tabWidget->setCurrentPage(0); | 466 | tabWidget->setCurrentPage(0); |
467 | 467 | ||
468 | writeCurrentM3u(); | 468 | writeCurrentM3u(); |
469 | d->selectedFiles->first(); | 469 | d->selectedFiles->first(); |
470 | } | 470 | } |
471 | 471 | ||
472 | 472 | ||
473 | void PlayListWidget::addAllMusicToList() { | 473 | void PlayListWidget::addAllMusicToList() { |
474 | QListIterator<DocLnk> dit( files.children() ); | 474 | QListIterator<DocLnk> dit( files.children() ); |
475 | for ( ; dit.current(); ++dit ) | 475 | for ( ; dit.current(); ++dit ) |
476 | if(QFileInfo(dit.current()->file()).exists()) | 476 | if(QFileInfo(dit.current()->file()).exists()) |
477 | d->selectedFiles->addToSelection( **dit ); | 477 | d->selectedFiles->addToSelection( **dit ); |
478 | tabWidget->setCurrentPage(0); | 478 | tabWidget->setCurrentPage(0); |
479 | 479 | ||
480 | writeCurrentM3u(); | 480 | writeCurrentM3u(); |
481 | d->selectedFiles->first(); | 481 | d->selectedFiles->first(); |
482 | } | 482 | } |
483 | 483 | ||
484 | 484 | ||
485 | void PlayListWidget::addAllVideoToList() { | 485 | void PlayListWidget::addAllVideoToList() { |
486 | QListIterator<DocLnk> dit( vFiles.children() ); | 486 | QListIterator<DocLnk> dit( vFiles.children() ); |
487 | for ( ; dit.current(); ++dit ) | 487 | for ( ; dit.current(); ++dit ) |
488 | if(QFileInfo( dit.current()->file()).exists()) | 488 | if(QFileInfo( dit.current()->file()).exists()) |
489 | d->selectedFiles->addToSelection( **dit ); | 489 | d->selectedFiles->addToSelection( **dit ); |
490 | tabWidget->setCurrentPage(0); | 490 | tabWidget->setCurrentPage(0); |
491 | 491 | ||
492 | writeCurrentM3u(); | 492 | writeCurrentM3u(); |
493 | d->selectedFiles->first(); | 493 | d->selectedFiles->first(); |
494 | } | 494 | } |
495 | 495 | ||
496 | 496 | ||
497 | void PlayListWidget::setDocument(const QString& fileref) { | 497 | void PlayListWidget::setDocument(const QString& fileref) { |
498 | fromSetDocument = true; | 498 | fromSetDocument = true; |
499 | d->setDocumentUsed = TRUE; | 499 | d->setDocumentUsed = TRUE; |
500 | d->selectedFiles->setSelected(d->selectedFiles->firstChild(),true ); | ||
500 | mediaPlayerState->setPlaying( FALSE ); | 501 | mediaPlayerState->setPlaying( FALSE ); |
501 | qApp->processEvents(); | 502 | qApp->processEvents(); |
502 | mediaPlayerState->setPlaying( TRUE ); | 503 | mediaPlayerState->setPlaying( TRUE ); |
503 | } | 504 | } |
504 | 505 | ||
505 | void PlayListWidget::setDocumentEx(const QString& fileref) { | 506 | void PlayListWidget::setDocumentEx(const QString& fileref) { |
506 | 507 | ||
507 | QFileInfo fileInfo(fileref); | 508 | QFileInfo fileInfo(fileref); |
508 | if ( !fileInfo.exists() ) { | 509 | if ( !fileInfo.exists() ) { |
509 | QMessageBox::critical( 0, tr( "Invalid File" ), | 510 | QMessageBox::critical( 0, tr( "Invalid File" ), |
510 | tr( "There was a problem in getting the file." ) ); | 511 | tr( "There was a problem in getting the file." ) ); |
511 | return; | 512 | return; |
512 | } | 513 | } |
513 | qDebug("setDocument "+fileref); | 514 | qDebug("setDocument "+fileref); |
514 | QString extension = fileInfo.extension(false); | 515 | QString extension = fileInfo.extension(false); |
515 | if( extension.find( "m3u", 0, false) != -1) { //is m3u | 516 | if( extension.find( "m3u", 0, false) != -1) { //is m3u |
516 | readm3u( fileref); | 517 | readm3u( fileref); |
517 | } | 518 | } |
518 | else if( extension.find( "pls", 0, false) != -1 ) { //is pls | 519 | else if( extension.find( "pls", 0, false) != -1 ) { //is pls |
519 | readPls( fileref); | 520 | readPls( fileref); |
520 | } | 521 | } |
521 | else if( fileref.find("playlist",0,TRUE) != -1) {//is playlist | 522 | else if( fileref.find("playlist",0,TRUE) != -1) {//is playlist |
522 | clearList(); | 523 | clearList(); |
523 | DocLnk lnk; | 524 | DocLnk lnk; |
524 | lnk.setName( fileInfo.baseName() ); //sets name | 525 | lnk.setName( fileInfo.baseName() ); //sets name |
525 | lnk.setFile( fileref ); //sets file name | 526 | lnk.setFile( fileref ); //sets file name |
526 | //addToSelection( lnk ); | 527 | //addToSelection( lnk ); |
527 | 528 | ||
528 | loadList( lnk); | 529 | loadList( lnk); |
529 | d->selectedFiles->first(); | 530 | d->selectedFiles->first(); |
530 | } else { | 531 | } else { |
531 | clearList(); | 532 | clearList(); |
532 | DocLnk lnk; | 533 | DocLnk lnk; |
533 | lnk.setName( fileInfo.baseName() ); //sets name | 534 | lnk.setName( fileInfo.baseName() ); //sets name |
534 | lnk.setFile( fileref ); //sets file name | 535 | lnk.setFile( fileref ); //sets file name |
535 | addToSelection( lnk ); | 536 | addToSelection( lnk ); |
536 | // addToSelection( DocLnk( fileref ) ); | 537 | // addToSelection( DocLnk( fileref ) ); |
537 | d->setDocumentUsed = TRUE; | 538 | d->setDocumentUsed = TRUE; |
538 | mediaPlayerState->setPlaying( FALSE ); | 539 | mediaPlayerState->setPlaying( FALSE ); |
539 | qApp->processEvents(); | 540 | qApp->processEvents(); |
540 | mediaPlayerState->setPlaying( TRUE ); | 541 | mediaPlayerState->setPlaying( TRUE ); |
541 | // qApp->processEvents(); | 542 | // qApp->processEvents(); |
542 | setCaption(tr("OpiePlayer")); | 543 | setCaption(tr("OpiePlayer")); |
543 | } | 544 | } |
544 | } | 545 | } |
545 | 546 | ||
546 | 547 | ||
547 | void PlayListWidget::setActiveWindow() { | 548 | void PlayListWidget::setActiveWindow() { |