diff options
Diffstat (limited to 'examples/imapresource/imapserverproxy.h')
-rw-r--r-- | examples/imapresource/imapserverproxy.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/examples/imapresource/imapserverproxy.h b/examples/imapresource/imapserverproxy.h index 84343eb..a8d5ac1 100644 --- a/examples/imapresource/imapserverproxy.h +++ b/examples/imapresource/imapserverproxy.h | |||
@@ -171,6 +171,11 @@ public: | |||
171 | { | 171 | { |
172 | } | 172 | } |
173 | 173 | ||
174 | bool operator==(const CachedSession &other) const | ||
175 | { | ||
176 | return mSession && (mSession == other.mSession); | ||
177 | } | ||
178 | |||
174 | bool isConnected() | 179 | bool isConnected() |
175 | { | 180 | { |
176 | return (mSession->state() == KIMAP2::Session::State::Authenticated || mSession->state() == KIMAP2::Session::State::Selected) ; | 181 | return (mSession->state() == KIMAP2::Session::State::Authenticated || mSession->state() == KIMAP2::Session::State::Selected) ; |
@@ -191,6 +196,11 @@ class SessionCache : public QObject { | |||
191 | public: | 196 | public: |
192 | void recycleSession(const CachedSession &session) | 197 | void recycleSession(const CachedSession &session) |
193 | { | 198 | { |
199 | QObject::connect(session.mSession, &KIMAP2::Session::stateChanged, this, [this, session](KIMAP2::Session::State newState, KIMAP2::Session::State oldState) { | ||
200 | if (newState == KIMAP2::Session::Disconnected) { | ||
201 | mSessions.removeOne(session); | ||
202 | } | ||
203 | }); | ||
194 | mSessions << session; | 204 | mSessions << session; |
195 | } | 205 | } |
196 | 206 | ||