summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2003-06-12 03:15:06 (UTC)
committer llornkcor <llornkcor>2003-06-12 03:15:06 (UTC)
commitd5fb55632847e18026506af6b482c2cd3def3222 (patch) (side-by-side diff)
treed2d5a3b1d4c3882f51c979562b35a44f021154f5
parentf0fab7d044feb2fe7f6a8c2a8d41653e1a17a538 (diff)
downloadopie-d5fb55632847e18026506af6b482c2cd3def3222.zip
opie-d5fb55632847e18026506af6b482c2cd3def3222.tar.gz
opie-d5fb55632847e18026506af6b482c2cd3def3222.tar.bz2
compile
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/embeddedkonsole/playlistselection.cpp28
-rw-r--r--core/apps/embeddedkonsole/playlistselection.h2
2 files changed, 15 insertions, 15 deletions
diff --git a/core/apps/embeddedkonsole/playlistselection.cpp b/core/apps/embeddedkonsole/playlistselection.cpp
index b9b9401..4dd3126 100644
--- a/core/apps/embeddedkonsole/playlistselection.cpp
+++ b/core/apps/embeddedkonsole/playlistselection.cpp
@@ -46,30 +46,30 @@ PlayListSelection::PlayListSelection( QWidget *parent, const char *name )
PlayListSelection::~PlayListSelection() {
}
void PlayListSelection::contentsMouseMoveEvent( QMouseEvent *event ) {
if ( event->state() == QMouseEvent::LeftButton ) {
- QListViewItem *currentItem = selectedItem();
- QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) );
- if ( currentItem && currentItem->itemAbove() == itemUnder )
- moveSelectedUp();
- else if ( currentItem && currentItem->itemBelow() == itemUnder )
- moveSelectedDown();
+ QListViewItem *currentItem = selectedItem();
+ QListViewItem *itemUnder = itemAt( QPoint( event->pos().x(), event->pos().y() - contentsY() ) );
+ if ( currentItem && currentItem->itemAbove() == itemUnder )
+ moveSelectedUp();
+ else if ( currentItem && currentItem->itemBelow() == itemUnder )
+ moveSelectedDown();
}
}
const QString *PlayListSelection::current() {
PlayListSelectionItem *item = (PlayListSelectionItem *)selectedItem();
if ( item )
- return item->file();
+ return item->file();
return NULL;
}
void PlayListSelection::addToSelection( QListViewItem *lnk ) {
PlayListSelectionItem *item = new PlayListSelectionItem( this, new QString( lnk->text(0) ) );
QListViewItem *current = selectedItem();
if ( current )
@@ -86,26 +86,26 @@ void PlayListSelection::addStringToSelection (const QString & lnk) {
setSelected( item, TRUE );
ensureItemVisible( selectedItem() );
}
void PlayListSelection::removeSelected() {
qDebug("removeSelected()");
QListViewItem *item = selectedItem();
if ( item )
- delete item;
+ delete item;
setSelected( currentItem(), TRUE );
ensureItemVisible( selectedItem() );
}
void PlayListSelection::moveSelectedUp() {
QListViewItem *item = selectedItem();
if ( item && item->itemAbove() )
- item->itemAbove()->moveItem( item );
+ item->itemAbove()->moveItem( item );
ensureItemVisible( selectedItem() );
}
void PlayListSelection::moveSelectedDown() {
QListViewItem *item = selectedItem();
if ( item && item->itemBelow() )
item->moveItem( item->itemBelow() );
@@ -113,49 +113,49 @@ void PlayListSelection::moveSelectedDown() {
}
bool PlayListSelection::prev() {
QListViewItem *item = selectedItem();
if ( item && item->itemAbove() )
setSelected( item->itemAbove(), TRUE );
else
- return FALSE;
+ return FALSE;
ensureItemVisible( selectedItem() );
return TRUE;
}
bool PlayListSelection::next() {
QListViewItem *item = selectedItem();
if ( item && item->itemBelow() )
setSelected( item->itemBelow(), TRUE );
else
- return FALSE;
+ return FALSE;
ensureItemVisible( selectedItem() );
return TRUE;
}
bool PlayListSelection::first() {
QListViewItem *item = firstChild();
if ( item )
setSelected( item, TRUE );
else
- return FALSE;
+ return FALSE;
ensureItemVisible( selectedItem() );
return TRUE;
}
bool PlayListSelection::last() {
QListViewItem *prevItem = NULL;
QListViewItem *item = firstChild();
while ( ( item = item->nextSibling() ) )
- prevItem = item;
+ prevItem = item;
if ( prevItem )
setSelected( prevItem, TRUE );
else
- return FALSE;
+ return FALSE;
ensureItemVisible( selectedItem() );
return TRUE;
}
diff --git a/core/apps/embeddedkonsole/playlistselection.h b/core/apps/embeddedkonsole/playlistselection.h
index c307f14..f340124 100644
--- a/core/apps/embeddedkonsole/playlistselection.h
+++ b/core/apps/embeddedkonsole/playlistselection.h
@@ -23,17 +23,17 @@
#include <qlist.h>
#include <qlistview.h>
#include <qpe/applnk.h>
class PlayListSelectionItem : public QListViewItem {
public:
PlayListSelectionItem( QListView *parent, QString *f ) : QListViewItem( parent ), fl( f ) {
- setText(0, *f );
+ setText(0, *f );
}
~PlayListSelectionItem() {
};
const QString *file() const { return fl; }
private: