author | llornkcor <llornkcor> | 2002-11-10 17:11:25 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-10 17:11:25 (UTC) |
commit | 8b6c9588bc499d1c37a0ecf65f59de129b3924e3 (patch) (unidiff) | |
tree | 147dfeb0a09120d8e631ce6e11e0281a18d5c422 | |
parent | 8394ee8e5fc0014605256b243909709864afdc9b (diff) | |
download | opie-8b6c9588bc499d1c37a0ecf65f59de129b3924e3.zip opie-8b6c9588bc499d1c37a0ecf65f59de129b3924e3.tar.gz opie-8b6c9588bc499d1c37a0ecf65f59de129b3924e3.tar.bz2 |
should be selected after adding file
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 0825eed..60eb0c8 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -515,10 +515,13 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
515 | case 1: { | 515 | case 1: { |
516 | QListIterator<DocLnk> dit( files.children() ); | 516 | QListIterator<DocLnk> dit( files.children() ); |
517 | for ( ; dit.current(); ++dit ) { | 517 | for ( ; dit.current(); ++dit ) { |
518 | if( dit.current()->name() == it->text(0)) { | 518 | if( dit.current()->name() == it->text(0)) { |
519 | if(QFileInfo( dit.current()->file()).exists()) | 519 | if(QFileInfo( dit.current()->file()).exists()) { |
520 | d->selectedFiles->addToSelection( **dit ); | 520 | d->selectedFiles->addToSelection( **dit ); |
521 | qDebug("blah "+ dit.current()->name()); | ||
522 | d->selectedFiles->setSelectedItem( dit.current()->name()); | ||
523 | } | ||
521 | } | 524 | } |
522 | } | 525 | } |
523 | writeCurrentM3u(); | 526 | writeCurrentM3u(); |
524 | } | 527 | } |
@@ -526,10 +529,13 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
526 | case 2: { | 529 | case 2: { |
527 | QListIterator<DocLnk> dit( vFiles.children() ); | 530 | QListIterator<DocLnk> dit( vFiles.children() ); |
528 | for ( ; dit.current(); ++dit ) { | 531 | for ( ; dit.current(); ++dit ) { |
529 | if( dit.current()->name() == it->text(0)) { | 532 | if( dit.current()->name() == it->text(0)) { |
530 | if( QFileInfo( dit.current()->file()).exists() ) | 533 | if( QFileInfo( dit.current()->file()).exists() ) { |
531 | d->selectedFiles->addToSelection( **dit ); | 534 | d->selectedFiles->addToSelection( **dit ); |
535 | qDebug("blah "+ dit.current()->name()); | ||
536 | d->selectedFiles->setSelectedItem( dit.current()->name()); | ||
537 | } | ||
532 | } | 538 | } |
533 | } | 539 | } |
534 | writeCurrentM3u(); | 540 | writeCurrentM3u(); |
535 | 541 | ||
@@ -538,8 +544,9 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
538 | case 0: | 544 | case 0: |
539 | break; | 545 | break; |
540 | }; | 546 | }; |
541 | tabWidget->setCurrentPage(0); | 547 | tabWidget->setCurrentPage(0); |
548 | |||
542 | } | 549 | } |
543 | } | 550 | } |
544 | 551 | ||
545 | 552 | ||
@@ -744,8 +751,9 @@ void PlayListWidget::openFile() { | |||
744 | // lnk.setIcon("opieplayer2/musicfile"); | 751 | // lnk.setIcon("opieplayer2/musicfile"); |
745 | 752 | ||
746 | d->selectedFiles->addToSelection( lnk ); | 753 | d->selectedFiles->addToSelection( lnk ); |
747 | writeCurrentM3u(); | 754 | writeCurrentM3u(); |
755 | d->selectedFiles->setSelectedItem( lnk->name()); | ||
748 | } | 756 | } |
749 | else if( filename.right( 3) == "m3u" ) { | 757 | else if( filename.right( 3) == "m3u" ) { |
750 | readm3u( filename ); | 758 | readm3u( filename ); |
751 | 759 | ||
@@ -755,8 +763,9 @@ void PlayListWidget::openFile() { | |||
755 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 763 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
756 | lnk.setFile( filename ); //sets file name | 764 | lnk.setFile( filename ); //sets file name |
757 | d->selectedFiles->addToSelection( lnk); | 765 | d->selectedFiles->addToSelection( lnk); |
758 | writeCurrentM3u(); | 766 | writeCurrentM3u(); |
767 | d->selectedFiles->setSelectedItem( lnk.name()); | ||
759 | } | 768 | } |
760 | } | 769 | } |
761 | 770 | ||
762 | if( fileDlg ) { | 771 | if( fileDlg ) { |
@@ -885,8 +894,9 @@ void PlayListWidget::writeCurrentM3u() { | |||
885 | m3uList->close(); | 894 | m3uList->close(); |
886 | 895 | ||
887 | if(m3uList) delete m3uList; | 896 | if(m3uList) delete m3uList; |
888 | } | 897 | } |
898 | |||
889 | } | 899 | } |
890 | 900 | ||
891 | /* | 901 | /* |
892 | writes current playlist to m3u file */ | 902 | writes current playlist to m3u file */ |