author | llornkcor <llornkcor> | 2002-06-17 23:27:07 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-17 23:27:07 (UTC) |
commit | 33fea370b99c4d6985de14aa913534fb4b1188d3 (patch) (unidiff) | |
tree | 356afa8be87f8e16030ec386bfa514ebf2f0a274 | |
parent | 8b089ad594fad0eed4303bc83db4910784e17dd5 (diff) | |
download | opie-33fea370b99c4d6985de14aa913534fb4b1188d3.zip opie-33fea370b99c4d6985de14aa913534fb4b1188d3.tar.gz opie-33fea370b99c4d6985de14aa913534fb4b1188d3.tar.bz2 |
need special case for urls to be added
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index b0d4958..41fcb30 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -373,97 +373,97 @@ void PlayListWidget::readConfig( Config& cfg ) { | |||
373 | d->selectedFiles->addToSelection( lnk ); | 373 | d->selectedFiles->addToSelection( lnk ); |
374 | } | 374 | } |
375 | } | 375 | } |
376 | d->selectedFiles->setSelectedItem( currentString); | 376 | d->selectedFiles->setSelectedItem( currentString); |
377 | // d->selectedFiles->setSelectedItem( (const QString &)currentString); | 377 | // d->selectedFiles->setSelectedItem( (const QString &)currentString); |
378 | } | 378 | } |
379 | 379 | ||
380 | 380 | ||
381 | void PlayListWidget::writeConfig( Config& cfg ) const { | 381 | void PlayListWidget::writeConfig( Config& cfg ) const { |
382 | 382 | ||
383 | d->selectedFiles->writeCurrent( cfg); | 383 | d->selectedFiles->writeCurrent( cfg); |
384 | cfg.setGroup("PlayList"); | 384 | cfg.setGroup("PlayList"); |
385 | int noOfFiles = 0; | 385 | int noOfFiles = 0; |
386 | d->selectedFiles->first(); | 386 | d->selectedFiles->first(); |
387 | do { | 387 | do { |
388 | const DocLnk *lnk = d->selectedFiles->current(); | 388 | const DocLnk *lnk = d->selectedFiles->current(); |
389 | if ( lnk ) { | 389 | if ( lnk ) { |
390 | QString entryName; | 390 | QString entryName; |
391 | entryName.sprintf( "File%i", noOfFiles + 1 ); | 391 | entryName.sprintf( "File%i", noOfFiles + 1 ); |
392 | // qDebug(entryName); | 392 | // qDebug(entryName); |
393 | cfg.writeEntry( entryName, lnk->linkFile() ); | 393 | cfg.writeEntry( entryName, lnk->linkFile() ); |
394 | // if this link does exist, add it so we have the file | 394 | // if this link does exist, add it so we have the file |
395 | // next time... | 395 | // next time... |
396 | if ( !QFile::exists( lnk->linkFile() ) ) { | 396 | if ( !QFile::exists( lnk->linkFile() ) ) { |
397 | // the way writing lnks doesn't really check for out | 397 | // the way writing lnks doesn't really check for out |
398 | // of disk space, but check it anyway. | 398 | // of disk space, but check it anyway. |
399 | if ( !lnk->writeLink() ) { | 399 | if ( !lnk->writeLink() ) { |
400 | QMessageBox::critical( 0, tr("Out of space"), | 400 | QMessageBox::critical( 0, tr("Out of space"), |
401 | tr( "There was a problem saving " | 401 | tr( "There was a problem saving " |
402 | "the playlist.\n" | 402 | "the playlist.\n" |
403 | "Your playlist " | 403 | "Your playlist " |
404 | "may be missing some entries\n" | 404 | "may be missing some entries\n" |
405 | "the next time you start it." ) | 405 | "the next time you start it." ) |
406 | ); | 406 | ); |
407 | } | 407 | } |
408 | } | 408 | } |
409 | noOfFiles++; | 409 | noOfFiles++; |
410 | } | 410 | } |
411 | } | 411 | } |
412 | while ( d->selectedFiles->next() ); | 412 | while ( d->selectedFiles->next() ); |
413 | cfg.writeEntry("NumberOfFiles", noOfFiles ); | 413 | cfg.writeEntry("NumberOfFiles", noOfFiles ); |
414 | } | 414 | } |
415 | 415 | ||
416 | 416 | ||
417 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { | 417 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { |
418 | // qDebug("add"); | 418 | // qDebug("add"); |
419 | d->setDocumentUsed = FALSE; | 419 | d->setDocumentUsed = FALSE; |
420 | if ( mediaPlayerState->playlist() ) { | 420 | if ( mediaPlayerState->playlist() ) { |
421 | if(QFileInfo(lnk.file()).exists()) | 421 | if(QFileInfo(lnk.file()).exists() || lnk.file().left(4) == "http" ) |
422 | d->selectedFiles->addToSelection( lnk ); | 422 | d->selectedFiles->addToSelection( lnk ); |
423 | } | 423 | } |
424 | else | 424 | else |
425 | mediaPlayerState->setPlaying( TRUE ); | 425 | mediaPlayerState->setPlaying( TRUE ); |
426 | } | 426 | } |
427 | 427 | ||
428 | 428 | ||
429 | void PlayListWidget::clearList() { | 429 | void PlayListWidget::clearList() { |
430 | while ( first() ) | 430 | while ( first() ) |
431 | d->selectedFiles->removeSelected(); | 431 | d->selectedFiles->removeSelected(); |
432 | } | 432 | } |
433 | 433 | ||
434 | 434 | ||
435 | void PlayListWidget::addAllToList() { | 435 | void PlayListWidget::addAllToList() { |
436 | DocLnkSet filesAll; | 436 | DocLnkSet filesAll; |
437 | Global::findDocuments(&filesAll, "video/*;audio/*"); | 437 | Global::findDocuments(&filesAll, "video/*;audio/*"); |
438 | QListIterator<DocLnk> Adit( filesAll.children() ); | 438 | QListIterator<DocLnk> Adit( filesAll.children() ); |
439 | for ( ; Adit.current(); ++Adit ) | 439 | for ( ; Adit.current(); ++Adit ) |
440 | if(QFileInfo(Adit.current()->file()).exists()) | 440 | if(QFileInfo(Adit.current()->file()).exists()) |
441 | d->selectedFiles->addToSelection( **Adit ); | 441 | d->selectedFiles->addToSelection( **Adit ); |
442 | } | 442 | } |
443 | 443 | ||
444 | 444 | ||
445 | void PlayListWidget::addAllMusicToList() { | 445 | void PlayListWidget::addAllMusicToList() { |
446 | QListIterator<DocLnk> dit( files.children() ); | 446 | QListIterator<DocLnk> dit( files.children() ); |
447 | for ( ; dit.current(); ++dit ) | 447 | for ( ; dit.current(); ++dit ) |
448 | if(QFileInfo(dit.current()->file()).exists()) | 448 | if(QFileInfo(dit.current()->file()).exists()) |
449 | d->selectedFiles->addToSelection( **dit ); | 449 | d->selectedFiles->addToSelection( **dit ); |
450 | } | 450 | } |
451 | 451 | ||
452 | 452 | ||
453 | void PlayListWidget::addAllVideoToList() { | 453 | void PlayListWidget::addAllVideoToList() { |
454 | QListIterator<DocLnk> dit( vFiles.children() ); | 454 | QListIterator<DocLnk> dit( vFiles.children() ); |
455 | for ( ; dit.current(); ++dit ) | 455 | for ( ; dit.current(); ++dit ) |
456 | if(QFileInfo( dit.current()->file()).exists()) | 456 | if(QFileInfo( dit.current()->file()).exists()) |
457 | d->selectedFiles->addToSelection( **dit ); | 457 | d->selectedFiles->addToSelection( **dit ); |
458 | } | 458 | } |
459 | 459 | ||
460 | 460 | ||
461 | void PlayListWidget::setDocument(const QString& fileref) { | 461 | void PlayListWidget::setDocument(const QString& fileref) { |
462 | qDebug(fileref); | 462 | qDebug(fileref); |
463 | fromSetDocument = TRUE; | 463 | fromSetDocument = TRUE; |
464 | if ( fileref.isNull() ) { | 464 | if ( fileref.isNull() ) { |
465 | QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) ); | 465 | QMessageBox::critical( 0, tr( "Invalid File" ), tr( "There was a problem in getting the file." ) ); |
466 | return; | 466 | return; |
467 | } | 467 | } |
468 | // qDebug("setDocument "+fileref); | 468 | // qDebug("setDocument "+fileref); |
469 | if(fileref.find("m3u",0,TRUE) != -1) { //is m3u | 469 | if(fileref.find("m3u",0,TRUE) != -1) { //is m3u |