Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistselection.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistselection.cpp | 10 |
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 | |||
@@ -31,54 +31,54 @@ public: | |||
31 | setPixmap( 0, f->pixmap() ); | 31 | setPixmap( 0, f->pixmap() ); |
32 | } | 32 | } |
33 | 33 | ||
34 | ~PlayListSelectionItem() { | 34 | ~PlayListSelectionItem() { |
35 | }; | 35 | }; |
36 | 36 | ||
37 | const DocLnk *file() const { return fl; } | 37 | const DocLnk *file() const { return fl; } |
38 | 38 | ||
39 | private: | 39 | private: |
40 | const DocLnk *fl; | 40 | const DocLnk *fl; |
41 | }; | 41 | }; |
42 | 42 | ||
43 | 43 | ||
44 | PlayListSelection::PlayListSelection( QWidget *parent, const char *name ) | 44 | PlayListSelection::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 | ||
62 | PlayListSelection::~PlayListSelection() { | 62 | PlayListSelection::~PlayListSelection() { |
63 | } | 63 | } |
64 | 64 | ||
65 | 65 | ||
66 | // #ifdef USE_PLAYLIST_BACKGROUND | 66 | // #ifdef USE_PLAYLIST_BACKGROUND |
67 | void PlayListSelection::drawBackground( QPainter *p, const QRect &r ) { | 67 | void 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 | ||
77 | void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) { | 77 | void 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() ) ); |
81 | if ( currentItem && currentItem->itemAbove() == itemUnder ) | 81 | if ( currentItem && currentItem->itemAbove() == itemUnder ) |
82 | moveSelectedUp(); | 82 | moveSelectedUp(); |
83 | else if ( currentItem && currentItem->itemBelow() == itemUnder ) | 83 | else if ( currentItem && currentItem->itemBelow() == itemUnder ) |
84 | moveSelectedDown(); | 84 | moveSelectedDown(); |
@@ -171,36 +171,36 @@ bool PlayListSelection::last() { | |||
171 | return FALSE; | 171 | return FALSE; |
172 | ensureItemVisible( selectedItem() ); | 172 | ensureItemVisible( selectedItem() ); |
173 | return TRUE; | 173 | return TRUE; |
174 | } | 174 | } |
175 | 175 | ||
176 | void PlayListSelection::unSelect() | 176 | void PlayListSelection::unSelect() |
177 | { | 177 | { |
178 | //QListViewItem *item = selectedItem(); | 178 | //QListViewItem *item = selectedItem(); |
179 | setSelected( currentItem(), FALSE); | 179 | setSelected( currentItem(), FALSE); |
180 | } | 180 | } |
181 | 181 | ||
182 | void PlayListSelection::writeCurrent( Config& cfg ) { | 182 | void 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 | ||
191 | void PlayListSelection::setSelectedItem(const QString &strk ) { | 191 | void 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 | } |