summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-11-11 13:37:16 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-11-11 13:37:16 (GMT)
commit3f7b06aea7ffb2b12cb4593567e1793bbbcb0916 (patch)
treedd8aace6e650720f78d31d5a333823028b75c70a
parent5b62b9e7555fd1f55325dd40b6af33f7d247156a (diff)
downloadkolab-utils-3f7b06aea7ffb2b12cb4593567e1793bbbcb0916.tar.gz
Detect if the imap account disconnects.
-rw-r--r--migrationutility/imapsourceaccount.cpp7
-rw-r--r--migrationutility/imapsourceaccount.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/migrationutility/imapsourceaccount.cpp b/migrationutility/imapsourceaccount.cpp
index 91a4e2b..3e470e6 100644
--- a/migrationutility/imapsourceaccount.cpp
+++ b/migrationutility/imapsourceaccount.cpp
@@ -158,9 +158,16 @@ void IMAPSourceAccount::prepareConnection(QString host, qint16 port, const QStri
mAuthenticationMode = authenticationMode;
}
+void IMAPSourceAccount::onSessionStateChanged(KIMAP::Session::State oldstate, KIMAP::Session::State newstate)
+{
+ Debug() << "session state changed " << oldstate << newstate;
+}
+
KJob *IMAPSourceAccount::login()
{
mSession = createSession(mHost, mPort, this);
+ QObject::connect(mSession, SIGNAL(stateChanged(KIMAP::Session::State,KIMAP::Session::State)),
+ this, SLOT(onSessionStateChanged(KIMAP::Session::State,KIMAP::Session::State)) );
KIMAP::LoginJob *loginJob = new KIMAP::LoginJob(mSession);
if (mAuthorizationName != mUsername) {
diff --git a/migrationutility/imapsourceaccount.h b/migrationutility/imapsourceaccount.h
index 53f51cb..0777f0d 100644
--- a/migrationutility/imapsourceaccount.h
+++ b/migrationutility/imapsourceaccount.h
@@ -42,6 +42,7 @@ public:
private slots:
void mailBoxesReceived(const QList<KIMAP::MailBoxDescriptor> &descriptors, const QList< QList< QByteArray > > &flags);
+ void onSessionStateChanged(KIMAP::Session::State,KIMAP::Session::State);
protected:
//get namespace