-rw-r--r-- | core/multimedia/opieplayer/playlistselection.cpp | 12 | ||||
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 12 |
2 files changed, 19 insertions, 5 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp index 8f3711a..3c47256 100644 --- a/core/multimedia/opieplayer/playlistselection.cpp +++ b/core/multimedia/opieplayer/playlistselection.cpp | |||
@@ -197,7 +197,19 @@ void PlayListSelection::writeCurrent( Config& cfg ) { | |||
197 | 197 | ||
198 | } | 198 | } |
199 | 199 | ||
200 | void PlayListSelection::setSelectedItem(const QString &strk ) { | 200 | void PlayListSelection::setSelectedItem(const QString &strk ) { |
201 | |||
202 | unSelect(); | ||
203 | QListViewItemIterator it( this ); | ||
204 | for ( ; it.current(); ++it ) { | ||
205 | // qDebug( it.current()->text(0)); | ||
206 | if( strk == it.current()->text(0)) { | ||
207 | // qDebug( "We have a match "+strk); | ||
208 | setSelected( it.current(), TRUE); | ||
209 | ensureItemVisible( it.current() ); | ||
210 | return; | ||
211 | } | ||
212 | } | ||
201 | // setSelected( item, TRUE ); | 213 | // setSelected( item, TRUE ); |
202 | // ensureItemVisible( selectedItem() ); | 214 | // ensureItemVisible( selectedItem() ); |
203 | } | 215 | } |
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 63df715..0764c01 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -318,9 +318,10 @@ void PlayListWidget::initializeStates() { | |||
318 | // d->tbScale->setOn( mediaPlayerState->scaled() ); | 318 | // d->tbScale->setOn( mediaPlayerState->scaled() ); |
319 | // d->tbScale->setEnabled( mediaPlayerState->fullscreen() ); | 319 | // d->tbScale->setEnabled( mediaPlayerState->fullscreen() ); |
320 | // setPlaylist( mediaPlayerState->playlist() ); | 320 | // setPlaylist( mediaPlayerState->playlist() ); |
321 | setPlaylist( true); | 321 | setPlaylist( true); |
322 | d->selectedFiles->first(); | 322 | // d->selectedFiles->first(); |
323 | |||
323 | } | 324 | } |
324 | 325 | ||
325 | 326 | ||
326 | void PlayListWidget::readConfig( Config& cfg ) { | 327 | void PlayListWidget::readConfig( Config& cfg ) { |
@@ -335,8 +336,9 @@ void PlayListWidget::readConfig( Config& cfg ) { | |||
335 | if ( lnk.isValid() ) { | 336 | if ( lnk.isValid() ) { |
336 | d->selectedFiles->addToSelection( lnk ); | 337 | d->selectedFiles->addToSelection( lnk ); |
337 | } | 338 | } |
338 | } | 339 | } |
340 | d->selectedFiles->setSelectedItem( currentString); | ||
339 | // d->selectedFiles->setSelectedItem( (const QString &)currentString); | 341 | // d->selectedFiles->setSelectedItem( (const QString &)currentString); |
340 | } | 342 | } |
341 | 343 | ||
342 | 344 | ||
@@ -350,9 +352,9 @@ void PlayListWidget::writeConfig( Config& cfg ) const { | |||
350 | const DocLnk *lnk = d->selectedFiles->current(); | 352 | const DocLnk *lnk = d->selectedFiles->current(); |
351 | if ( lnk ) { | 353 | if ( lnk ) { |
352 | QString entryName; | 354 | QString entryName; |
353 | entryName.sprintf( "File%i", noOfFiles + 1 ); | 355 | entryName.sprintf( "File%i", noOfFiles + 1 ); |
354 | qDebug(entryName); | 356 | // qDebug(entryName); |
355 | cfg.writeEntry( entryName, lnk->linkFile() ); | 357 | cfg.writeEntry( entryName, lnk->linkFile() ); |
356 | // if this link does exist, add it so we have the file | 358 | // if this link does exist, add it so we have the file |
357 | // next time... | 359 | // next time... |
358 | if ( !QFile::exists( lnk->linkFile() ) ) { | 360 | if ( !QFile::exists( lnk->linkFile() ) ) { |
@@ -472,9 +474,9 @@ const DocLnk *PlayListWidget::current() { // this is fugly | |||
472 | // qDebug("current"); | 474 | // qDebug("current"); |
473 | // switch (tabWidget->currentPageIndex()) { | 475 | // switch (tabWidget->currentPageIndex()) { |
474 | // case 0: //playlist | 476 | // case 0: //playlist |
475 | // { | 477 | // { |
476 | qDebug("playlist"); | 478 | // qDebug("playlist"); |
477 | if ( mediaPlayerState->playlist() ) { | 479 | if ( mediaPlayerState->playlist() ) { |
478 | return d->selectedFiles->current(); | 480 | return d->selectedFiles->current(); |
479 | } | 481 | } |
480 | else if ( d->setDocumentUsed && d->current ) { | 482 | else if ( d->setDocumentUsed && d->current ) { |
@@ -608,9 +610,9 @@ void PlayListWidget::saveList() { | |||
608 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property | 610 | lnk.setFile(QDir::homeDirPath()+"/Settings/"+filename+".playlist.conf"); //sets File property |
609 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D | 611 | lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D |
610 | lnk.setIcon("mpegplayer/playlist2"); | 612 | lnk.setIcon("mpegplayer/playlist2"); |
611 | lnk.setName( filename); //sets file name | 613 | lnk.setName( filename); //sets file name |
612 | qDebug(filename); | 614 | // qDebug(filename); |
613 | if(!lnk.writeLink()) | 615 | if(!lnk.writeLink()) |
614 | qDebug("Writing doclink did not work"); | 616 | qDebug("Writing doclink did not work"); |
615 | } | 617 | } |
616 | Config config( "MediaPlayer" ); | 618 | Config config( "MediaPlayer" ); |
@@ -885,9 +887,9 @@ void PlayListWidget::listDelete() { | |||
885 | // AppLnkSet appFiles; | 887 | // AppLnkSet appFiles; |
886 | QListIterator<DocLnk> dit( files.children() ); | 888 | QListIterator<DocLnk> dit( files.children() ); |
887 | for ( ; dit.current(); ++dit ) { | 889 | for ( ; dit.current(); ++dit ) { |
888 | if( dit.current()->name() == file) { | 890 | if( dit.current()->name() == file) { |
889 | qDebug(file); | 891 | // qDebug(file); |
890 | LnkProperties prop( dit.current() ); | 892 | LnkProperties prop( dit.current() ); |
891 | // connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); | 893 | // connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); |
892 | prop.showMaximized(); | 894 | prop.showMaximized(); |
893 | prop.exec(); | 895 | prop.exec(); |