summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index c35e03d..a65495e 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -56,7 +56,7 @@
56#include <assert.h> 56#include <assert.h>
57 57
58PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) 58PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name )
59 : PlayListWidgetGui( mediaPlayerState, parent, name ) , currentFileListView( 0 ) 59 : PlayListWidgetGui( mediaPlayerState, parent, name ) , currentFileListView( 0 )
60{ 60{
61 61
62 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), 62 d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ),
@@ -101,13 +101,13 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par
101 mediaPlayerState.setFullscreen( b ); 101 mediaPlayerState.setFullscreen( b );
102 pmView->setItemChecked( -16, b ); 102 pmView->setItemChecked( -16, b );
103 103
104 (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", 104 (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up",
105 d->selectedFiles, SLOT(moveSelectedUp() ) ); 105 d->selectedFiles, SLOT(moveSelectedUp() ) );
106 (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", 106 (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut",
107 d->selectedFiles, SLOT(removeSelected() ) ); 107 d->selectedFiles, SLOT(removeSelected() ) );
108 (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", 108 (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down",
109 d->selectedFiles, SLOT(moveSelectedDown() ) ); 109 d->selectedFiles, SLOT(moveSelectedDown() ) );
110 // QVBox *stretch2 = new QVBox( vbox1 ); 110 QVBox *stretch2 = new QVBox( vbox1 );
111 111
112 connect( tbDeletePlaylist, ( SIGNAL( released() ) ), 112 connect( tbDeletePlaylist, ( SIGNAL( released() ) ),
113 SLOT( deletePlaylist() ) ); 113 SLOT( deletePlaylist() ) );
@@ -188,7 +188,7 @@ void PlayListWidget::writeDefaultPlaylist() {
188 m3uList->write(); 188 m3uList->write();
189 m3uList->close(); 189 m3uList->close();
190 delete m3uList; 190 delete m3uList;
191 191
192 } 192 }
193 } 193 }
194} 194}
@@ -199,7 +199,7 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) {
199 lnk.file().left(4) == "http" ) { 199 lnk.file().left(4) == "http" ) {
200 d->selectedFiles->addToSelection( lnk ); 200 d->selectedFiles->addToSelection( lnk );
201 } 201 }
202// writeCurrentM3u(); 202// writeCurrentM3u();
203} 203}
204 204
205 205
@@ -261,7 +261,7 @@ void PlayListWidget::addAllToList() {
261 lnk.setName( QFileInfo(filename).baseName() ); //sets name 261 lnk.setName( QFileInfo(filename).baseName() ); //sets name
262 lnk.setFile( filename ); //sets file name 262 lnk.setFile( filename ); //sets file name
263 d->selectedFiles->addToSelection( lnk); 263 d->selectedFiles->addToSelection( lnk);
264 } 264 }
265 265
266 videoView->populateView(); 266 videoView->populateView();
267 267
@@ -271,17 +271,17 @@ void PlayListWidget::addAllToList() {
271 lnk.setName( QFileInfo(filename).baseName() ); //sets name 271 lnk.setName( QFileInfo(filename).baseName() ); //sets name
272 lnk.setFile( filename ); //sets file name 272 lnk.setFile( filename ); //sets file name
273 d->selectedFiles->addToSelection( lnk); 273 d->selectedFiles->addToSelection( lnk);
274 } 274 }
275 275
276 // d->selectedFiles->addToSelection( ); 276 // d->selectedFiles->addToSelection( );
277 // if ( it.current()->isSelected() ) 277 // if ( it.current()->isSelected() )
278 // lst->append( audioIt.current() ); 278 // lst->append( audioIt.current() );
279 // } 279 // }
280 280
281 281
282// if(!audioScan) 282// if(!audioScan)
283// scanForAudio(); 283// scanForAudio();
284// if(!videoScan) 284// if(!videoScan)
285// scanForVideo(); 285// scanForVideo();
286 286
287// DocLnkSet filesAll; 287// DocLnkSet filesAll;
@@ -296,7 +296,7 @@ void PlayListWidget::addAllToList() {
296 // qDebug("elapsed time %d", t.elapsed() ); 296 // qDebug("elapsed time %d", t.elapsed() );
297 297
298 tabWidget->setCurrentPage(0); 298 tabWidget->setCurrentPage(0);
299 299
300 writeCurrentM3u(); 300 writeCurrentM3u();
301 d->selectedFiles->first(); 301 d->selectedFiles->first();
302} 302}
@@ -315,7 +315,7 @@ void PlayListWidget::addAllMusicToList() {
315 lnk.setName( QFileInfo(filename).baseName() ); //sets name 315 lnk.setName( QFileInfo(filename).baseName() ); //sets name
316 lnk.setFile( filename ); //sets file name 316 lnk.setFile( filename ); //sets file name
317 d->selectedFiles->addToSelection( lnk); 317 d->selectedFiles->addToSelection( lnk);
318 } 318 }
319 319
320 /* if(!audioScan) 320 /* if(!audioScan)
321 scanForAudio(); 321 scanForAudio();
@@ -344,7 +344,7 @@ void PlayListWidget::addAllVideoToList() {
344 lnk.setName( QFileInfo(filename).baseName() ); //sets name 344 lnk.setName( QFileInfo(filename).baseName() ); //sets name
345 lnk.setFile( filename ); //sets file name 345 lnk.setFile( filename ); //sets file name
346 d->selectedFiles->addToSelection( lnk); 346 d->selectedFiles->addToSelection( lnk);
347 } 347 }
348 348
349 349
350 /* if(!videoScan) 350 /* if(!videoScan)
@@ -355,9 +355,9 @@ void PlayListWidget::addAllVideoToList() {
355 d->selectedFiles->addToSelection( **dit ); 355 d->selectedFiles->addToSelection( **dit );
356 } 356 }
357 } 357 }
358*/ 358*/
359 tabWidget->setCurrentPage(0); 359 tabWidget->setCurrentPage(0);
360 writeCurrentM3u(); 360 writeCurrentM3u();
361 d->selectedFiles->first(); 361 d->selectedFiles->first();
362} 362}
363 363
@@ -383,8 +383,8 @@ void PlayListWidget::setDocument( const QString& fileref ) {
383 } else { 383 } else {
384 clearList(); 384 clearList();
385 addToSelection( DocLnk( fileref ) ); 385 addToSelection( DocLnk( fileref ) );
386 writeCurrentM3u(); 386 writeCurrentM3u();
387 387
388 d->setDocumentUsed = TRUE; 388 d->setDocumentUsed = TRUE;
389 mediaPlayerState.setPlaying( FALSE ); 389 mediaPlayerState.setPlaying( FALSE );
390 mediaPlayerState.setPlaying( TRUE ); 390 mediaPlayerState.setPlaying( TRUE );
@@ -505,7 +505,7 @@ void PlayListWidget::addSelected() {
505 505
506void PlayListWidget::removeSelected() { 506void PlayListWidget::removeSelected() {
507 d->selectedFiles->removeSelected( ); 507 d->selectedFiles->removeSelected( );
508 writeCurrentM3u(); 508 writeCurrentM3u();
509} 509}
510 510
511 511
@@ -531,10 +531,10 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
531 lnk.setName( QFileInfo(filename).baseName() ); //sets name 531 lnk.setName( QFileInfo(filename).baseName() ); //sets name
532 lnk.setFile( filename ); //sets file name 532 lnk.setFile( filename ); //sets file name
533 d->selectedFiles->addToSelection( lnk); 533 d->selectedFiles->addToSelection( lnk);
534 534
535 writeCurrentM3u(); 535 writeCurrentM3u();
536// tabWidget->setCurrentPage(0); 536// tabWidget->setCurrentPage(0);
537 537
538 } 538 }
539} 539}
540 540
@@ -693,13 +693,13 @@ void PlayListWidget::openFile() {
693 d->selectedFiles->setSelectedItem( lnk.name()); 693 d->selectedFiles->setSelectedItem( lnk.name());
694 } 694 }
695 } 695 }
696 696
697 delete fileDlg; 697 delete fileDlg;
698} 698}
699 699
700/* 700/*
701reads m3u and shows files/urls to playlist widget */ 701reads m3u and shows files/urls to playlist widget */
702void PlayListWidget::readm3u( const QString &filename ) { 702void PlayListWidget::readm3u( const QString &filename ) {
703 qDebug( "read m3u filename " + filename ); 703 qDebug( "read m3u filename " + filename );
704 704
705 Om3u *m3uList; 705 Om3u *m3uList;
@@ -714,12 +714,12 @@ void PlayListWidget::readm3u( const QString &filename ) {
714 lnk.setName( s ); //sets file name 714 lnk.setName( s ); //sets file name
715 lnk.setIcon("opieplayer2/musicfile"); 715 lnk.setIcon("opieplayer2/musicfile");
716 lnk.setFile( s ); //sets file name 716 lnk.setFile( s ); //sets file name
717 717
718 } else { 718 } else {
719 // if( QFileInfo( s ).exists() ) { 719 // if( QFileInfo( s ).exists() ) {
720 lnk.setName( QFileInfo(s).baseName()); 720 lnk.setName( QFileInfo(s).baseName());
721 // if(s.right(4) == '.') {//if regular file 721 // if(s.right(4) == '.') {//if regular file
722 if(s.left(1) != "/") { 722 if(s.left(1) != "/") {
723 // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s); 723 // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s);
724 lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); 724 lnk.setFile( QFileInfo(filename).dirPath()+"/"+s);
725// lnk.setIcon(MimeType(s).pixmap() ); 725// lnk.setIcon(MimeType(s).pixmap() );
@@ -746,7 +746,7 @@ void PlayListWidget::readm3u( const QString &filename ) {
746 746
747 d->selectedFiles->setSelectedItem( s); 747 d->selectedFiles->setSelectedItem( s);
748 setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); 748 setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName());
749 749
750} 750}
751 751
752/* 752/*
@@ -815,7 +815,7 @@ void PlayListWidget::writeCurrentM3u() {
815 m3uList->close(); 815 m3uList->close();
816 } 816 }
817 delete m3uList; 817 delete m3uList;
818 818
819} 819}
820 820
821 /* 821 /*
@@ -850,7 +850,7 @@ void PlayListWidget::writem3u() {
850 m3uList->write(); 850 m3uList->write();
851 m3uList->close(); 851 m3uList->close();
852 delete m3uList; 852 delete m3uList;
853 853
854 delete fileDlg; 854 delete fileDlg;
855 855
856 DocLnk lnk; 856 DocLnk lnk;
@@ -861,7 +861,7 @@ void PlayListWidget::writem3u() {
861 // qDebug(filename); 861 // qDebug(filename);
862 Config config( "OpiePlayer" ); 862 Config config( "OpiePlayer" );
863 config.setGroup( "PlayList" ); 863 config.setGroup( "PlayList" );
864 864
865 config.writeEntry("CurrentPlaylist",filename); 865 config.writeEntry("CurrentPlaylist",filename);
866 currentPlayList=filename; 866 currentPlayList=filename;
867 867