summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-10 20:16:48 (UTC)
committer llornkcor <llornkcor>2002-04-10 20:16:48 (UTC)
commit5d7caf051fb1b46fc2ed7d2f71b03fdf3b42b3ac (patch) (side-by-side diff)
treeaf7abddaeb16b6167d975968f62a521d8e6231dc
parent5cf7797af9fb965916f5017f84898516157c4620 (diff)
downloadopie-5d7caf051fb1b46fc2ed7d2f71b03fdf3b42b3ac.zip
opie-5d7caf051fb1b46fc2ed7d2f71b03fdf3b42b3ac.tar.gz
opie-5d7caf051fb1b46fc2ed7d2f71b03fdf3b42b3ac.tar.bz2
added ability to remember position in the playlist you were last at startup and when opening playlists
Diffstat (more/less context) (ignore 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
@@ -198,6 +198,18 @@ 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
@@ -319,7 +319,8 @@ void PlayListWidget::initializeStates() {
// d->tbScale->setEnabled( mediaPlayerState->fullscreen() );
// setPlaylist( mediaPlayerState->playlist() );
setPlaylist( true);
- d->selectedFiles->first();
+// d->selectedFiles->first();
+
}
@@ -336,6 +337,7 @@ void PlayListWidget::readConfig( Config& cfg ) {
d->selectedFiles->addToSelection( lnk );
}
}
+ d->selectedFiles->setSelectedItem( currentString);
// d->selectedFiles->setSelectedItem( (const QString &)currentString);
}
@@ -351,7 +353,7 @@ void PlayListWidget::writeConfig( Config& cfg ) const {
if ( lnk ) {
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
// next time...
@@ -473,7 +475,7 @@ const DocLnk *PlayListWidget::current() { // this is fugly
// switch (tabWidget->currentPageIndex()) {
// case 0: //playlist
// {
- qDebug("playlist");
+// qDebug("playlist");
if ( mediaPlayerState->playlist() ) {
return d->selectedFiles->current();
}
@@ -609,7 +611,7 @@ void PlayListWidget::saveList() {
lnk.setType("playlist/plain");// hey is this a REGISTERED mime type?!?!? ;D
lnk.setIcon("mpegplayer/playlist2");
lnk.setName( filename); //sets file name
- qDebug(filename);
+// qDebug(filename);
if(!lnk.writeLink())
qDebug("Writing doclink did not work");
}
@@ -886,7 +888,7 @@ void PlayListWidget::listDelete() {
QListIterator<DocLnk> dit( files.children() );
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 *)));
prop.showMaximized();