summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/multimedia/opieplayer/playlistselection.cpp3
-rw-r--r--core/multimedia/opieplayer/playlistwidget.cpp2
2 files changed, 2 insertions, 3 deletions
diff --git a/core/multimedia/opieplayer/playlistselection.cpp b/core/multimedia/opieplayer/playlistselection.cpp
index 58c3966..430aa6b 100644
--- a/core/multimedia/opieplayer/playlistselection.cpp
+++ b/core/multimedia/opieplayer/playlistselection.cpp
@@ -153,61 +153,60 @@ bool PlayListSelection::next() {
153 return FALSE; 153 return FALSE;
154 ensureItemVisible( selectedItem() ); 154 ensureItemVisible( selectedItem() );
155 return TRUE; 155 return TRUE;
156} 156}
157 157
158 158
159bool PlayListSelection::first() { 159bool PlayListSelection::first() {
160 QListViewItem *item = firstChild(); 160 QListViewItem *item = firstChild();
161 if ( item ) 161 if ( item )
162 setSelected( item, TRUE ); 162 setSelected( item, TRUE );
163 else 163 else
164 return FALSE; 164 return FALSE;
165 ensureItemVisible( selectedItem() ); 165 ensureItemVisible( selectedItem() );
166 return TRUE; 166 return TRUE;
167} 167}
168 168
169 169
170bool PlayListSelection::last() { 170bool PlayListSelection::last() {
171 QListViewItem *prevItem = NULL; 171 QListViewItem *prevItem = NULL;
172 QListViewItem *item = firstChild(); 172 QListViewItem *item = firstChild();
173 while ( ( item = item->nextSibling() ) ) 173 while ( ( item = item->nextSibling() ) )
174 prevItem = item; 174 prevItem = item;
175 if ( prevItem ) 175 if ( prevItem )
176 setSelected( prevItem, TRUE ); 176 setSelected( prevItem, TRUE );
177 else 177 else
178 return FALSE; 178 return FALSE;
179 ensureItemVisible( selectedItem() ); 179 ensureItemVisible( selectedItem() );
180 return TRUE; 180 return TRUE;
181} 181}
182 182
183void PlayListSelection::unSelect() 183void PlayListSelection::unSelect()
184{ 184{
185 QListViewItem *item = selectedItem(); 185 setSelected( currentItem() , FALSE);
186 setSelected( currentItem(), FALSE);
187} 186}
188 187
189void PlayListSelection::writeCurrent( Config& cfg ) { 188void PlayListSelection::writeCurrent( Config& cfg ) {
190 cfg.setGroup("PlayList"); 189 cfg.setGroup("PlayList");
191 QListViewItem *item = selectedItem(); 190 QListViewItem *item = selectedItem();
192 if ( item ) 191 if ( item )
193 cfg.writeEntry("current", item->text(0) ); 192 cfg.writeEntry("current", item->text(0) );
194 // odebug << item->text(0) << oendl; 193 // odebug << item->text(0) << oendl;
195 194
196} 195}
197 196
198void PlayListSelection::setSelectedItem(const QString &strk ) { 197void PlayListSelection::setSelectedItem(const QString &strk ) {
199 198
200 unSelect(); 199 unSelect();
201 QListViewItemIterator it( this ); 200 QListViewItemIterator it( this );
202 for ( ; it.current(); ++it ) { 201 for ( ; it.current(); ++it ) {
203// odebug << it.current()->text(0) << oendl; 202// odebug << it.current()->text(0) << oendl;
204 if( strk == it.current()->text(0)) { 203 if( strk == it.current()->text(0)) {
205// odebug << "We have a match "+strk << oendl; 204// odebug << "We have a match "+strk << oendl;
206 setSelected( it.current(), TRUE); 205 setSelected( it.current(), TRUE);
207 ensureItemVisible( it.current() ); 206 ensureItemVisible( it.current() );
208 return; 207 return;
209 } 208 }
210 } 209 }
211// setSelected( item, TRUE ); 210// setSelected( item, TRUE );
212// ensureItemVisible( selectedItem() ); 211// ensureItemVisible( selectedItem() );
213} 212}
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp
index d85ce50..46aeff2 100644
--- a/core/multimedia/opieplayer/playlistwidget.cpp
+++ b/core/multimedia/opieplayer/playlistwidget.cpp
@@ -1376,65 +1376,65 @@ void PlayListWidget::doUnblank() {
1376 1376
1377void PlayListWidget::populateSkinsMenu() { 1377void PlayListWidget::populateSkinsMenu() {
1378 int item = 0; 1378 int item = 0;
1379 defaultSkinIndex = 0; 1379 defaultSkinIndex = 0;
1380 QString skinName; 1380 QString skinName;
1381 Config cfg( "OpiePlayer" ); 1381 Config cfg( "OpiePlayer" );
1382 cfg.setGroup("Options" ); 1382 cfg.setGroup("Options" );
1383 QString skin = cfg.readEntry( "Skin", "default" ); 1383 QString skin = cfg.readEntry( "Skin", "default" );
1384 1384
1385 QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" ); 1385 QDir skinsDir( QPEApplication::qpeDir() + "/pics/opieplayer2/skins" );
1386 skinsDir.setFilter( QDir::Dirs ); 1386 skinsDir.setFilter( QDir::Dirs );
1387 skinsDir.setSorting(QDir::Name ); 1387 skinsDir.setSorting(QDir::Name );
1388 const QFileInfoList *skinslist = skinsDir.entryInfoList(); 1388 const QFileInfoList *skinslist = skinsDir.entryInfoList();
1389 QFileInfoListIterator it( *skinslist ); 1389 QFileInfoListIterator it( *skinslist );
1390 QFileInfo *fi; 1390 QFileInfo *fi;
1391 while ( ( fi = it.current() ) ) { 1391 while ( ( fi = it.current() ) ) {
1392 skinName = fi->fileName(); 1392 skinName = fi->fileName();
1393 // odebug << fi->fileName() << oendl; 1393 // odebug << fi->fileName() << oendl;
1394 if( skinName != "." && skinName != ".." && skinName !="CVS" ) { 1394 if( skinName != "." && skinName != ".." && skinName !="CVS" ) {
1395 item = skinsMenu->insertItem( fi->fileName() ) ; 1395 item = skinsMenu->insertItem( fi->fileName() ) ;
1396 } 1396 }
1397 if( skinName == "default" ) { 1397 if( skinName == "default" ) {
1398 defaultSkinIndex = item; 1398 defaultSkinIndex = item;
1399 } 1399 }
1400 if( skinName == skin ) { 1400 if( skinName == skin ) {
1401 skinsMenu->setItemChecked( item, TRUE ); 1401 skinsMenu->setItemChecked( item, TRUE );
1402 } 1402 }
1403 ++it; 1403 ++it;
1404 } 1404 }
1405} 1405}
1406 1406
1407void PlayListWidget::skinsMenuActivated( int item ) { 1407void PlayListWidget::skinsMenuActivated( int item ) {
1408 for( int i = defaultSkinIndex; i > defaultSkinIndex - skinsMenu->count(); i-- ) { 1408 for( int i = defaultSkinIndex; i > defaultSkinIndex - static_cast<int>(skinsMenu->count()); i-- ) {
1409 skinsMenu->setItemChecked( i, FALSE ); 1409 skinsMenu->setItemChecked( i, FALSE );
1410 } 1410 }
1411 skinsMenu->setItemChecked( item, TRUE ); 1411 skinsMenu->setItemChecked( item, TRUE );
1412 1412
1413 Config cfg( "OpiePlayer" ); 1413 Config cfg( "OpiePlayer" );
1414 cfg.setGroup("Options"); 1414 cfg.setGroup("Options");
1415 cfg.writeEntry("Skin", skinsMenu->text( item ) ); 1415 cfg.writeEntry("Skin", skinsMenu->text( item ) );
1416} 1416}
1417 1417
1418void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) { 1418void PlayListWidget::qcopReceive(const QCString &msg, const QByteArray &data) {
1419 // odebug << "qcop message "+msg << oendl; 1419 // odebug << "qcop message "+msg << oendl;
1420 QDataStream stream ( data, IO_ReadOnly ); 1420 QDataStream stream ( data, IO_ReadOnly );
1421 if ( msg == "play()" ) { //plays current selection 1421 if ( msg == "play()" ) { //plays current selection
1422 btnPlay( true); 1422 btnPlay( true);
1423 } else if ( msg == "stop()" ) { 1423 } else if ( msg == "stop()" ) {
1424 mediaPlayerState->setPlaying( false); 1424 mediaPlayerState->setPlaying( false);
1425 } else if ( msg == "togglePause()" ) { 1425 } else if ( msg == "togglePause()" ) {
1426 mediaPlayerState->togglePaused(); 1426 mediaPlayerState->togglePaused();
1427 } else if ( msg == "next()" ) { //select next in lis 1427 } else if ( msg == "next()" ) { //select next in lis
1428 mediaPlayerState->setNext(); 1428 mediaPlayerState->setNext();
1429 } else if ( msg == "prev()" ) { //select previous in list 1429 } else if ( msg == "prev()" ) { //select previous in list
1430 mediaPlayerState->setPrev(); 1430 mediaPlayerState->setPrev();
1431 } else if ( msg == "toggleLooping()" ) { //loop or not loop 1431 } else if ( msg == "toggleLooping()" ) { //loop or not loop
1432 mediaPlayerState->toggleLooping(); 1432 mediaPlayerState->toggleLooping();
1433 } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled 1433 } else if ( msg == "toggleShuffled()" ) { //shuffled or not shuffled
1434 mediaPlayerState->toggleShuffled(); 1434 mediaPlayerState->toggleShuffled();
1435 } else if ( msg == "volUp()" ) { //volume more 1435 } else if ( msg == "volUp()" ) { //volume more
1436 // emit moreClicked(); 1436 // emit moreClicked();
1437 // emit moreReleased(); 1437 // emit moreReleased();
1438 } else if ( msg == "volDown()" ) { //volume less 1438 } else if ( msg == "volDown()" ) { //volume less
1439 // emit lessClicked(); 1439 // emit lessClicked();
1440 // emit lessReleased(); 1440 // emit lessReleased();