-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 58 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 2 |
2 files changed, 24 insertions, 36 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 92da73b..c9ae225 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -533,47 +533,27 @@ void PlayListWidget::setPlaylist( bool shown ) { | |||
533 | } | 533 | } |
534 | 534 | ||
535 | 535 | ||
536 | void PlayListWidget::addSelected() { | 536 | void PlayListWidget::addSelected() { |
537 | qDebug("addSelected"); | 537 | assert( inFileListMode() ); |
538 | DocLnk lnk; | ||
539 | QString filename; | ||
540 | switch (whichList()) { | ||
541 | 538 | ||
542 | case 0: //playlist | 539 | QListView *fileListView = currentFileListView(); |
543 | return; | 540 | QListViewItemIterator it( fileListView ); |
544 | break; | 541 | for ( ; it.current(); ++it ) |
545 | case 1: { //audio | ||
546 | QListViewItemIterator it( audioView ); | ||
547 | for ( ; it.current(); ++it ) { | ||
548 | if ( it.current()->isSelected() ) { | 542 | if ( it.current()->isSelected() ) { |
549 | filename=it.current()->text(3); | 543 | QString filename = it.current()->text(3); |
550 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 544 | |
551 | lnk.setFile( filename ); //sets file name | 545 | DocLnk lnk; |
552 | d->selectedFiles->addToSelection( lnk); | 546 | lnk.setName( QFileInfo( filename ).baseName() ); //sets name |
553 | 547 | lnk.setFile( filename ); //sets file name | |
554 | } | 548 | |
555 | } | 549 | d->selectedFiles->addToSelection( lnk ); |
556 | audioView->clearSelection(); | ||
557 | } | ||
558 | break; | ||
559 | |||
560 | case 2: { // video | ||
561 | QListViewItemIterator it( videoView ); | ||
562 | for ( ; it.current(); ++it ) { | ||
563 | if ( it.current()->isSelected() ) { | ||
564 | filename=it.current()->text(3); | ||
565 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | ||
566 | lnk.setFile( filename ); //sets file name | ||
567 | d->selectedFiles->addToSelection( lnk); | ||
568 | } | 550 | } |
569 | } | 551 | |
570 | videoView->clearSelection(); | 552 | fileListView->clearSelection(); |
571 | } | 553 | |
572 | break; | 554 | tabWidget->setCurrentPage( 0 ); |
573 | }; | 555 | writeCurrentM3u(); |
574 | tabWidget->setCurrentPage(0); | ||
575 | writeCurrentM3u(); | ||
576 | } | 556 | } |
577 | 557 | ||
578 | 558 | ||
579 | void PlayListWidget::removeSelected() { | 559 | void PlayListWidget::removeSelected() { |
@@ -798,8 +778,14 @@ QListView *PlayListWidget::currentFileListView() const | |||
798 | } | 778 | } |
799 | return 0; | 779 | return 0; |
800 | } | 780 | } |
801 | 781 | ||
782 | bool PlayListWidget::inFileListMode() const | ||
783 | { | ||
784 | TabType tab = currentTab(); | ||
785 | return tab == AudioFiles || tab == VideoFiles; | ||
786 | } | ||
787 | |||
802 | void PlayListWidget::openFile() { | 788 | void PlayListWidget::openFile() { |
803 | // http://66.28.164.33:2080 | 789 | // http://66.28.164.33:2080 |
804 | // http://somafm.com/star0242.m3u | 790 | // http://somafm.com/star0242.m3u |
805 | QString filename, name; | 791 | QString filename, name; |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index a608eae..238a75c 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h | |||
@@ -91,8 +91,10 @@ private: | |||
91 | void populateVideoView(); | 91 | void populateVideoView(); |
92 | 92 | ||
93 | QListView *currentFileListView() const; | 93 | QListView *currentFileListView() const; |
94 | 94 | ||
95 | bool inFileListMode() const; | ||
96 | |||
95 | private slots: | 97 | private slots: |
96 | void populateSkinsMenu(); | 98 | void populateSkinsMenu(); |
97 | void skinsMenuActivated(int); | 99 | void skinsMenuActivated(int); |
98 | void pmViewActivated(int); | 100 | void pmViewActivated(int); |