summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-02 15:00:35 (UTC)
committer simon <simon>2002-12-02 15:00:35 (UTC)
commit77147a2001cf991e3581bcb2401143e20a3973d4 (patch) (unidiff)
tree2f42819217f97431082a54459d6a7cfe76ea5702
parentf90e42128a496a0fb5a67c3148c30ef46092624b (diff)
downloadopie-77147a2001cf991e3581bcb2401143e20a3973d4.zip
opie-77147a2001cf991e3581bcb2401143e20a3973d4.tar.gz
opie-77147a2001cf991e3581bcb2401143e20a3973d4.tar.bz2
- simplified addSelected
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp58
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h2
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
@@ -534,45 +534,25 @@ void PlayListWidget::setPlaylist( bool shown ) {
534 534
535 535
536void PlayListWidget::addSelected() { 536void 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
@@ -799,6 +779,12 @@ QListView *PlayListWidget::currentFileListView() const
799 return 0; 779 return 0;
800} 780}
801 781
782bool PlayListWidget::inFileListMode() const
783{
784 TabType tab = currentTab();
785 return tab == AudioFiles || tab == VideoFiles;
786}
787
802void PlayListWidget::openFile() { 788void 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
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
@@ -92,6 +92,8 @@ private:
92 92
93 QListView *currentFileListView() const; 93 QListView *currentFileListView() const;
94 94
95 bool inFileListMode() const;
96
95private slots: 97private slots:
96 void populateSkinsMenu(); 98 void populateSkinsMenu();
97 void skinsMenuActivated(int); 99 void skinsMenuActivated(int);