author | llornkcor <llornkcor> | 2002-08-20 11:58:03 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-20 11:58:03 (UTC) |
commit | dfd3bcb3dd20cc72487c527d135e076a0ff78b25 (patch) (side-by-side diff) | |
tree | 0e26510735ca9c2b65e39e03ab56c77372de8d6a | |
parent | b00ba7b9cdf02a4512f70694e2262ce6e3ebcb98 (diff) | |
download | opie-dfd3bcb3dd20cc72487c527d135e076a0ff78b25.zip opie-dfd3bcb3dd20cc72487c527d135e076a0ff78b25.tar.gz opie-dfd3bcb3dd20cc72487c527d135e076a0ff78b25.tar.bz2 |
move configwrite to a better place not in deconstructor
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayer.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 2 |
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 @@ -280,20 +280,22 @@ void MediaPlayer::keyReleaseEvent( QKeyEvent *e) { case Key_F10: //contacts break; case Key_F11: //menu break; case Key_F12: //home qDebug("Blank here"); // mediaPlayerState->toggleBlank(); break; case Key_F13: //mail qDebug("Blank here"); // mediaPlayerState->toggleBlank(); break; } } void MediaPlayer::cleanUp() {// this happens on closing + Config cfg( "OpiePlayer" ); + playList->writeConfig( cfg ); // QPEApplication::grabKeyboard(); // QPEApplication::ungrabKeyboard(); } 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 @@ -294,35 +294,32 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) connect( mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); connect( mediaPlayerState, SIGNAL( playlistToggled( bool ) ), this, SLOT( setPlaylist( bool ) ) ); connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); setCentralWidget( vbox5 ); readConfig( cfg ); QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); loadList(DocLnk( currentPlaylist)); setCaption(tr("OpiePlayer: ")+ currentPlaylist ); initializeStates(); } PlayListWidget::~PlayListWidget() { - Config cfg( "OpiePlayer" ); - writeConfig( cfg ); - if ( d->current ) { delete d->current; } delete d; } void PlayListWidget::initializeStates() { d->tbPlay->setOn( mediaPlayerState->playing() ); d->tbLoop->setOn( mediaPlayerState->looping() ); d->tbShuffle->setOn( mediaPlayerState->shuffled() ); setPlaylist( true); } 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 @@ -35,49 +35,49 @@ public: QPopupMenu *pmView ; bool fromSetDocument; bool insanityBool; QString setDocFileRef; // retrieve the current playlist entry (media file link) const DocLnk *current(); void useSelectedDocument(); /* QTimer * menuTimer; */ FileSelector* playLists; QPushButton *tbDeletePlaylist; int selected; public slots: bool first(); bool last(); bool next(); bool prev(); + void writeConfig( Config& cfg ) const; /* void setFullScreen(); */ /* void setScaled(); */ protected: /* void contentsMousePressEvent( QMouseEvent * e ); */ /* void contentsMouseReleaseEvent( QMouseEvent * e ); */ void keyReleaseEvent( QKeyEvent *e); void keyPressEvent( QKeyEvent *e); private: int defaultSkinIndex; QPopupMenu *skinsMenu; bool audioScan, videoScan; void readm3u(const QString &); void readPls(const QString &); void initializeStates(); void readConfig( Config& cfg ); - void writeConfig( Config& cfg ) const; PlayListWidgetPrivate *d; // Private implementation data void populateAudioView(); void populateVideoView(); private slots: void populateSkinsMenu(); void skinsMenuActivated(int); void pmViewActivated(int); void writem3u(); void scanForAudio(); void scanForVideo(); void openFile(); void setDocument( const QString& fileref ); void addToSelection( const DocLnk& ); // Add a media file to the playlist void addToSelection( QListViewItem* ); // Add a media file to the playlist void setActiveWindow(); // need to handle this to show the right view void setPlaylist( bool ); // Show/Hide the playlist |