author | simon <simon> | 2002-12-02 17:10:14 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 17:10:14 (UTC) |
commit | e2e40368d1e98cfd3814e14a56c0e503d494cf4f (patch) (unidiff) | |
tree | 2dc59b9f4e5c5a8cd971934b1dd5976939bbac37 | |
parent | d86803bacac02ae99388cba069532851a5e08ce8 (diff) | |
download | opie-e2e40368d1e98cfd3814e14a56c0e503d494cf4f.zip opie-e2e40368d1e98cfd3814e14a56c0e503d494cf4f.tar.gz opie-e2e40368d1e98cfd3814e14a56c0e503d494cf4f.tar.bz2 |
- removed unused (and never initialized to something != 0)
PlayListWidgetPrivate::current
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidgetgui.h | 1 |
3 files changed, 1 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 55b66ab..6355bec 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -148,51 +148,48 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
148 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), | 148 | connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), |
149 | d->tbShuffle, SLOT( setOn( bool ) ) ); | 149 | d->tbShuffle, SLOT( setOn( bool ) ) ); |
150 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), | 150 | connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), |
151 | this, SLOT( setPlaylist( bool ) ) ); | 151 | this, SLOT( setPlaylist( bool ) ) ); |
152 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), | 152 | connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), |
153 | this, SLOT( playIt( QListViewItem *) ) ); | 153 | this, SLOT( playIt( QListViewItem *) ) ); |
154 | connect ( gammaSlider, SIGNAL( valueChanged( int ) ), | 154 | connect ( gammaSlider, SIGNAL( valueChanged( int ) ), |
155 | mediaPlayerState, SLOT( setVideoGamma( int ) ) ); | 155 | mediaPlayerState, SLOT( setVideoGamma( int ) ) ); |
156 | 156 | ||
157 | // see which skins are installed | 157 | // see which skins are installed |
158 | videoScan=false; | 158 | videoScan=false; |
159 | audioScan=false; | 159 | audioScan=false; |
160 | audioPopulated=false; | 160 | audioPopulated=false; |
161 | videoPopulated=false; | 161 | videoPopulated=false; |
162 | populateSkinsMenu(); | 162 | populateSkinsMenu(); |
163 | initializeStates(); | 163 | initializeStates(); |
164 | 164 | ||
165 | cfg.setGroup("PlayList"); | 165 | cfg.setGroup("PlayList"); |
166 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); | 166 | QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); |
167 | loadList(DocLnk( currentPlaylist ) ); | 167 | loadList(DocLnk( currentPlaylist ) ); |
168 | } | 168 | } |
169 | 169 | ||
170 | 170 | ||
171 | PlayListWidget::~PlayListWidget() { | 171 | PlayListWidget::~PlayListWidget() { |
172 | if ( d->current ) { | ||
173 | delete d->current; | ||
174 | } | ||
175 | delete d; | 172 | delete d; |
176 | } | 173 | } |
177 | 174 | ||
178 | 175 | ||
179 | void PlayListWidget::initializeStates() { | 176 | void PlayListWidget::initializeStates() { |
180 | d->tbPlay->setOn( mediaPlayerState->isPlaying() ); | 177 | d->tbPlay->setOn( mediaPlayerState->isPlaying() ); |
181 | d->tbLoop->setOn( mediaPlayerState->isLooping() ); | 178 | d->tbLoop->setOn( mediaPlayerState->isLooping() ); |
182 | d->tbShuffle->setOn( mediaPlayerState->isShuffled() ); | 179 | d->tbShuffle->setOn( mediaPlayerState->isShuffled() ); |
183 | setPlaylist( true ); | 180 | setPlaylist( true ); |
184 | } | 181 | } |
185 | 182 | ||
186 | void PlayListWidget::writeDefaultPlaylist() { | 183 | void PlayListWidget::writeDefaultPlaylist() { |
187 | 184 | ||
188 | Config config( "OpiePlayer" ); | 185 | Config config( "OpiePlayer" ); |
189 | config.setGroup( "PlayList" ); | 186 | config.setGroup( "PlayList" ); |
190 | QString filename=QPEApplication::documentDir() + "/default.m3u"; | 187 | QString filename=QPEApplication::documentDir() + "/default.m3u"; |
191 | QString currentString = config.readEntry( "CurrentPlaylist", filename); | 188 | QString currentString = config.readEntry( "CurrentPlaylist", filename); |
192 | if( currentString == filename) { | 189 | if( currentString == filename) { |
193 | Om3u *m3uList; | 190 | Om3u *m3uList; |
194 | // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); | 191 | // qDebug("<<<<<<<<<<<<<default>>>>>>>>>>>>>>>>>>>"); |
195 | if( d->selectedFiles->first() ) { | 192 | if( d->selectedFiles->first() ) { |
196 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); | 193 | m3uList = new Om3u(filename, IO_ReadWrite | IO_Truncate); |
197 | do { | 194 | do { |
198 | // qDebug(d->selectedFiles->current()->file()); | 195 | // qDebug(d->selectedFiles->current()->file()); |
@@ -407,52 +404,50 @@ void PlayListWidget::setDocument( const QString& fileref ) { | |||
407 | readPls( fileref ); | 404 | readPls( fileref ); |
408 | } else if( DocLnk( fileref).file().find( "pls", 0, TRUE) != -1 ) { | 405 | } else if( DocLnk( fileref).file().find( "pls", 0, TRUE) != -1 ) { |
409 | readPls( DocLnk( fileref).file() ); | 406 | readPls( DocLnk( fileref).file() ); |
410 | } else { | 407 | } else { |
411 | clearList(); | 408 | clearList(); |
412 | addToSelection( DocLnk( fileref ) ); | 409 | addToSelection( DocLnk( fileref ) ); |
413 | writeCurrentM3u(); | 410 | writeCurrentM3u(); |
414 | 411 | ||
415 | d->setDocumentUsed = TRUE; | 412 | d->setDocumentUsed = TRUE; |
416 | mediaPlayerState->setPlaying( FALSE ); | 413 | mediaPlayerState->setPlaying( FALSE ); |
417 | mediaPlayerState->setPlaying( TRUE ); | 414 | mediaPlayerState->setPlaying( TRUE ); |
418 | } | 415 | } |
419 | } | 416 | } |
420 | 417 | ||
421 | 418 | ||
422 | void PlayListWidget::useSelectedDocument() { | 419 | void PlayListWidget::useSelectedDocument() { |
423 | d->setDocumentUsed = FALSE; | 420 | d->setDocumentUsed = FALSE; |
424 | } | 421 | } |
425 | 422 | ||
426 | 423 | ||
427 | const DocLnk *PlayListWidget::current() const { // this is fugly | 424 | const DocLnk *PlayListWidget::current() const { // this is fugly |
428 | assert( currentTab() == CurrentPlayList ); | 425 | assert( currentTab() == CurrentPlayList ); |
429 | 426 | ||
430 | // qDebug("playlist"); | 427 | // qDebug("playlist"); |
431 | if ( mediaPlayerState->isUsingPlaylist() ) { | 428 | if ( mediaPlayerState->isUsingPlaylist() ) |
432 | return d->selectedFiles->current(); | 429 | return d->selectedFiles->current(); |
433 | } else if ( d->setDocumentUsed && d->current ) | ||
434 | return d->current; | ||
435 | 430 | ||
436 | assert( false ); | 431 | assert( false ); |
437 | } | 432 | } |
438 | 433 | ||
439 | 434 | ||
440 | bool PlayListWidget::prev() { | 435 | bool PlayListWidget::prev() { |
441 | if ( mediaPlayerState->isUsingPlaylist() ) { | 436 | if ( mediaPlayerState->isUsingPlaylist() ) { |
442 | if ( mediaPlayerState->isShuffled() ) { | 437 | if ( mediaPlayerState->isShuffled() ) { |
443 | const DocLnk *cur = current(); | 438 | const DocLnk *cur = current(); |
444 | int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0)); | 439 | int j = 1 + (int)(97.0 * rand() / (RAND_MAX + 1.0)); |
445 | for ( int i = 0; i < j; i++ ) { | 440 | for ( int i = 0; i < j; i++ ) { |
446 | if ( !d->selectedFiles->next() ) | 441 | if ( !d->selectedFiles->next() ) |
447 | d->selectedFiles->first(); | 442 | d->selectedFiles->first(); |
448 | } | 443 | } |
449 | if ( cur == current() ) | 444 | if ( cur == current() ) |
450 | if ( !d->selectedFiles->next() ) { | 445 | if ( !d->selectedFiles->next() ) { |
451 | d->selectedFiles->first(); | 446 | d->selectedFiles->first(); |
452 | } | 447 | } |
453 | return TRUE; | 448 | return TRUE; |
454 | } else { | 449 | } else { |
455 | if ( !d->selectedFiles->prev() ) { | 450 | if ( !d->selectedFiles->prev() ) { |
456 | if ( mediaPlayerState->isLooping() ) { | 451 | if ( mediaPlayerState->isLooping() ) { |
457 | return d->selectedFiles->last(); | 452 | return d->selectedFiles->last(); |
458 | } else { | 453 | } else { |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index a217c94..db7c979 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -45,49 +45,48 @@ | |||
45 | #include <qaction.h> | 45 | #include <qaction.h> |
46 | #include <qcursor.h> | 46 | #include <qcursor.h> |
47 | #include <qdir.h> | 47 | #include <qdir.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | 49 | ||
50 | #include "playlistselection.h" | 50 | #include "playlistselection.h" |
51 | #include "playlistwidget.h" | 51 | #include "playlistwidget.h" |
52 | #include "mediaplayerstate.h" | 52 | #include "mediaplayerstate.h" |
53 | #include "inputDialog.h" | 53 | #include "inputDialog.h" |
54 | 54 | ||
55 | //only needed for the random play | 55 | //only needed for the random play |
56 | #include <stdlib.h> | 56 | #include <stdlib.h> |
57 | 57 | ||
58 | #include "audiowidget.h" | 58 | #include "audiowidget.h" |
59 | #include "videowidget.h" | 59 | #include "videowidget.h" |
60 | #include "mediaplayerstate.h" | 60 | #include "mediaplayerstate.h" |
61 | 61 | ||
62 | extern MediaPlayerState *mediaPlayerState; | 62 | extern MediaPlayerState *mediaPlayerState; |
63 | 63 | ||
64 | PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags fl ) | 64 | PlayListWidgetGui::PlayListWidgetGui( QWidget* parent, const char* name, WFlags fl ) |
65 | : QMainWindow( parent, name, fl ) { | 65 | : QMainWindow( parent, name, fl ) { |
66 | 66 | ||
67 | d = new PlayListWidgetPrivate; | 67 | d = new PlayListWidgetPrivate; |
68 | d->setDocumentUsed = FALSE; | 68 | d->setDocumentUsed = FALSE; |
69 | d->current = NULL; | ||
70 | 69 | ||
71 | setBackgroundMode( PaletteButton ); | 70 | setBackgroundMode( PaletteButton ); |
72 | setToolBarsMovable( FALSE ); | 71 | setToolBarsMovable( FALSE ); |
73 | 72 | ||
74 | // Create Toolbar | 73 | // Create Toolbar |
75 | QPEToolBar *toolbar = new QPEToolBar( this ); | 74 | QPEToolBar *toolbar = new QPEToolBar( this ); |
76 | toolbar->setHorizontalStretchable( TRUE ); | 75 | toolbar->setHorizontalStretchable( TRUE ); |
77 | 76 | ||
78 | // Create Menubar | 77 | // Create Menubar |
79 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); | 78 | QPEMenuBar *menu = new QPEMenuBar( toolbar ); |
80 | menu->setMargin( 0 ); | 79 | menu->setMargin( 0 ); |
81 | 80 | ||
82 | bar = new QPEToolBar( this ); | 81 | bar = new QPEToolBar( this ); |
83 | bar->setLabel( tr( "Play Operations" ) ); | 82 | bar->setLabel( tr( "Play Operations" ) ); |
84 | 83 | ||
85 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); | 84 | tbDeletePlaylist = new QPushButton( Resource::loadIconSet( "trash" ), "", bar, "close" ); |
86 | tbDeletePlaylist->setFlat( TRUE ); | 85 | tbDeletePlaylist->setFlat( TRUE ); |
87 | tbDeletePlaylist->setFixedSize( 20, 20 ); | 86 | tbDeletePlaylist->setFixedSize( 20, 20 ); |
88 | 87 | ||
89 | tbDeletePlaylist->hide(); | 88 | tbDeletePlaylist->hide(); |
90 | 89 | ||
91 | pmPlayList = new QPopupMenu( this ); | 90 | pmPlayList = new QPopupMenu( this ); |
92 | menu->insertItem( tr( "File" ), pmPlayList ); | 91 | menu->insertItem( tr( "File" ), pmPlayList ); |
93 | 92 | ||
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.h b/noncore/multimedia/opieplayer2/playlistwidgetgui.h index 6c35771..4eefb93 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.h +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.h | |||
@@ -43,49 +43,48 @@ | |||
43 | #include <qpe/fileselector.h> | 43 | #include <qpe/fileselector.h> |
44 | #include <qpushbutton.h> | 44 | #include <qpushbutton.h> |
45 | #include <qpopupmenu.h> | 45 | #include <qpopupmenu.h> |
46 | #include <qaction.h> | 46 | #include <qaction.h> |
47 | #include <qslider.h> | 47 | #include <qslider.h> |
48 | #include <qlcdnumber.h> | 48 | #include <qlcdnumber.h> |
49 | 49 | ||
50 | class PlayListWidgetPrivate; | 50 | class PlayListWidgetPrivate; |
51 | class PlayListSelection; | 51 | class PlayListSelection; |
52 | 52 | ||
53 | class Config; | 53 | class Config; |
54 | class QPEToolBar; | 54 | class QPEToolBar; |
55 | class QListViewItem; | 55 | class QListViewItem; |
56 | class QListView; | 56 | class QListView; |
57 | class QPoint; | 57 | class QPoint; |
58 | class QAction; | 58 | class QAction; |
59 | class QLabel; | 59 | class QLabel; |
60 | 60 | ||
61 | class PlayListWidgetPrivate { | 61 | class PlayListWidgetPrivate { |
62 | public: | 62 | public: |
63 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; | 63 | QToolButton *tbPlay, *tbFull, *tbLoop, *tbShuffle, *tbAddToList, *tbRemoveFromList, *tbMoveUp, *tbMoveDown, *tbRemove; |
64 | QFrame *playListFrame; | 64 | QFrame *playListFrame; |
65 | PlayListSelection *selectedFiles; | 65 | PlayListSelection *selectedFiles; |
66 | bool setDocumentUsed; | 66 | bool setDocumentUsed; |
67 | DocLnk *current; | ||
68 | }; | 67 | }; |
69 | 68 | ||
70 | 69 | ||
71 | class ToolButton : public QToolButton { | 70 | class ToolButton : public QToolButton { |
72 | public: | 71 | public: |
73 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) | 72 | ToolButton( QWidget *parent, const char *name, const QString& icon, QObject *handler, const QString& slot, bool t = FALSE ) |
74 | : QToolButton( parent, name ) { | 73 | : QToolButton( parent, name ) { |
75 | setTextLabel( name ); | 74 | setTextLabel( name ); |
76 | setPixmap( Resource::loadPixmap( icon ) ); | 75 | setPixmap( Resource::loadPixmap( icon ) ); |
77 | setAutoRaise( TRUE ); | 76 | setAutoRaise( TRUE ); |
78 | setFocusPolicy( QWidget::NoFocus ); | 77 | setFocusPolicy( QWidget::NoFocus ); |
79 | setToggleButton( t ); | 78 | setToggleButton( t ); |
80 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); | 79 | connect( this, t ? SIGNAL( toggled(bool) ) : SIGNAL( clicked() ), handler, slot ); |
81 | QPEMenuToolFocusManager::manager()->addWidget( this ); | 80 | QPEMenuToolFocusManager::manager()->addWidget( this ); |
82 | } | 81 | } |
83 | }; | 82 | }; |
84 | 83 | ||
85 | 84 | ||
86 | class MenuItem : public QAction { | 85 | class MenuItem : public QAction { |
87 | 86 | ||
88 | public: | 87 | public: |
89 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) | 88 | MenuItem( QWidget *parent, const QString& text, QObject *handler, const QString& slot ) |
90 | : QAction( text, QString::null, 0, 0 ) { | 89 | : QAction( text, QString::null, 0, 0 ) { |
91 | connect( this, SIGNAL( activated() ), handler, slot ); | 90 | connect( this, SIGNAL( activated() ), handler, slot ); |