summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistselection.h2
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistselection.h b/noncore/multimedia/opieplayer2/playlistselection.h
index d10bc82..9cc4e30 100644
--- a/noncore/multimedia/opieplayer2/playlistselection.h
+++ b/noncore/multimedia/opieplayer2/playlistselection.h
@@ -1,63 +1,65 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef PLAY_LIST_SELECTION_H 20#ifndef PLAY_LIST_SELECTION_H
21#define PLAY_LIST_SELECTION_H 21#define PLAY_LIST_SELECTION_H
22 22
23#include <qlist.h> 23#include <qlist.h>
24#include <qlistview.h> 24#include <qlistview.h>
25#include <qpe/applnk.h> 25#include <qpe/applnk.h>
26#include <qpe/config.h> 26#include <qpe/config.h>
27 27
28class PlayListSelection : public QListView { 28class PlayListSelection : public QListView {
29 Q_OBJECT 29 Q_OBJECT
30public: 30public:
31 PlayListSelection( QWidget *parent, const char *name=0 ); 31 PlayListSelection( QWidget *parent, const char *name=0 );
32 ~PlayListSelection(); 32 ~PlayListSelection();
33 33
34 const DocLnk *current(); // retrieve the current playlist entry (media file link) 34 const DocLnk *current(); // retrieve the current playlist entry (media file link)
35public slots: 35public slots:
36 void addToSelection( const DocLnk & ); // Add a media file to the playlist 36 void addToSelection( const DocLnk & ); // Add a media file to the playlist
37 void removeSelected(); // Remove a media file from the playlist 37 void removeSelected(); // Remove a media file from the playlist
38 void moveSelectedUp(); // Move the media file up the playlist so it is played earlier 38 void moveSelectedUp(); // Move the media file up the playlist so it is played earlier
39 void moveSelectedDown(); // Move the media file down the playlist so it is played later 39 void moveSelectedDown(); // Move the media file down the playlist so it is played later
40 void unSelect(); 40 void unSelect();
41 void writeCurrent( Config &); 41 void writeCurrent( Config &);
42 void setSelectedItem( const QString & ); 42 void setSelectedItem( const QString & );
43 bool prev(); 43 bool prev();
44 bool next(); 44 bool next();
45 bool first(); 45 bool first();
46 bool last(); 46 bool last();
47 47
48 bool isEmpty() const { return childCount() == 0; }
49
48protected: 50protected:
49 virtual void contentsMouseMoveEvent(QMouseEvent *); 51 virtual void contentsMouseMoveEvent(QMouseEvent *);
50/* #ifdef USE_PLAYLIST_BACKGROUND */ 52/* #ifdef USE_PLAYLIST_BACKGROUND */
51 virtual void drawBackground( QPainter *p, const QRect &r ); 53 virtual void drawBackground( QPainter *p, const QRect &r );
52 virtual void paintEmptyArea( QPainter *p, const QRect &r ) { drawBackground( p, r ); }; 54 virtual void paintEmptyArea( QPainter *p, const QRect &r ) { drawBackground( p, r ); };
53/* #endif */ 55/* #endif */
54 56
55private: 57private:
56 QList<DocLnk> selectedList; 58 QList<DocLnk> selectedList;
57 const DocLnk *lnk; 59 const DocLnk *lnk;
58}; 60};
59 61
60 62
61#endif // PLAY_LIST_SELECTION_H 63#endif // PLAY_LIST_SELECTION_H
62 64
63 65
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index f53def6..b08204e 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -325,338 +325,346 @@ void PlayListWidget::addAllMusicToList() {
325 DocLnk lnk; 325 DocLnk lnk;
326 QString filename; 326 QString filename;
327 // iterate through all items of the listview 327 // iterate through all items of the listview
328 for ( ; audioIt.current(); ++audioIt ) { 328 for ( ; audioIt.current(); ++audioIt ) {
329 filename = audioIt.current()->text(3); 329 filename = audioIt.current()->text(3);
330 lnk.setName( QFileInfo(filename).baseName() ); //sets name 330 lnk.setName( QFileInfo(filename).baseName() ); //sets name
331 lnk.setFile( filename ); //sets file name 331 lnk.setFile( filename ); //sets file name
332 d->selectedFiles->addToSelection( lnk); 332 d->selectedFiles->addToSelection( lnk);
333 } 333 }
334 334
335 /* if(!audioScan) 335 /* if(!audioScan)
336 scanForAudio(); 336 scanForAudio();
337 QListIterator<DocLnk> dit( files.children() ); 337 QListIterator<DocLnk> dit( files.children() );
338 for ( ; dit.current(); ++dit ) { 338 for ( ; dit.current(); ++dit ) {
339 if( QFileInfo(dit.current()->file() ).exists() ) { 339 if( QFileInfo(dit.current()->file() ).exists() ) {
340 d->selectedFiles->addToSelection( **dit ); 340 d->selectedFiles->addToSelection( **dit );
341 } 341 }
342 } 342 }
343 */ 343 */
344 tabWidget->setCurrentPage(0); 344 tabWidget->setCurrentPage(0);
345 writeCurrentM3u(); 345 writeCurrentM3u();
346 d->selectedFiles->first(); 346 d->selectedFiles->first();
347} 347}
348 348
349 349
350void PlayListWidget::addAllVideoToList() { 350void PlayListWidget::addAllVideoToList() {
351 351
352 if(!videoScan) { 352 if(!videoScan) {
353 if(videoView->childCount() < 1) 353 if(videoView->childCount() < 1)
354 populateVideoView(); 354 populateVideoView();
355 } 355 }
356 356
357 QListViewItemIterator videoIt( videoView ); 357 QListViewItemIterator videoIt( videoView );
358 DocLnk lnk; 358 DocLnk lnk;
359 QString filename; 359 QString filename;
360 for ( ; videoIt.current(); ++videoIt ) { 360 for ( ; videoIt.current(); ++videoIt ) {
361 filename = videoIt.current()->text(3); 361 filename = videoIt.current()->text(3);
362 lnk.setName( QFileInfo(filename).baseName() ); //sets name 362 lnk.setName( QFileInfo(filename).baseName() ); //sets name
363 lnk.setFile( filename ); //sets file name 363 lnk.setFile( filename ); //sets file name
364 d->selectedFiles->addToSelection( lnk); 364 d->selectedFiles->addToSelection( lnk);
365 } 365 }
366 366
367 367
368 /* if(!videoScan) 368 /* if(!videoScan)
369 scanForVideo(); 369 scanForVideo();
370 QListIterator<DocLnk> dit( vFiles.children() ); 370 QListIterator<DocLnk> dit( vFiles.children() );
371 for ( ; dit.current(); ++dit ) { 371 for ( ; dit.current(); ++dit ) {
372 if( QFileInfo( dit.current()->file() ).exists() ) { 372 if( QFileInfo( dit.current()->file() ).exists() ) {
373 d->selectedFiles->addToSelection( **dit ); 373 d->selectedFiles->addToSelection( **dit );
374 } 374 }
375 } 375 }
376*/ 376*/
377 tabWidget->setCurrentPage(0); 377 tabWidget->setCurrentPage(0);
378 writeCurrentM3u(); 378 writeCurrentM3u();
379 d->selectedFiles->first(); 379 d->selectedFiles->first();
380} 380}
381 381
382 382
383void PlayListWidget::setDocument( const QString& fileref ) { 383void PlayListWidget::setDocument( const QString& fileref ) {
384 // qDebug( "<<<<<<<<set document>>>>>>>>>> "+fileref ); 384 // qDebug( "<<<<<<<<set document>>>>>>>>>> "+fileref );
385 fromSetDocument = TRUE; 385 fromSetDocument = TRUE;
386 if ( fileref.isNull() ) { 386 if ( fileref.isNull() ) {
387 QMessageBox::warning( this, tr( "Invalid File" ), 387 QMessageBox::warning( this, tr( "Invalid File" ),
388 tr( "There was a problem in getting the file." ) ); 388 tr( "There was a problem in getting the file." ) );
389 return; 389 return;
390 } 390 }
391 391
392 clearList(); 392 clearList();
393 if( fileref.find( "m3u", 0, TRUE) != -1 ) { //is m3u 393 if( fileref.find( "m3u", 0, TRUE) != -1 ) { //is m3u
394 readm3u( fileref ); 394 readm3u( fileref );
395 } else if( DocLnk( fileref).file().find( "m3u", 0, TRUE) != -1 ) { 395 } else if( DocLnk( fileref).file().find( "m3u", 0, TRUE) != -1 ) {
396 readm3u( DocLnk( fileref).file() ); 396 readm3u( DocLnk( fileref).file() );
397 } else if( fileref.find( "pls", 0, TRUE) != -1 ) { //is pls 397 } else if( fileref.find( "pls", 0, TRUE) != -1 ) { //is pls
398 readPls( fileref ); 398 readPls( fileref );
399 } else if( DocLnk( fileref).file().find( "pls", 0, TRUE) != -1 ) { 399 } else if( DocLnk( fileref).file().find( "pls", 0, TRUE) != -1 ) {
400 readPls( DocLnk( fileref).file() ); 400 readPls( DocLnk( fileref).file() );
401 } else { 401 } else {
402 clearList(); 402 clearList();
403 addToSelection( DocLnk( fileref ) ); 403 addToSelection( DocLnk( fileref ) );
404 writeCurrentM3u(); 404 writeCurrentM3u();
405 405
406 d->setDocumentUsed = TRUE; 406 d->setDocumentUsed = TRUE;
407 mediaPlayerState->setPlaying( FALSE ); 407 mediaPlayerState->setPlaying( FALSE );
408 mediaPlayerState->setPlaying( TRUE ); 408 mediaPlayerState->setPlaying( TRUE );
409 } 409 }
410} 410}
411 411
412 412
413void PlayListWidget::useSelectedDocument() { 413void PlayListWidget::useSelectedDocument() {
414 d->setDocumentUsed = FALSE; 414 d->setDocumentUsed = FALSE;
415} 415}
416 416
417 417
418const DocLnk *PlayListWidget::current() const { // this is fugly 418const DocLnk *PlayListWidget::current() const { // this is fugly
419 assert( currentTab() == CurrentPlayList ); 419 assert( currentTab() == CurrentPlayList );
420 420
421 return d->selectedFiles->current(); 421 const DocLnk *lnk = d->selectedFiles->current();
422 if ( !lnk ) {
423 d->selectedFiles->first();
424 lnk = d->selectedFiles->current();
425 }
426 assert( lnk );
427 return lnk;
422} 428}
423 429
424 430
425bool PlayListWidget::prev() { 431bool PlayListWidget::prev() {
426 if ( mediaPlayerState->isShuffled() ) { 432 if ( mediaPlayerState->isShuffled() ) {
427 const DocLnk *cur = current(); 433 const DocLnk *cur = current();
428 int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0)); 434 int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0));
429 for ( int i = 0; i < j; i++ ) { 435 for ( int i = 0; i < j; i++ ) {
430 if ( !d->selectedFiles->next() ) 436 if ( !d->selectedFiles->next() )
431 d->selectedFiles->first(); 437 d->selectedFiles->first();
432 } 438 }
433 if ( cur == current() ) 439 if ( cur == current() )
434 if ( !d->selectedFiles->next() ) { 440 if ( !d->selectedFiles->next() ) {
435 d->selectedFiles->first(); 441 d->selectedFiles->first();
436 } 442 }
437 return TRUE; 443 return TRUE;
438 } else { 444 } else {
439 if ( !d->selectedFiles->prev() ) { 445 if ( !d->selectedFiles->prev() ) {
440 if ( mediaPlayerState->isLooping() ) { 446 if ( mediaPlayerState->isLooping() ) {
441 return d->selectedFiles->last(); 447 return d->selectedFiles->last();
442 } else { 448 } else {
443 return FALSE; 449 return FALSE;
444 } 450 }
445 } 451 }
446 return TRUE; 452 return TRUE;
447 } 453 }
448} 454}
449 455
450 456
451bool PlayListWidget::next() { 457bool PlayListWidget::next() {
452//qDebug("<<<<<<<<<<<<next()"); 458//qDebug("<<<<<<<<<<<<next()");
453 if ( mediaPlayerState->isShuffled() ) { 459 if ( mediaPlayerState->isShuffled() ) {
454 return prev(); 460 return prev();
455 } else { 461 } else {
456 if ( !d->selectedFiles->next() ) { 462 if ( !d->selectedFiles->next() ) {
457 if ( mediaPlayerState->isLooping() ) { 463 if ( mediaPlayerState->isLooping() ) {
458 return d->selectedFiles->first(); 464 return d->selectedFiles->first();
459 } else { 465 } else {
460 return FALSE; 466 return FALSE;
461 } 467 }
462 } 468 }
463 return TRUE; 469 return TRUE;
464 } 470 }
465} 471}
466 472
467 473
468bool PlayListWidget::first() { 474bool PlayListWidget::first() {
469 return d->selectedFiles->first(); 475 return d->selectedFiles->first();
470} 476}
471 477
472 478
473bool PlayListWidget::last() { 479bool PlayListWidget::last() {
474 return d->selectedFiles->last(); 480 return d->selectedFiles->last();
475} 481}
476 482
477 483
478 void PlayListWidget::saveList() { 484 void PlayListWidget::saveList() {
479 writem3u(); 485 writem3u();
480 } 486 }
481 487
482 488
483void PlayListWidget::loadList( const DocLnk & lnk) { 489void PlayListWidget::loadList( const DocLnk & lnk) {
484 QString name = lnk.name(); 490 QString name = lnk.name();
485 // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); 491 // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name);
486 492
487 if( name.length()>0) { 493 if( name.length()>0) {
488 setCaption("OpiePlayer: "+name); 494 setCaption("OpiePlayer: "+name);
489// qDebug("<<<<<<<<<<<<load list "+ lnk.file()); 495// qDebug("<<<<<<<<<<<<load list "+ lnk.file());
490 clearList(); 496 clearList();
491 readm3u(lnk.file()); 497 readm3u(lnk.file());
492 tabWidget->setCurrentPage(0); 498 tabWidget->setCurrentPage(0);
493 } 499 }
494} 500}
495 501
496void PlayListWidget::addSelected() { 502void PlayListWidget::addSelected() {
497 assert( inFileListMode() ); 503 assert( inFileListMode() );
498 504
499 QListView *fileListView = currentFileListView(); 505 QListView *fileListView = currentFileListView();
500 QListViewItemIterator it( fileListView ); 506 QListViewItemIterator it( fileListView );
501 for ( ; it.current(); ++it ) 507 for ( ; it.current(); ++it )
502 if ( it.current()->isSelected() ) { 508 if ( it.current()->isSelected() ) {
503 QString filename = it.current()->text(3); 509 QString filename = it.current()->text(3);
504 510
505 DocLnk lnk; 511 DocLnk lnk;
506 lnk.setName( QFileInfo( filename ).baseName() ); //sets name 512 lnk.setName( QFileInfo( filename ).baseName() ); //sets name
507 lnk.setFile( filename ); //sets file name 513 lnk.setFile( filename ); //sets file name
508 514
509 d->selectedFiles->addToSelection( lnk ); 515 d->selectedFiles->addToSelection( lnk );
510 } 516 }
511 517
512 fileListView->clearSelection(); 518 fileListView->clearSelection();
513 519
514 tabWidget->setCurrentPage( 0 ); 520 tabWidget->setCurrentPage( 0 );
515 writeCurrentM3u(); 521 writeCurrentM3u();
516} 522}
517 523
518 524
519void PlayListWidget::removeSelected() { 525void PlayListWidget::removeSelected() {
520 d->selectedFiles->removeSelected( ); 526 d->selectedFiles->removeSelected( );
521 writeCurrentM3u(); 527 writeCurrentM3u();
522} 528}
523 529
524 530
525void PlayListWidget::playIt( QListViewItem *it) { 531void PlayListWidget::playIt( QListViewItem *it) {
526 if(!it) return; 532 if(!it) return;
527 mediaPlayerState->setPlaying(FALSE); 533 mediaPlayerState->setPlaying(FALSE);
528 mediaPlayerState->setPlaying(TRUE); 534 mediaPlayerState->setPlaying(TRUE);
529 d->selectedFiles->unSelect(); 535 d->selectedFiles->unSelect();
530} 536}
531 537
532 538
533void PlayListWidget::addToSelection( QListViewItem *it) { 539void PlayListWidget::addToSelection( QListViewItem *it) {
534 d->setDocumentUsed = FALSE; 540 d->setDocumentUsed = FALSE;
535 541
536 if(it) { 542 if(it) {
537 if ( currentTab() == CurrentPlayList ) 543 if ( currentTab() == CurrentPlayList )
538 return; 544 return;
539 // case 1: { 545 // case 1: {
540 DocLnk lnk; 546 DocLnk lnk;
541 QString filename; 547 QString filename;
542 548
543 filename=it->text(3); 549 filename=it->text(3);
544 lnk.setName( QFileInfo(filename).baseName() ); //sets name 550 lnk.setName( QFileInfo(filename).baseName() ); //sets name
545 lnk.setFile( filename ); //sets file name 551 lnk.setFile( filename ); //sets file name
546 d->selectedFiles->addToSelection( lnk); 552 d->selectedFiles->addToSelection( lnk);
547 553
548 writeCurrentM3u(); 554 writeCurrentM3u();
549 tabWidget->setCurrentPage(0); 555 tabWidget->setCurrentPage(0);
550 556
551 } 557 }
552} 558}
553 559
554 560
555void PlayListWidget::tabChanged(QWidget *) { 561void PlayListWidget::tabChanged(QWidget *) {
556 562
557 d->tbPlay->setEnabled( true ); 563 d->tbPlay->setEnabled( true );
558 564
559 switch ( currentTab() ) { 565 switch ( currentTab() ) {
560 case CurrentPlayList: 566 case CurrentPlayList:
561 { 567 {
562 if( !tbDeletePlaylist->isHidden() ) { 568 if( !tbDeletePlaylist->isHidden() ) {
563 tbDeletePlaylist->hide(); 569 tbDeletePlaylist->hide();
564 } 570 }
565 d->tbRemoveFromList->setEnabled(TRUE); 571 d->tbRemoveFromList->setEnabled(TRUE);
566 d->tbAddToList->setEnabled(FALSE); 572 d->tbAddToList->setEnabled(FALSE);
573
574 d->tbPlay->setEnabled( !d->selectedFiles->isEmpty() );
567 } 575 }
568 break; 576 break;
569 case AudioFiles: 577 case AudioFiles:
570 { 578 {
571 // audioView->clear(); 579 // audioView->clear();
572 if(!audioPopulated) populateAudioView(); 580 if(!audioPopulated) populateAudioView();
573 581
574 if( !tbDeletePlaylist->isHidden() ) { 582 if( !tbDeletePlaylist->isHidden() ) {
575 tbDeletePlaylist->hide(); 583 tbDeletePlaylist->hide();
576 } 584 }
577 d->tbRemoveFromList->setEnabled(FALSE); 585 d->tbRemoveFromList->setEnabled(FALSE);
578 d->tbAddToList->setEnabled(TRUE); 586 d->tbAddToList->setEnabled(TRUE);
579 } 587 }
580 break; 588 break;
581 case VideoFiles: 589 case VideoFiles:
582 { 590 {
583 // videoView->clear(); 591 // videoView->clear();
584 if(!videoPopulated) populateVideoView(); 592 if(!videoPopulated) populateVideoView();
585 if( !tbDeletePlaylist->isHidden() ) { 593 if( !tbDeletePlaylist->isHidden() ) {
586 tbDeletePlaylist->hide(); 594 tbDeletePlaylist->hide();
587 } 595 }
588 d->tbRemoveFromList->setEnabled(FALSE); 596 d->tbRemoveFromList->setEnabled(FALSE);
589 d->tbAddToList->setEnabled(TRUE); 597 d->tbAddToList->setEnabled(TRUE);
590 } 598 }
591 break; 599 break;
592 case PlayLists: 600 case PlayLists:
593 { 601 {
594 if( tbDeletePlaylist->isHidden() ) { 602 if( tbDeletePlaylist->isHidden() ) {
595 tbDeletePlaylist->show(); 603 tbDeletePlaylist->show();
596 } 604 }
597 playLists->reread(); 605 playLists->reread();
598 d->tbAddToList->setEnabled(FALSE); 606 d->tbAddToList->setEnabled(FALSE);
599 607
600 d->tbPlay->setEnabled( false ); 608 d->tbPlay->setEnabled( false );
601 } 609 }
602 break; 610 break;
603 }; 611 };
604} 612}
605 613
606 614
607void PlayListWidget::btnPlay(bool b) { 615void PlayListWidget::btnPlay(bool b) {
608// mediaPlayerState->setPlaying(false); 616// mediaPlayerState->setPlaying(false);
609 mediaPlayerState->setPlaying(b); 617 mediaPlayerState->setPlaying(b);
610 insanityBool=FALSE; 618 insanityBool=FALSE;
611} 619}
612 620
613void PlayListWidget::deletePlaylist() { 621void PlayListWidget::deletePlaylist() {
614 switch( QMessageBox::information( this, (tr("Remove Playlist?")), 622 switch( QMessageBox::information( this, (tr("Remove Playlist?")),
615 (tr("You really want to delete\nthis playlist?")), 623 (tr("You really want to delete\nthis playlist?")),
616 (tr("Yes")), (tr("No")), 0 )){ 624 (tr("Yes")), (tr("No")), 0 )){
617 case 0: // Yes clicked, 625 case 0: // Yes clicked,
618 QFile().remove(playLists->selectedDocument().file()); 626 QFile().remove(playLists->selectedDocument().file());
619 QFile().remove(playLists->selectedDocument().linkFile()); 627 QFile().remove(playLists->selectedDocument().linkFile());
620 playLists->reread(); 628 playLists->reread();
621 break; 629 break;
622 case 1: // Cancel 630 case 1: // Cancel
623 break; 631 break;
624 }; 632 };
625} 633}
626 634
627 635
628void PlayListWidget::playSelected() { 636void PlayListWidget::playSelected() {
629 btnPlay( TRUE); 637 btnPlay( TRUE);
630} 638}
631 639
632 640
633void PlayListWidget::scanForAudio() { 641void PlayListWidget::scanForAudio() {
634// qDebug("scan for audio"); 642// qDebug("scan for audio");
635 files.detachChildren(); 643 files.detachChildren();
636 QListIterator<DocLnk> sdit( files.children() ); 644 QListIterator<DocLnk> sdit( files.children() );
637 for ( ; sdit.current(); ++sdit ) { 645 for ( ; sdit.current(); ++sdit ) {
638 delete sdit.current(); 646 delete sdit.current();
639 } 647 }
640// Global::findDocuments( &files, "audio/*"); 648// Global::findDocuments( &files, "audio/*");
641 Global::findDocuments( &files, audioMimes); 649 Global::findDocuments( &files, audioMimes);
642 audioScan = true; 650 audioScan = true;
643 populateAudioView(); 651 populateAudioView();
644} 652}
645 653
646void PlayListWidget::scanForVideo() { 654void PlayListWidget::scanForVideo() {
647// qDebug("scan for video"); 655// qDebug("scan for video");
648 vFiles.detachChildren(); 656 vFiles.detachChildren();
649 QListIterator<DocLnk> sdit( vFiles.children() ); 657 QListIterator<DocLnk> sdit( vFiles.children() );
650 for ( ; sdit.current(); ++sdit ) { 658 for ( ; sdit.current(); ++sdit ) {
651 delete sdit.current(); 659 delete sdit.current();
652 } 660 }
653 Global::findDocuments(&vFiles, "video/*"); 661 Global::findDocuments(&vFiles, "video/*");
654 videoScan = true; 662 videoScan = true;
655 populateVideoView(); 663 populateVideoView();
656} 664}
657 665
658void PlayListWidget::populateAudioView() { 666void PlayListWidget::populateAudioView() {
659 audioView->clear(); 667 audioView->clear();
660 StorageInfo storageInfo; 668 StorageInfo storageInfo;
661 // const QList<FileSystem> &fs = storageInfo.fileSystems(); 669 // const QList<FileSystem> &fs = storageInfo.fileSystems();
662 if(!audioScan) { 670 if(!audioScan) {