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 @@ -183,14 +183,12 @@ void PlayListWidget::writeDefaultPlaylist() { config.setGroup( "PlayList" ); QString filename=QPEApplication::documentDir() + "/default.m3u"; QString currentString = config.readEntry( "CurrentPlaylist", filename); if( currentString == filename) { - Om3u *m3uList; - // odebug << "<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>" << oendl; + Om3u *m3uList; if( d->selectedFiles->first() ) { m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); do { - // odebug << d->selectedFiles->current()->file() << oendl; m3uList->add( d->selectedFiles->current()->file() ); } while ( d->selectedFiles->next() ); @@ -207,9 +205,8 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { if( QFileInfo( lnk.file() ).exists() || lnk.file().left(4) == "http" ) { d->selectedFiles->addToSelection( lnk ); } -// writeCurrentM3u(); } void PlayListWidget::clearList() { @@ -327,16 +324,16 @@ void PlayListWidget::addAllVideoToList() { } void PlayListWidget::setDocument( const QString& _fileref ) { - // odebug << "<<<<<<<<set document>>>>>>>>>> "+fileref << oendl; + // odebug << "<<<<<<<<set document>>>>>>>>>> "+fileref << oendl; QString fileref = _fileref; fromSetDocument = TRUE; - + DocLnk lnk(_fileref); if(lnk.isValid()) fileref = lnk.file(); - + QFileInfo fileInfo(fileref); if ( !fileInfo.exists() ) { QMessageBox::warning( this, tr( "Invalid File" ), @@ -409,9 +406,9 @@ bool PlayListWidget::prev() { } bool PlayListWidget::next() { -//odebug << "<<<<<<<<<<<<next()" << oendl; +//odebug << "<<<<<<<<<<<<next()" << oendl; if ( mediaPlayerState->isShuffled() ) { return prev(); } else { if ( !d->selectedFiles->next() ) { @@ -620,9 +617,9 @@ void PlayListWidget::openURL() { fileDlg = new InputDialog(this,tr("Add URL"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { filename = fileDlg->text(); - odebug << "Selected filename is " + filename << oendl; + odebug << "Selected filename is " + filename << oendl; // Om3u *m3uList; DocLnk lnk; Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); @@ -696,9 +693,9 @@ void PlayListWidget::openFile() { cfg.writeEntry( "LastDirectory" ,QFileInfo( str ).dirPath() ); if( !str.isEmpty() ) { - odebug << "Selected filename is " + str << oendl; + odebug << "Selected filename is " + str << oendl; filename = str; DocLnk lnk; if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { @@ -714,9 +711,9 @@ void PlayListWidget::openFile() { } void PlayListWidget::readListFromFile( const QString &filename ) { - odebug << "read list filename " + filename << oendl; + odebug << "read list filename " + filename << oendl; QFileInfo fi(filename); Om3u *m3uList; QString s, name; m3uList = new Om3u( filename, IO_ReadOnly ); @@ -727,9 +724,9 @@ void PlayListWidget::readListFromFile( const QString &filename ) { DocLnk lnk; for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { s = *it; - // odebug << s << oendl; + // odebug << s << oendl; if(s.left(4)=="http") { lnk.setName( s ); //sets file name lnk.setIcon("opieplayer2/musicfile"); lnk.setFile( s ); //sets file name @@ -761,9 +758,9 @@ void PlayListWidget::readListFromFile( const QString &filename ) { } // writes current playlist to current m3u file */ void PlayListWidget::writeCurrentM3u() { - odebug << "writing to current m3u" << oendl; + odebug << "writing to current m3u" << oendl; Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); @@ -771,13 +768,13 @@ void PlayListWidget::readListFromFile( const QString &filename ) { m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); if( d->selectedFiles->first()) { do { - // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; + // odebug << "add writeCurrentM3u " +d->selectedFiles->current()->file() << oendl; m3uList->add( d->selectedFiles->current()->file() ); } while ( d->selectedFiles->next() ); - // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; + // odebug << "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" << oendl; m3uList->write(); m3uList->close(); } delete m3uList; @@ -820,9 +817,9 @@ void PlayListWidget::writem3u() { if( !str.isEmpty() ) { name = str; // name = fileDlg->text(); -// odebug << filename << oendl; +// odebug << filename << oendl; if( name.find("/",0,true) != -1) {// assume they specify a file path filename = name; name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); } @@ -838,9 +835,9 @@ void PlayListWidget::writem3u() { do { m3uList->add( d->selectedFiles->current()->file()); } while ( d->selectedFiles->next() ); - // odebug << list << oendl; + // odebug << list << oendl; m3uList->write(); m3uList->close(); delete m3uList; @@ -850,17 +847,17 @@ void PlayListWidget::writem3u() { lnk.setFile( filename); lnk.setIcon("opieplayer2/playlist2"); lnk.setName( name); //sets file name - // odebug << filename << oendl; + // odebug << filename << oendl; Config config( "OpiePlayer" ); config.setGroup( "PlayList" ); config.writeEntry("CurrentPlaylist",filename); currentPlayList=filename; if(!lnk.writeLink()) { - odebug << "Writing doclink did not work" << oendl; + odebug << "Writing doclink did not work" << oendl; } setCaption(tr("OpiePlayer: ") + name); } @@ -892,9 +889,9 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { case Key_R: //remove from playlist removeSelected(); break; // case Key_P: //play - // odebug << "Play" << oendl; + // odebug << "Play" << oendl; // playSelected(); // break; case Key_Space: // playSelected(); puh @@ -922,9 +919,9 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { } } void PlayListWidget::pmViewActivated(int index) { -// odebug << "" << index << "" << oendl; +// odebug << "" << index << "" << oendl; switch(index) { case -16: { mediaPlayerState->toggleFullscreen(); @@ -952,9 +949,9 @@ void PlayListWidget::populateSkinsMenu() { QFileInfoListIterator it( *skinslist ); QFileInfo *fi; while ( ( fi = it.current() ) ) { skinName = fi->fileName(); -// odebug << fi->fileName() << oendl; +// odebug << fi->fileName() << oendl; if( skinName != "." && skinName != ".." && skinName !="CVS" ) { item = skinsMenu->insertItem( fi->fileName() ) ; } if( skinName == "default" ) { @@ -1008,9 +1005,9 @@ QString PlayListWidget::currentFileListPathName() const { } void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { - odebug << "qcop message "+msg << oendl; + odebug << "qcop message "+msg << oendl; QDataStream stream ( data, IO_ReadOnly ); if ( msg == "play()" ) { //plays current selection btnPlay( true); } else if ( msg == "stop()" ) { |