-rw-r--r-- | core/launcher/launcherview.cpp | 2 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 10 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 11 |
3 files changed, 15 insertions, 8 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp index 0ced256..c54a00f 100644 --- a/core/launcher/launcherview.cpp +++ b/core/launcher/launcherview.cpp @@ -552,82 +552,82 @@ void LauncherView::selectionChanged() if ( icons->inKeyEvent() ) // not for mouse press emit clicked( appLnk ); item->setSelected(FALSE); } } void LauncherView::returnPressed( QIconViewItem *item ) { if ( item ) { AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); emit clicked( appLnk ); } } void LauncherView::itemClicked( int btn, QIconViewItem *item ) { if ( item ) { AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); if ( btn == LeftButton ) { // Make sure it's the item we execute that gets highlighted icons->setCurrentItem( item ); emit clicked( appLnk ); } item->setSelected(FALSE); } } void LauncherView::itemPressed( int btn, QIconViewItem *item ) { if ( item ) { AppLnk *appLnk = ((LauncherItem *)item)->appLnk(); if ( btn == RightButton ) emit rightPressed( appLnk ); /* else if ( btn == LeftButton ) emit clicked( appLnk ); */ item->setSelected(FALSE); } } void LauncherView::internalPopulate( AppLnkSet *folder, const QString& typefilter ) { QListIterator<AppLnk> it( folder->children() ); icons->setTypeFilter(typefilter,FALSE); while ( it.current() ) { // show only the icons for existing files - if (!QFile(it.current()->file()).exists() ) + if (!QFile(it.current()->file()).exists() & it.current()->file().left(4) != "http") { //maybe insert some .desktop file deletion code later //maybe dir specific } else { icons->addItem(*it,FALSE); } ++it; } icons->sort(); } bool LauncherView::removeLink(const QString& linkfile) { return icons->removeLink(linkfile); } void LauncherView::sort() { icons->sort(); } void LauncherView::addItem(AppLnk* app, bool resort) { icons->addItem(app,resort); } void LauncherView::setFileSystems(const QList<FileSystem> &) { // ### does nothing now... } diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 65dc5fb..8d66407 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -985,100 +985,104 @@ void PlayListWidget::listDelete() { // prop.exec(); // } // } } break; }; } 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()); + if ( QFile( dit.current()->file()).exists() || dit.current()->file().left(4) == "http" ) { + long size; + if( dit.current()->file().left(4) == "http" ) + size=0; + else + size = QFile( dit.current()->file() ).size(); newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), - QString::number( QFile( dit.current()->file()).size() ), storage); + QString::number(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(); // http://205.188.234.129:8030 // http://66.28.68.70:8000 // filename.replace(QRegExp("%20")," "); qDebug("Selected filename is "+filename); if(filename.right(3) == "m3u") readm3u( filename); else if(filename.right(3) == "pls") readPls( filename); diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 603a7a3..6c4d07f 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -684,100 +684,103 @@ void PlayListWidget::playSelected() { btnPlay( TRUE); } 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); + if ( QFile( dit.current()->file()).exists() || dit.current()->file().left(4) == "http" ) { + long size; + if( dit.current()->file().left(4) == "http" ) + size=0; + else + size = QFile( dit.current()->file() ).size(); + newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number(size ), storage); newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/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( "opieplayer2/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->text(); qDebug( "Selected filename is " + filename ); if( filename.right( 3 ) == "m3u" ) { |