author | zecke <zecke> | 2004-09-23 21:38:02 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-23 21:38:02 (UTC) |
commit | 97ab73d99688443d02086b4f00d1de7c81faa3c7 (patch) (unidiff) | |
tree | 63864e847abc41442d2ed88ca27a27ad1942c15a /noncore/multimedia/opieplayer2/playlistwidget.cpp | |
parent | 3080b2095fd9dddc4937cbf74037ce1dbc7fa6b2 (diff) | |
download | opie-97ab73d99688443d02086b4f00d1de7c81faa3c7.zip opie-97ab73d99688443d02086b4f00d1de7c81faa3c7.tar.gz opie-97ab73d99688443d02086b4f00d1de7c81faa3c7.tar.bz2 |
-Remove bogus whitespaces
-Remove stl dependency
-Make switching from fullscreen video to audio work
-Remove debug output
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 36f77be..d73f0cd 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -184,12 +184,10 @@ void PlayListWidget::writeDefaultPlaylist() { | |||
184 | QString filename=QPEApplication::documentDir() + "/default.m3u"; | 184 | QString filename=QPEApplication::documentDir() + "/default.m3u"; |
185 | QString currentString = config.readEntry( "CurrentPlaylist", filename); | 185 | QString currentString = config.readEntry( "CurrentPlaylist", filename); |
186 | if( currentString == filename) { | 186 | if( currentString == filename) { |
187 | Om3u *m3uList; | 187 | Om3u *m3uList; |
188 | // odebug << "<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>" << oendl; | ||
189 | if( d->selectedFiles->first() ) { | 188 | if( d->selectedFiles->first() ) { |
190 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); | 189 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); |
191 | do { | 190 | do { |
192 | // odebug << d->selectedFiles->current()->file() << oendl; | ||
193 | m3uList->add( d->selectedFiles->current()->file() ); | 191 | m3uList->add( d->selectedFiles->current()->file() ); |
194 | } | 192 | } |
195 | while ( d->selectedFiles->next() ); | 193 | while ( d->selectedFiles->next() ); |
@@ -208,7 +206,6 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { | |||
208 | lnk.file().left(4) == "http" ) { | 206 | lnk.file().left(4) == "http" ) { |
209 | d->selectedFiles->addToSelection( lnk ); | 207 | d->selectedFiles->addToSelection( lnk ); |
210 | } | 208 | } |
211 | // writeCurrentM3u(); | ||
212 | } | 209 | } |
213 | 210 | ||
214 | 211 | ||
@@ -328,14 +325,14 @@ void PlayListWidget::addAllVideoToList() { | |||
328 | 325 | ||
329 | 326 | ||
330 | void PlayListWidget::setDocument( const QString& _fileref ) { | 327 | void PlayListWidget::setDocument( const QString& _fileref ) { |
331 | // odebug << "<<<<<<<<set document>>>>>>>>>> "+fileref << oendl; | 328 | // odebug << "<<<<<<<<set document>>>>>>>>>> "+fileref << oendl; |
332 | QString fileref = _fileref; | 329 | QString fileref = _fileref; |
333 | fromSetDocument = TRUE; | 330 | fromSetDocument = TRUE; |
334 | 331 | ||
335 | DocLnk lnk(_fileref); | 332 | DocLnk lnk(_fileref); |
336 | if(lnk.isValid()) | 333 | if(lnk.isValid()) |
337 | fileref = lnk.file(); | 334 | fileref = lnk.file(); |
338 | 335 | ||
339 | QFileInfo fileInfo(fileref); | 336 | QFileInfo fileInfo(fileref); |
340 | 337 | ||
341 | if ( !fileInfo.exists() ) { | 338 | if ( !fileInfo.exists() ) { |
@@ -410,7 +407,7 @@ bool PlayListWidget::prev() { | |||
410 | 407 | ||
411 | 408 | ||
412 | bool PlayListWidget::next() { | 409 | bool PlayListWidget::next() { |
413 | //odebug << "<<<<<<<<<<<<next()" << oendl; | 410 | //odebug << "<<<<<<<<<<<<next()" << oendl; |
414 | if ( mediaPlayerState->isShuffled() ) { | 411 | if ( mediaPlayerState->isShuffled() ) { |
415 | return prev(); | 412 | return prev(); |
416 | } else { | 413 | } else { |
@@ -621,7 +618,7 @@ void PlayListWidget::openURL() { | |||
621 | fileDlg->exec(); | 618 | fileDlg->exec(); |
622 | if( fileDlg->result() == 1 ) { | 619 | if( fileDlg->result() == 1 ) { |
623 | filename = fileDlg->text(); | 620 | filename = fileDlg->text(); |
624 | odebug << "Selected filename is " + filename << oendl; | 621 | odebug << "Selected filename is " + filename << oendl; |
625 | // Om3u *m3uList; | 622 | // Om3u *m3uList; |
626 | DocLnk lnk; | 623 | DocLnk lnk; |
627 | Config cfg( "OpiePlayer" ); | 624 | Config cfg( "OpiePlayer" ); |
@@ -697,7 +694,7 @@ void PlayListWidget::openFile() { | |||
697 | 694 | ||
698 | if( !str.isEmpty() ) { | 695 | if( !str.isEmpty() ) { |
699 | 696 | ||
700 | odebug << "Selected filename is " + str << oendl; | 697 | odebug << "Selected filename is " + str << oendl; |
701 | filename = str; | 698 | filename = str; |
702 | DocLnk lnk; | 699 | DocLnk lnk; |
703 | 700 | ||
@@ -715,7 +712,7 @@ void PlayListWidget::openFile() { | |||
715 | 712 | ||
716 | 713 | ||
717 | void PlayListWidget::readListFromFile( const QString &filename ) { | 714 | void PlayListWidget::readListFromFile( const QString &filename ) { |
718 | odebug << "read list filename " + filename << oendl; | 715 | odebug << "read list filename " + filename << oendl; |
719 | QFileInfo fi(filename); | 716 | QFileInfo fi(filename); |
720 | Om3u *m3uList; | 717 | Om3u *m3uList; |
721 | QString s, name; | 718 | QString s, name; |
@@ -728,7 +725,7 @@ void PlayListWidget::readListFromFile( const QString &filename ) { | |||
728 | DocLnk lnk; | 725 | DocLnk lnk; |
729 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 726 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
730 | s = *it; | 727 | s = *it; |
731 | // odebug << s << oendl; | 728 | // odebug << s << oendl; |
732 | if(s.left(4)=="http") { | 729 | if(s.left(4)=="http") { |
733 | lnk.setName( s ); //sets file name | 730 | lnk.setName( s ); //sets file name |
734 | lnk.setIcon("opieplayer2/musicfile"); | 731 | lnk.setIcon("opieplayer2/musicfile"); |
@@ -762,7 +759,7 @@ void PlayListWidget::readListFromFile( const QString &filename ) { | |||
762 | 759 | ||
763 | // writes current playlist to current m3u file */ | 760 | // writes current playlist to current m3u file */ |
764 | void PlayListWidget::writeCurrentM3u() { | 761 | void PlayListWidget::writeCurrentM3u() { |
765 | odebug << "writing to current m3u" << oendl; | 762 | odebug << "writing to current m3u" << oendl; |
766 | Config cfg( "OpiePlayer" ); | 763 | Config cfg( "OpiePlayer" ); |
767 | cfg.setGroup("PlayList"); | 764 | cfg.setGroup("PlayList"); |
768 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); | 765 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); |
@@ -772,11 +769,11 @@ void PlayListWidget::readListFromFile( const QString &filename ) { | |||
772 | if( d->selectedFiles->first()) { | 769 | if( d->selectedFiles->first()) { |
773 | 770 | ||
774 | do { | 771 | do { |
775 | // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; | 772 | // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; |
776 | m3uList->add( d->selectedFiles->current()->file() ); | 773 | m3uList->add( d->selectedFiles->current()->file() ); |
777 | } | 774 | } |
778 | while ( d->selectedFiles->next() ); | 775 | while ( d->selectedFiles->next() ); |
779 | // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; | 776 | // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; |
780 | m3uList->write(); | 777 | m3uList->write(); |
781 | m3uList->close(); | 778 | m3uList->close(); |
782 | } | 779 | } |
@@ -821,7 +818,7 @@ void PlayListWidget::writem3u() { | |||
821 | if( !str.isEmpty() ) { | 818 | if( !str.isEmpty() ) { |
822 | name = str; | 819 | name = str; |
823 | // name = fileDlg->text(); | 820 | // name = fileDlg->text(); |
824 | // odebug << filename << oendl; | 821 | // odebug << filename << oendl; |
825 | if( name.find("/",0,true) != -1) {// assume they specify a file path | 822 | if( name.find("/",0,true) != -1) {// assume they specify a file path |
826 | filename = name; | 823 | filename = name; |
827 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); | 824 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); |
@@ -839,7 +836,7 @@ void PlayListWidget::writem3u() { | |||
839 | m3uList->add( d->selectedFiles->current()->file()); | 836 | m3uList->add( d->selectedFiles->current()->file()); |
840 | } | 837 | } |
841 | while ( d->selectedFiles->next() ); | 838 | while ( d->selectedFiles->next() ); |
842 | // odebug << list << oendl; | 839 | // odebug << list << oendl; |
843 | m3uList->write(); | 840 | m3uList->write(); |
844 | m3uList->close(); | 841 | m3uList->close(); |
845 | delete m3uList; | 842 | delete m3uList; |
@@ -851,7 +848,7 @@ void PlayListWidget::writem3u() { | |||
851 | lnk.setIcon("opieplayer2/playlist2"); | 848 | lnk.setIcon("opieplayer2/playlist2"); |
852 | lnk.setName( name); //sets file name | 849 | lnk.setName( name); //sets file name |
853 | 850 | ||
854 | // odebug << filename << oendl; | 851 | // odebug << filename << oendl; |
855 | Config config( "OpiePlayer" ); | 852 | Config config( "OpiePlayer" ); |
856 | config.setGroup( "PlayList" ); | 853 | config.setGroup( "PlayList" ); |
857 | 854 | ||
@@ -859,7 +856,7 @@ void PlayListWidget::writem3u() { | |||
859 | currentPlayList=filename; | 856 | currentPlayList=filename; |
860 | 857 | ||
861 | if(!lnk.writeLink()) { | 858 | if(!lnk.writeLink()) { |
862 | odebug << "Writing doclink did not work" << oendl; | 859 | odebug << "Writing doclink did not work" << oendl; |
863 | } | 860 | } |
864 | 861 | ||
865 | setCaption(tr("OpiePlayer: ") + name); | 862 | setCaption(tr("OpiePlayer: ") + name); |
@@ -893,7 +890,7 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
893 | removeSelected(); | 890 | removeSelected(); |
894 | break; | 891 | break; |
895 | // case Key_P: //play | 892 | // case Key_P: //play |
896 | // odebug << "Play" << oendl; | 893 | // odebug << "Play" << oendl; |
897 | // playSelected(); | 894 | // playSelected(); |
898 | // break; | 895 | // break; |
899 | case Key_Space: | 896 | case Key_Space: |
@@ -923,7 +920,7 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | |||
923 | } | 920 | } |
924 | 921 | ||
925 | void PlayListWidget::pmViewActivated(int index) { | 922 | void PlayListWidget::pmViewActivated(int index) { |
926 | // odebug << "" << index << "" << oendl; | 923 | // odebug << "" << index << "" << oendl; |
927 | switch(index) { | 924 | switch(index) { |
928 | case -16: | 925 | case -16: |
929 | { | 926 | { |
@@ -953,7 +950,7 @@ void PlayListWidget::populateSkinsMenu() { | |||
953 | QFileInfo *fi; | 950 | QFileInfo *fi; |
954 | while ( ( fi = it.current() ) ) { | 951 | while ( ( fi = it.current() ) ) { |
955 | skinName = fi->fileName(); | 952 | skinName = fi->fileName(); |
956 | // odebug << fi->fileName() << oendl; | 953 | // odebug << fi->fileName() << oendl; |
957 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { | 954 | if( skinName != "." && skinName != ".." && skinName !="CVS" ) { |
958 | item = skinsMenu->insertItem( fi->fileName() ) ; | 955 | item = skinsMenu->insertItem( fi->fileName() ) ; |
959 | } | 956 | } |
@@ -1009,7 +1006,7 @@ QString PlayListWidget::currentFileListPathName() const { | |||
1009 | 1006 | ||
1010 | 1007 | ||
1011 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { | 1008 | void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { |
1012 | odebug << "qcop message "+msg << oendl; | 1009 | odebug << "qcop message "+msg << oendl; |
1013 | QDataStream stream ( data, IO_ReadOnly ); | 1010 | QDataStream stream ( data, IO_ReadOnly ); |
1014 | if ( msg == "play()" ) { //plays current selection | 1011 | if ( msg == "play()" ) { //plays current selection |
1015 | btnPlay( true); | 1012 | btnPlay( true); |