author | zecke <zecke> | 2004-09-24 15:12:16 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-09-24 15:12:16 (UTC) |
commit | a214128c01e38ffd50edc4ed5b5c72593796eab2 (patch) (side-by-side diff) | |
tree | 7830f6c4052bc091eec065955427006fec3c4d50 | |
parent | 5ec51a8bb49a0a668bb2d7ab652a1a1e776a0e42 (diff) | |
download | opie-a214128c01e38ffd50edc4ed5b5c72593796eab2.zip opie-a214128c01e38ffd50edc4ed5b5c72593796eab2.tar.gz opie-a214128c01e38ffd50edc4ed5b5c72593796eab2.tar.bz2 |
-Save the State on deletion of the MediaPlayerState
-rw-r--r-- | noncore/multimedia/opieplayer2/mediaplayerstate.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp index 44bc46b..31773f2 100644 --- a/noncore/multimedia/opieplayer2/mediaplayerstate.cpp +++ b/noncore/multimedia/opieplayer2/mediaplayerstate.cpp @@ -30,48 +30,50 @@ Boston, MA 02111-1307, USA. */ // this file is based on work by trolltech #include <qpe/config.h> #include "mediaplayerstate.h" #include <assert.h> #define MediaPlayerDebug(x) MediaPlayerState::MediaPlayerState( QObject *parent, const char *name ) : QObject( parent, name ) { Config cfg( "OpiePlayer" ); readConfig( cfg ); streaming = false; seekable = true; } MediaPlayerState::~MediaPlayerState() { + Config cfg( "OpiePlayer" ); + writeConfig( cfg ); } void MediaPlayerState::readConfig( Config& cfg ) { cfg.setGroup("Options"); fullscreen = cfg.readBoolEntry( "FullScreen" ); scaled = cfg.readBoolEntry( "Scaling" ); looping = cfg.readBoolEntry( "Looping" ); shuffled = cfg.readBoolEntry( "Shuffle" ); videoGamma = cfg.readNumEntry( "VideoGamma" ); playing = FALSE; streaming = FALSE; paused = FALSE; curPosition = 0; curLength = 0; m_displayType = MediaSelection; } void MediaPlayerState::writeConfig( Config& cfg ) const { cfg.setGroup( "Options" ); cfg.writeEntry( "FullScreen", fullscreen ); cfg.writeEntry( "Scaling", scaled ); cfg.writeEntry( "Looping", looping ); @@ -236,24 +238,27 @@ void MediaPlayerState::toggleScaled() { } void MediaPlayerState::toggleLooping() { setLooping( !looping); } void MediaPlayerState::toggleShuffled() { setShuffled( !shuffled); } void MediaPlayerState::togglePaused() { setPaused( !paused); } void MediaPlayerState::togglePlaying() { setPlaying( !playing); } void MediaPlayerState::toggleBlank() { setBlanked( !blanked); } + + + |