summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistselection.cpp12
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp12
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
@@ -199,4 +199,16 @@ void PlayListSelection::writeCurrent( Config& cfg ) {
void PlayListSelection::setSelectedItem(const QString &strk ) {
+
+ unSelect();
+ QListViewItemIterator it( this );
+ for ( ; it.current(); ++it ) {
+// qDebug( it.current()->text(0));
+ if( strk == it.current()->text(0)) {
+// qDebug( "We have a match "+strk);
+ setSelected( it.current(), TRUE);
+ ensureItemVisible( it.current() );
+ return;
+ }
+ }
// setSelected( item, TRUE );
// ensureItemVisible( selectedItem() );
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
@@ -320,5 +320,6 @@ void PlayListWidget::initializeStates() {
// setPlaylist( mediaPlayerState->playlist() );
setPlaylist( true);
- d->selectedFiles->first();
+// d->selectedFiles->first();
+
}
@@ -337,4 +338,5 @@ void PlayListWidget::readConfig( Config& cfg ) {
}
}
+ d->selectedFiles->setSelectedItem( currentString);
// d->selectedFiles->setSelectedItem( (const QString &)currentString);
}
@@ -352,5 +354,5 @@ void PlayListWidget::writeConfig( Config& cfg ) const {
QString entryName;
entryName.sprintf( "File%i", noOfFiles + 1 );
- qDebug(entryName);
+// qDebug(entryName);
cfg.writeEntry( entryName, lnk->linkFile() );
// if this link does exist, add it so we have the file
@@ -474,5 +476,5 @@ const DocLnk *PlayListWidget::current() { // this is fugly
// case 0: //playlist
// {
- qDebug("playlist");
+// qDebug("playlist");
if ( mediaPlayerState->playlist() ) {
return d->selectedFiles->current();
@@ -610,5 +612,5 @@ void PlayListWidget::saveList() {
lnk.setIcon("mpegplayer/playlist2");
lnk.setName( filename); //sets file name
- qDebug(filename);
+// qDebug(filename);
if(!lnk.writeLink())
qDebug("Writing doclink did not work");
@@ -887,5 +889,5 @@ void PlayListWidget::listDelete() {
for ( ; dit.current(); ++dit ) {
if( dit.current()->name() == file) {
- qDebug(file);
+// qDebug(file);
LnkProperties prop( dit.current() );
// connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *)));