summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 2b58402..20adf17 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -309,49 +309,49 @@ void PlayListWidget::setDocument( const QString& fileref ) {
309 mediaPlayerState->setPlaying( FALSE ); 309 mediaPlayerState->setPlaying( FALSE );
310 qApp->processEvents(); 310 qApp->processEvents();
311 mediaPlayerState->setPlaying( TRUE ); 311 mediaPlayerState->setPlaying( TRUE );
312 qApp->processEvents(); 312 qApp->processEvents();
313 setCaption( tr("OpiePlayer") ); 313 setCaption( tr("OpiePlayer") );
314 } 314 }
315} 315}
316 316
317 317
318void PlayListWidget::useSelectedDocument() { 318void PlayListWidget::useSelectedDocument() {
319 d->setDocumentUsed = FALSE; 319 d->setDocumentUsed = FALSE;
320} 320}
321 321
322 322
323const DocLnk *PlayListWidget::current() { // this is fugly 323const DocLnk *PlayListWidget::current() { // this is fugly
324 switch ( whichList() ) { 324 switch ( whichList() ) {
325 case 0: //playlist 325 case 0: //playlist
326 { 326 {
327// qDebug("playlist"); 327// qDebug("playlist");
328 if ( mediaPlayerState->playlist() ) { 328 if ( mediaPlayerState->playlist() ) {
329 return d->selectedFiles->current(); 329 return d->selectedFiles->current();
330 } else if ( d->setDocumentUsed && d->current ) { 330 } else if ( d->setDocumentUsed && d->current ) {
331 return d->current; 331 return d->current;
332 } else { 332 } else {
333 return d->files->selected(); 333 return &(d->files->selectedDocument());
334 } 334 }
335 } 335 }
336 break; 336 break;
337 }; 337 };
338 return 0; 338 return 0;
339} 339}
340 340
341 341
342bool PlayListWidget::prev() { 342bool PlayListWidget::prev() {
343 if ( mediaPlayerState->playlist() ) { 343 if ( mediaPlayerState->playlist() ) {
344 if ( mediaPlayerState->shuffled() ) { 344 if ( mediaPlayerState->shuffled() ) {
345 const DocLnk *cur = current(); 345 const DocLnk *cur = current();
346 int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0)); 346 int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0));
347 for ( int i = 0; i < j; i++ ) { 347 for ( int i = 0; i < j; i++ ) {
348 if ( !d->selectedFiles->next() ) 348 if ( !d->selectedFiles->next() )
349 d->selectedFiles->first(); 349 d->selectedFiles->first();
350 } 350 }
351 if ( cur == current() ) 351 if ( cur == current() )
352 if ( !d->selectedFiles->next() ) { 352 if ( !d->selectedFiles->next() ) {
353 d->selectedFiles->first(); 353 d->selectedFiles->first();
354 } 354 }
355 return TRUE; 355 return TRUE;
356 } else { 356 } else {
357 if ( !d->selectedFiles->prev() ) { 357 if ( !d->selectedFiles->prev() ) {
@@ -627,50 +627,50 @@ void PlayListWidget::btnPlay(bool b) {
627// qApp->processEvents(); 627// qApp->processEvents();
628// insanityBool=FALSE; 628// insanityBool=FALSE;
629// }// audioView->clearSelection(); 629// }// audioView->clearSelection();
630// break; 630// break;
631// case 2: 631// case 2:
632// { 632// {
633// // addToSelection( videoView->currentItem() ); 633// // addToSelection( videoView->currentItem() );
634// mediaPlayerState->setPlaying(b); 634// mediaPlayerState->setPlaying(b);
635// qApp->processEvents(); 635// qApp->processEvents();
636// // d->selectedFiles->removeSelected( ); 636// // d->selectedFiles->removeSelected( );
637// // tabWidget->setCurrentPage(2); 637// // tabWidget->setCurrentPage(2);
638// // d->selectedFiles->unSelect(); 638// // d->selectedFiles->unSelect();
639// insanityBool=FALSE; 639// insanityBool=FALSE;
640// }// videoView->clearSelection(); 640// }// videoView->clearSelection();
641// break; 641// break;
642// }; 642// };
643 643
644} 644}
645 645
646void PlayListWidget::deletePlaylist() { 646void PlayListWidget::deletePlaylist() {
647 switch( QMessageBox::information( this, (tr("Remove Playlist?")), 647 switch( QMessageBox::information( this, (tr("Remove Playlist?")),
648 (tr("You really want to delete\nthis playlist?")), 648 (tr("You really want to delete\nthis playlist?")),
649 (tr("Yes")), (tr("No")), 0 )){ 649 (tr("Yes")), (tr("No")), 0 )){
650 case 0: // Yes clicked, 650 case 0: // Yes clicked,
651 QFile().remove(playLists->selected()->file()); 651 QFile().remove(playLists->selectedDocument().file());
652 QFile().remove(playLists->selected()->linkFile()); 652 QFile().remove(playLists->selectedDocument().linkFile());
653 playLists->reread(); 653 playLists->reread();
654 break; 654 break;
655 case 1: // Cancel 655 case 1: // Cancel
656 break; 656 break;
657 }; 657 };
658} 658}
659 659
660 660
661void PlayListWidget::playSelected() { 661void PlayListWidget::playSelected() {
662 btnPlay( TRUE); 662 btnPlay( TRUE);
663} 663}
664 664
665 665
666void PlayListWidget::scanForAudio() { 666void PlayListWidget::scanForAudio() {
667// qDebug("scan for audio"); 667// qDebug("scan for audio");
668 files.detachChildren(); 668 files.detachChildren();
669 QListIterator<DocLnk> sdit( files.children() ); 669 QListIterator<DocLnk> sdit( files.children() );
670 for ( ; sdit.current(); ++sdit ) { 670 for ( ; sdit.current(); ++sdit ) {
671 delete sdit.current(); 671 delete sdit.current();
672 } 672 }
673 Global::findDocuments(&files, "audio/*"); 673 Global::findDocuments(&files, "audio/*");
674 audioScan = TRUE; 674 audioScan = TRUE;
675} 675}
676 676
@@ -1027,33 +1027,33 @@ void PlayListWidget::populateSkinsMenu() {
1027 if( skinName == skin ) { 1027 if( skinName == skin ) {
1028 skinsMenu->setItemChecked( item, TRUE ); 1028 skinsMenu->setItemChecked( item, TRUE );
1029 } 1029 }
1030 ++it; 1030 ++it;
1031 } 1031 }
1032} 1032}
1033 1033
1034void PlayListWidget::skinsMenuActivated( int item ) { 1034void PlayListWidget::skinsMenuActivated( int item ) {
1035 for( int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { 1035 for( int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) {
1036 skinsMenu->setItemChecked( i, FALSE ); 1036 skinsMenu->setItemChecked( i, FALSE );
1037 } 1037 }
1038 skinsMenu->setItemChecked( item, TRUE ); 1038 skinsMenu->setItemChecked( item, TRUE );
1039 1039
1040 Config cfg( "OpiePlayer" ); 1040 Config cfg( "OpiePlayer" );
1041 cfg.setGroup("Options"); 1041 cfg.setGroup("Options");
1042 cfg.writeEntry("Skin", skinsMenu->text( item ) ); 1042 cfg.writeEntry("Skin", skinsMenu->text( item ) );
1043} 1043}
1044 1044
1045int PlayListWidget::whichList() { 1045int PlayListWidget::whichList() {
1046 return tabWidget->currentPageIndex(); 1046 return tabWidget->currentPageIndex();
1047} 1047}
1048 1048
1049QString PlayListWidget::currentFileListPathName() { 1049QString PlayListWidget::currentFileListPathName() {
1050 switch (whichList()) { 1050 switch (whichList()) {
1051 case 1: 1051 case 1:
1052 return audioView->currentItem()->text(3); 1052 return audioView->currentItem()->text(3);
1053 break; 1053 break;
1054 case 2: 1054 case 2:
1055 return videoView->currentItem()->text(3); 1055 return videoView->currentItem()->text(3);
1056 break; 1056 break;
1057 }; 1057 };
1058 return ""; 1058 return "";
1059} 1059}