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

List:       kde-commits
Subject:    [kdepimlibs/4.7] kimap: KIMAP::Session: When closing the session,
From:       Gregory Schlomoff <gregory.schlomoff () gmail ! com>
Date:       2011-08-31 22:00:18
Message-ID: 20110831220018.2B319A6078 () git ! kde ! org
[Download RAW message or body]

Git commit 3a68e043ebbd1f36b601acb28e6802a881aa32e2 by Gregory Schlomoff.
Committed on 17/08/2011 at 23:56.
Pushed by schlomoff into branch '4.7'.

KIMAP::Session: When closing the session, don't call socketDisconnected()
directly. Instead, close the socket, and this will in turn call
socketDisconnected. Otherwise, socketDisconnected end up being called twice.

M  +3    -5    kimap/session.cpp

http://commits.kde.org/kdepimlibs/3a68e043ebbd1f36b601acb28e6802a881aa32e2

diff --git a/kimap/session.cpp b/kimap/session.cpp
index 78a2852..10abac0 100644
--- a/kimap/session.cpp
+++ b/kimap/session.cpp
@@ -110,7 +110,7 @@ int Session::jobQueueSize() const
 
 void KIMAP::Session::close()
 {
-  d->socketDisconnected();
+  d->thread->closeSocket();
 }
 
 void SessionPrivate::handleSslError(const KSslErrorUiData& errorData)
@@ -367,7 +367,6 @@ void SessionPrivate::socketDisconnected()
   }
 
   isSocketConnected = false;
-  thread->closeSocket();
 
   clearJobQueue();
 }
@@ -379,7 +378,7 @@ void SessionPrivate::socketError()
   }
 
   if ( isSocketConnected ) {
-    socketDisconnected();
+    thread->closeSocket();
   } else {
     emit q->connectionFailed();
     emit q->connectionLost();    // KDE5: Remove this. We shouldn't emit \
connectionLost() if we weren't connected in the first place @@ -465,7 +464,6 @@ void \
SessionPrivate::stopSocketTimer()  if ( socketTimerInterval<0 ) {
     return;
   }
-  Q_ASSERT( socketTimer.isActive() );
 
   socketTimer.stop();
 
@@ -483,7 +481,7 @@ void SessionPrivate::restartSocketTimer()
 
 void SessionPrivate::onSocketTimeout()
 {
-  socketDisconnected();
+  thread->closeSocket();
 }
 
 void Session::setTimeout( int timeout )


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

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