author | harlekin <harlekin> | 2002-07-31 23:56:39 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-07-31 23:56:39 (UTC) |
commit | b2978cf32ae5e6954fb118c89c1f70ee05d53ef4 (patch) (side-by-side diff) | |
tree | c9a90786a9676014cc1abba61bc0828cf61beb67 | |
parent | 3a4d367a8e5e9f599e0487326c105de9aa773bfe (diff) | |
download | opie-b2978cf32ae5e6954fb118c89c1f70ee05d53ef4.zip opie-b2978cf32ae5e6954fb118c89c1f70ee05d53ef4.tar.gz opie-b2978cf32ae5e6954fb118c89c1f70ee05d53ef4.tar.bz2 |
fix
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 9373f6b..cd53748 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -862,198 +862,193 @@ void PlayListWidget::listDelete() { } void PlayListWidget::scanForAudio() { qDebug("scan for audio"); files.detachChildren(); QListIterator<DocLnk> sdit( files.children() ); for ( ; sdit.current(); ++sdit ) { delete sdit.current(); } Global::findDocuments(&files, "audio/*"); audioScan = TRUE; } void PlayListWidget::scanForVideo() { qDebug("scan for video"); vFiles.detachChildren(); QListIterator<DocLnk> sdit( vFiles.children() ); for ( ; sdit.current(); ++sdit ) { delete sdit.current(); } Global::findDocuments(&vFiles, "video/*"); videoScan = TRUE; } void PlayListWidget::populateAudioView() { audioView->clear(); StorageInfo storageInfo; const QList<FileSystem> &fs = storageInfo.fileSystems(); if(!audioScan) scanForAudio(); QListIterator<DocLnk> dit( files.children() ); QListIterator<FileSystem> it ( fs ); QString storage; for ( ; dit.current(); ++dit ) { for( ; it.current(); ++it ){ const QString name = (*it)->name(); const QString path = (*it)->path(); if(dit.current()->file().find(path) != -1 ) storage=name; } QListViewItem * newItem; if ( QFile( dit.current()->file()).exists() ) { // qDebug(dit.current()->name()); newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" )); } } } void PlayListWidget::populateVideoView() { videoView->clear(); StorageInfo storageInfo; const QList<FileSystem> &fs = storageInfo.fileSystems(); if(!videoScan ) scanForVideo(); QListIterator<DocLnk> Vdit( vFiles.children() ); QListIterator<FileSystem> it ( fs ); videoView->clear(); QString storage; for ( ; Vdit.current(); ++Vdit ) { for( ; it.current(); ++it ){ const QString name = (*it)->name(); const QString path = (*it)->path(); if( Vdit.current()->file().find(path) != -1 ) storage=name; } QListViewItem * newItem; if ( QFile( Vdit.current()->file()).exists() ) { newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" )); } } } void PlayListWidget::openFile() { QString filename, name; InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { filename = fileDlg->LineEdit1->text(); qDebug("Selected filename is "+filename); if(filename.right(3) == "m3u") { readm3u( filename ); } else if(filename.right(3) == "pls") { readPls( filename ); } else { DocLnk lnk; lnk.setName(filename); //sets file name - // probably not needed anymore either - if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") { - filename += "/"; - } lnk.setFile(filename); //sets File property - lnk.setType("audio/x-mpegurl"); lnk.setExec("opieplayer"); lnk.setIcon("opieplayer/MPEGPlayer"); if(!lnk.writeLink()) { qDebug("Writing doclink did not work"); } d->selectedFiles->addToSelection( lnk); } } if(fileDlg) { delete fileDlg; } } void PlayListWidget::keyReleaseEvent( QKeyEvent *e) { switch ( e->key() ) { ////////////////////////////// Zaurus keys case Key_F9: //activity // if(audioUI->isHidden()) // audioUI->showMaximized(); break; case Key_F10: //contacts // if( videoUI->isHidden()) // videoUI->showMaximized(); break; case Key_F11: //menu break; case Key_F12: //home // doBlank(); break; case Key_F13: //mail // doUnblank(); break; case Key_Q: //add to playlist qDebug("Add"); addSelected(); break; case Key_R: //remove from playlist removeSelected(); break; // case Key_P: //play // qDebug("Play"); // playSelected(); // break; case Key_Space: qDebug("Play"); // playSelected(); puh break; case Key_1: tabWidget->setCurrentPage(0); break; case Key_2: tabWidget->setCurrentPage(1); break; case Key_3: tabWidget->setCurrentPage(2); break; case Key_4: tabWidget->setCurrentPage(3); break; case Key_Down: if ( !d->selectedFiles->next() ) d->selectedFiles->first(); break; case Key_Up: if ( !d->selectedFiles->prev() ) // d->selectedFiles->last(); break; } } void PlayListWidget::keyPressEvent( QKeyEvent *e) { // qDebug("Key press"); // switch ( e->key() ) { // ////////////////////////////// Zaurus keys // case Key_A: //add to playlist // qDebug("Add"); // addSelected(); // break; // case Key_R: //remove from playlist // removeSelected(); // break; // case Key_P: //play // qDebug("Play"); // playSelected(); // break; // case Key_Space: // qDebug("Play"); // playSelected(); // break; |