summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-08-20 11:58:03 (UTC)
committer llornkcor <llornkcor>2002-08-20 11:58:03 (UTC)
commitdfd3bcb3dd20cc72487c527d135e076a0ff78b25 (patch) (unidiff)
tree0e26510735ca9c2b65e39e03ab56c77372de8d6a
parentb00ba7b9cdf02a4512f70694e2262ce6e3ebcb98 (diff)
downloadopie-dfd3bcb3dd20cc72487c527d135e076a0ff78b25.zip
opie-dfd3bcb3dd20cc72487c527d135e076a0ff78b25.tar.gz
opie-dfd3bcb3dd20cc72487c527d135e076a0ff78b25.tar.bz2
move configwrite to a better place not in deconstructor
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/mediaplayer.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp3
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h2
3 files changed, 3 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayer.cpp b/noncore/multimedia/opieplayer2/mediaplayer.cpp
index 6a48b82..0526c2a 100644
--- a/noncore/multimedia/opieplayer2/mediaplayer.cpp
+++ b/noncore/multimedia/opieplayer2/mediaplayer.cpp
@@ -284,16 +284,18 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) {
284 case Key_F12: //home 284 case Key_F12: //home
285 qDebug("Blank here"); 285 qDebug("Blank here");
286// mediaPlayerState->toggleBlank(); 286// mediaPlayerState->toggleBlank();
287 break; 287 break;
288 case Key_F13: //mail 288 case Key_F13: //mail
289 qDebug("Blank here"); 289 qDebug("Blank here");
290 // mediaPlayerState->toggleBlank(); 290 // mediaPlayerState->toggleBlank();
291 break; 291 break;
292 } 292 }
293} 293}
294 294
295void MediaPlayer::cleanUp() {// this happens on closing 295void MediaPlayer::cleanUp() {// this happens on closing
296 Config cfg( "OpiePlayer" );
297 playList->writeConfig( cfg );
296 298
297// QPEApplication::grabKeyboard(); 299// QPEApplication::grabKeyboard();
298// QPEApplication::ungrabKeyboard(); 300// QPEApplication::ungrabKeyboard();
299} 301}
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 404e1fe..bc9b166 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -298,27 +298,24 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
298 setCentralWidget( vbox5 ); 298 setCentralWidget( vbox5 );
299 299
300 readConfig( cfg ); 300 readConfig( cfg );
301 QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); 301 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
302 loadList(DocLnk( currentPlaylist)); 302 loadList(DocLnk( currentPlaylist));
303 setCaption(tr("OpiePlayer: ")+ currentPlaylist ); 303 setCaption(tr("OpiePlayer: ")+ currentPlaylist );
304 304
305 initializeStates(); 305 initializeStates();
306} 306}
307 307
308 308
309PlayListWidget::~PlayListWidget() { 309PlayListWidget::~PlayListWidget() {
310 Config cfg( "OpiePlayer" );
311 writeConfig( cfg );
312
313 if ( d->current ) { 310 if ( d->current ) {
314 delete d->current; 311 delete d->current;
315 } 312 }
316 delete d; 313 delete d;
317} 314}
318 315
319 316
320void PlayListWidget::initializeStates() { 317void PlayListWidget::initializeStates() {
321 318
322 d->tbPlay->setOn( mediaPlayerState->playing() ); 319 d->tbPlay->setOn( mediaPlayerState->playing() );
323 d->tbLoop->setOn( mediaPlayerState->looping() ); 320 d->tbLoop->setOn( mediaPlayerState->looping() );
324 d->tbShuffle->setOn( mediaPlayerState->shuffled() ); 321 d->tbShuffle->setOn( mediaPlayerState->shuffled() );
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 8076707..8710a99 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -39,41 +39,41 @@ public:
39 // retrieve the current playlist entry (media file link) 39 // retrieve the current playlist entry (media file link)
40 const DocLnk *current(); 40 const DocLnk *current();
41 void useSelectedDocument(); 41 void useSelectedDocument();
42/* QTimer * menuTimer; */ 42/* QTimer * menuTimer; */
43 FileSelector* playLists; 43 FileSelector* playLists;
44 QPushButton *tbDeletePlaylist; 44 QPushButton *tbDeletePlaylist;
45 int selected; 45 int selected;
46public slots: 46public slots:
47 bool first(); 47 bool first();
48 bool last(); 48 bool last();
49 bool next(); 49 bool next();
50 bool prev(); 50 bool prev();
51 void writeConfig( Config& cfg ) const;
51/* void setFullScreen(); */ 52/* void setFullScreen(); */
52/* void setScaled(); */ 53/* void setScaled(); */
53protected: 54protected:
54/* void contentsMousePressEvent( QMouseEvent * e ); */ 55/* void contentsMousePressEvent( QMouseEvent * e ); */
55/* void contentsMouseReleaseEvent( QMouseEvent * e ); */ 56/* void contentsMouseReleaseEvent( QMouseEvent * e ); */
56void keyReleaseEvent( QKeyEvent *e); 57void keyReleaseEvent( QKeyEvent *e);
57void keyPressEvent( QKeyEvent *e); 58void keyPressEvent( QKeyEvent *e);
58private: 59private:
59 int defaultSkinIndex; 60 int defaultSkinIndex;
60 QPopupMenu *skinsMenu; 61 QPopupMenu *skinsMenu;
61 bool audioScan, videoScan; 62 bool audioScan, videoScan;
62 void readm3u(const QString &); 63 void readm3u(const QString &);
63 void readPls(const QString &); 64 void readPls(const QString &);
64 65
65 void initializeStates(); 66 void initializeStates();
66 void readConfig( Config& cfg ); 67 void readConfig( Config& cfg );
67 void writeConfig( Config& cfg ) const;
68 PlayListWidgetPrivate *d; // Private implementation data 68 PlayListWidgetPrivate *d; // Private implementation data
69 void populateAudioView(); 69 void populateAudioView();
70 void populateVideoView(); 70 void populateVideoView();
71private slots: 71private slots:
72 void populateSkinsMenu(); 72 void populateSkinsMenu();
73 void skinsMenuActivated(int); 73 void skinsMenuActivated(int);
74 void pmViewActivated(int); 74 void pmViewActivated(int);
75 void writem3u(); 75 void writem3u();
76 void scanForAudio(); 76 void scanForAudio();
77 void scanForVideo(); 77 void scanForVideo();
78 void openFile(); 78 void openFile();
79 void setDocument( const QString& fileref ); 79 void setDocument( const QString& fileref );