summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/playlistselection.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistselection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistselection.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp
index 015896f..3499837 100644
--- a/noncore/multimedia/opieplayer2/playlistselection.cpp
+++ b/noncore/multimedia/opieplayer2/playlistselection.cpp
@@ -35,46 +35,46 @@ public:
35 }; 35 };
36 36
37 const DocLnk *file() const { return fl; } 37 const DocLnk *file() const { return fl; }
38 38
39private: 39private:
40 const DocLnk *fl; 40 const DocLnk *fl;
41}; 41};
42 42
43 43
44PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) 44PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
45 : QListView( parent, name ) 45 : QListView( parent, name )
46{ 46{
47// qDebug("starting playlistselector"); 47// odebug << "starting playlistselector" << oendl;
48// #ifdef USE_PLAYLIST_BACKGROUND 48// #ifdef USE_PLAYLIST_BACKGROUND
49// setStaticBackground( TRUE ); 49// setStaticBackground( TRUE );
50// setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) ); 50// setBackgroundPixmap( Resource::loadPixmap( "opieplayer/background" ) );
51 51
52// setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) ); 52// setBackgroundPixmap( Resource::loadPixmap( "launcher/opielogo" ) );
53// #endif 53// #endif
54// addColumn("Title",236); 54// addColumn("Title",236);
55// setAllColumnsShowFocus( TRUE ); 55// setAllColumnsShowFocus( TRUE );
56 addColumn( tr( "Playlist Selection" ) ); 56 addColumn( tr( "Playlist Selection" ) );
57 header()->hide(); 57 header()->hide();
58 setSorting( -1, FALSE ); 58 setSorting( -1, FALSE );
59} 59}
60 60
61 61
62PlayListSelection::~PlayListSelection() { 62PlayListSelection::~PlayListSelection() {
63} 63}
64 64
65 65
66// #ifdef USE_PLAYLIST_BACKGROUND 66// #ifdef USE_PLAYLIST_BACKGROUND
67void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { 67void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) {
68// qDebug("drawBackground"); 68// odebug << "drawBackground" << oendl;
69 p->fillRect( r, QBrush( white ) ); 69 p->fillRect( r, QBrush( white ) );
70// QImage logo = Resource::loadImage( "launcher/opielogo" ); 70// QImage logo = Resource::loadImage( "launcher/opielogo" );
71// if ( !logo.isNull() ) 71// if ( !logo.isNull() )
72// p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo ); 72// p->drawImage( (width() - logo.width()) / 2, (height() - logo.height()) / 2, logo );
73} 73}
74// #endif 74// #endif
75 75
76 76
77void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { 77void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) {
78 if ( event->state() == QMouseEvent::LeftButton ) { 78 if ( event->state() == QMouseEvent::LeftButton ) {
79 QListViewItem *currentItem = selectedItem(); 79 QListViewItem *currentItem = selectedItem();
80 QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) ); 80 QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) );
@@ -175,32 +175,32 @@ bool PlayListSelection::last() {
175 175
176void PlayListSelection::unSelect() 176void PlayListSelection::unSelect()
177{ 177{
178 //QListViewItem *item = selectedItem(); 178 //QListViewItem *item = selectedItem();
179 setSelected( currentItem(), FALSE); 179 setSelected( currentItem(), FALSE);
180} 180}
181 181
182void PlayListSelection::writeCurrent( Config& cfg ) { 182void PlayListSelection::writeCurrent( Config& cfg ) {
183 cfg.setGroup("PlayList"); 183 cfg.setGroup("PlayList");
184 QListViewItem *item = selectedItem(); 184 QListViewItem *item = selectedItem();
185 if ( item ) 185 if ( item )
186 cfg.writeEntry("current", item->text(0) ); 186 cfg.writeEntry("current", item->text(0) );
187 qDebug(item->text(0)); 187 odebug << item->text(0) << oendl;
188 188
189} 189}
190 190
191void PlayListSelection::setSelectedItem(const QString &strk ) { 191void PlayListSelection::setSelectedItem(const QString &strk ) {
192 192
193 unSelect(); 193 unSelect();
194 QListViewItemIterator it( this ); 194 QListViewItemIterator it( this );
195 for ( ; it.current(); ++it ) { 195 for ( ; it.current(); ++it ) {
196// qDebug( it.current()->text(0)); 196// odebug << it.current()->text(0) << oendl;
197 if( strk == it.current()->text(0)) { 197 if( strk == it.current()->text(0)) {
198// qDebug( "We have a match "+strk); 198// odebug << "We have a match "+strk << oendl;
199 setSelected( it.current(), TRUE); 199 setSelected( it.current(), TRUE);
200 ensureItemVisible( it.current() ); 200 ensureItemVisible( it.current() );
201 return; 201 return;
202 } 202 }
203 } 203 }
204// setSelected( item, TRUE ); 204// setSelected( item, TRUE );
205// ensureItemVisible( selectedItem() ); 205// ensureItemVisible( selectedItem() );
206} 206}