Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistfileview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistfileview.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.cpp b/noncore/multimedia/opieplayer2/playlistfileview.cpp index cb16415..3ef4d03 100644 --- a/noncore/multimedia/opieplayer2/playlistfileview.cpp +++ b/noncore/multimedia/opieplayer2/playlistfileview.cpp | |||
@@ -16,18 +16,30 @@ PlayListFileView::PlayListFileView( const QString &mimeTypePattern, const QStrin | |||
16 | setColumnAlignment( 1, Qt::AlignRight ); | 16 | setColumnAlignment( 1, Qt::AlignRight ); |
17 | setColumnAlignment( 2, Qt::AlignRight ); | 17 | setColumnAlignment( 2, Qt::AlignRight ); |
18 | setAllColumnsShowFocus( TRUE ); | 18 | setAllColumnsShowFocus( TRUE ); |
19 | setSorting( 3, TRUE ); | 19 | setSorting( 3, TRUE ); |
20 | setMultiSelection( TRUE ); | 20 | setMultiSelection( TRUE ); |
21 | setSelectionMode( QListView::Extended ); | 21 | setSelectionMode( QListView::Extended ); |
22 | |||
23 | connect( this, SIGNAL( selectionChanged() ), | ||
24 | this, SLOT( checkSelection() ) ); | ||
22 | } | 25 | } |
23 | 26 | ||
24 | PlayListFileView::~PlayListFileView() | 27 | PlayListFileView::~PlayListFileView() |
25 | { | 28 | { |
26 | } | 29 | } |
27 | 30 | ||
31 | bool PlayListFileView::hasSelection() const | ||
32 | { | ||
33 | for ( QListViewItemIterator it( const_cast<PlayListFileView *>( this ) ); it.current(); ++it ) | ||
34 | if ( it.current()->isSelected() ) | ||
35 | return true; | ||
36 | |||
37 | return false; | ||
38 | } | ||
39 | |||
28 | void PlayListFileView::scanFiles() | 40 | void PlayListFileView::scanFiles() |
29 | { | 41 | { |
30 | m_files.detachChildren(); | 42 | m_files.detachChildren(); |
31 | QListIterator<DocLnk> sdit( m_files.children() ); | 43 | QListIterator<DocLnk> sdit( m_files.children() ); |
32 | for ( ; sdit.current(); ++sdit ) | 44 | for ( ; sdit.current(); ++sdit ) |
33 | delete sdit.current(); | 45 | delete sdit.current(); |
@@ -71,8 +83,13 @@ void PlayListFileView::populateView() | |||
71 | dit.current()->file() ); | 83 | dit.current()->file() ); |
72 | newItem->setPixmap( 0, Resource::loadPixmap( m_itemPixmapName ) ); | 84 | newItem->setPixmap( 0, Resource::loadPixmap( m_itemPixmapName ) ); |
73 | } | 85 | } |
74 | } | 86 | } |
75 | } | 87 | } |
76 | 88 | ||
89 | void PlayListFileView::checkSelection() | ||
90 | { | ||
91 | emit itemsSelected( hasSelection() ); | ||
92 | } | ||
93 | |||
77 | /* vim: et sw=4 ts=4 | 94 | /* vim: et sw=4 ts=4 |
78 | */ | 95 | */ |