summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/playlistwidget.cpp
authorsimon <simon>2002-12-02 14:51:53 (UTC)
committer simon <simon>2002-12-02 14:51:53 (UTC)
commitf90e42128a496a0fb5a67c3148c30ef46092624b (patch) (unidiff)
tree8c0f0bee0fd71536c70c751d29ef9114e4313437 /noncore/multimedia/opieplayer2/playlistwidget.cpp
parent3644bde7c86013c699978446c29ec6502220e29c (diff)
downloadopie-f90e42128a496a0fb5a67c3148c30ef46092624b.zip
opie-f90e42128a496a0fb5a67c3148c30ef46092624b.tar.gz
opie-f90e42128a496a0fb5a67c3148c30ef46092624b.tar.bz2
- added currentFileListView() method that returns the current file list
qlistview object and simplified currentFileListPathName with that
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index a708cf6..92da73b 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -780,24 +780,33 @@ void PlayListWidget::populateVideoView() {
780 780
781 QListViewItem * newItem; 781 QListViewItem * newItem;
782 if ( QFile( Vdit.current()->file() ).exists() ) { 782 if ( QFile( Vdit.current()->file() ).exists() ) {
783 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), 783 newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(),
784 QString::number( QFile( Vdit.current()->file() ).size() ), 784 QString::number( QFile( Vdit.current()->file() ).size() ),
785 ""/*storage*/, Vdit.current()->file()); 785 ""/*storage*/, Vdit.current()->file());
786 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); 786 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) );
787 } 787 }
788 } 788 }
789 videoPopulated=true; 789 videoPopulated=true;
790} 790}
791 791
792QListView *PlayListWidget::currentFileListView() const
793{
794 switch ( currentTab() ) {
795 case AudioFiles: return audioView;
796 case VideoFiles: return videoView;
797 default: assert( false );
798 }
799 return 0;
800}
792 801
793void PlayListWidget::openFile() { 802void PlayListWidget::openFile() {
794 // http://66.28.164.33:2080 803 // http://66.28.164.33:2080
795 // http://somafm.com/star0242.m3u 804 // http://somafm.com/star0242.m3u
796 QString filename, name; 805 QString filename, name;
797 InputDialog *fileDlg; 806 InputDialog *fileDlg;
798 fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); 807 fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0);
799 fileDlg->exec(); 808 fileDlg->exec();
800 if( fileDlg->result() == 1 ) { 809 if( fileDlg->result() == 1 ) {
801 filename = fileDlg->text(); 810 filename = fileDlg->text();
802 qDebug( "Selected filename is " + filename ); 811 qDebug( "Selected filename is " + filename );
803 // Om3u *m3uList; 812 // Om3u *m3uList;
@@ -1144,21 +1153,14 @@ int PlayListWidget::whichList() const {
1144PlayListWidget::TabType PlayListWidget::currentTab() const 1153PlayListWidget::TabType PlayListWidget::currentTab() const
1145{ 1154{
1146 static const TabType indexToTabType[ NumTabTypes ] = 1155 static const TabType indexToTabType[ NumTabTypes ] =
1147 { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; 1156 { CurrentPlayList, AudioFiles, VideoFiles, PlayLists };
1148 1157
1149 int index = tabWidget->currentPageIndex(); 1158 int index = tabWidget->currentPageIndex();
1150 assert( index < NumTabTypes && index >= 0 ); 1159 assert( index < NumTabTypes && index >= 0 );
1151 1160
1152 return indexToTabType[ index ]; 1161 return indexToTabType[ index ];
1153} 1162}
1154 1163
1155QString PlayListWidget::currentFileListPathName() const { 1164QString PlayListWidget::currentFileListPathName() const {
1156 switch (currentTab()) { 1165 return currentFileListView()->currentItem()->text( 3 );
1157 case AudioFiles:
1158 return audioView->currentItem()->text(3);
1159 case VideoFiles:
1160 return videoView->currentItem()->text(3);
1161 default: assert( false );
1162 };
1163 return QString::null;
1164} 1166}