[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeextragear-2/kmplayer/src
From:       Koos Vriezen <koos.vriezen () xs4all ! nl>
Date:       2005-02-14 18:37:11
Message-ID: 20050214183711.720931BC1B () office ! kde ! org
[Download RAW message or body]

CVS commit by vriezen: 

Like always w/ enterLoop, it will hunt you one day. Easily work arounded w/
calling stop() first, which blocks and process exit will clear vdr's command
queue. Leave the enterLoop in case process wont die, but remove it outside
the destructor as that one is called indirectly from widget destructors.


  M +3 -0      kmplayerapp.cpp   1.145
  M +4 -1      kmplayervdr.cpp   1.52
  M +1 -0      kmplayervdr.h   1.30


--- kdeextragear-2/kmplayer/src/kmplayerapp.cpp  #1.144:1.145
@@ -107,4 +107,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerApp::KMPlaye
 
 KDE_NO_CDTOR_EXPORT KMPlayerApp::~KMPlayerApp () {
+    // KMPlayerVDRSource has to wait for pending commands like mute and quit
+    m_player->stop ();
+    static_cast <KMPlayerVDRSource *> (m_player->sources () ["vdrsource"])->waitForConnectionClose ();
     delete m_broadcastconfig;
     if (!m_dcopName.isEmpty ()) {

--- kdeextragear-2/kmplayer/src/kmplayervdr.cpp  #1.51:1.52
@@ -145,5 +145,7 @@ KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::K
 }
 
-KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::~KMPlayerVDRSource () {
+KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::~KMPlayerVDRSource () {}
+
+KDE_NO_CDTOR_EXPORT void KMPlayerVDRSource::waitForConnectionClose () {
     if (timeout_timer) {
         finish_timer = startTimer (500);
@@ -151,4 +153,5 @@ KDE_NO_CDTOR_EXPORT KMPlayerVDRSource::~
         QApplication::eventLoop ()->enterLoop ();
         kdDebug () << "VDR connection:" << (m_socket->state () == QSocket::Connected) << endl;
+        timeout_timer = 0;
     }
 }

--- kdeextragear-2/kmplayer/src/kmplayervdr.h  #1.29:1.30
@@ -76,4 +76,5 @@ public:
     virtual void prefLocation (QString & item, QString & icon, QString & tab);
     virtual QFrame * prefPage (QWidget * parent);
+    void waitForConnectionClose ();
 public slots:
     void activate ();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic