Commit 4b0aa813 authored by Kevin Funk's avatar Kevin Funk
Browse files

Use NetworkAccessHelper in IMAP resource

svn path=/trunk/KDE/kdepim/runtime/; revision=1192573
parent 24d197c7
......@@ -43,7 +43,7 @@ set( libimapresource_SRCS
kde4_add_library(libimapresource STATIC ${libimapresource_SRCS})
target_link_libraries(libimapresource ${KDEPIMLIBS_AKONADI_LIBS} ${QT_QTDBUS_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${KDEPIMLIBS_KIMAP_LIBS} ${KDEPIMLIBS_MAILTRANSPORT_LIBS} ${KDE4_KIO_LIBS} ${KDEPIMLIBS_KMIME_LIBS} ${KDEPIMLIBS_AKONADI_KMIME_LIBS} ${KDEPIMLIBS_KPIMIDENTITIES_LIBS})
target_link_libraries(libimapresource ${KDEPIMLIBS_AKONADI_LIBS} ${QT_QTDBUS_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${KDEPIMLIBS_KIMAP_LIBS} ${KDEPIMLIBS_MAILTRANSPORT_LIBS} ${KDE4_KIO_LIBS} ${KDEPIMLIBS_KMIME_LIBS} ${KDEPIMLIBS_AKONADI_KMIME_LIBS} ${KDEPIMLIBS_KPIMIDENTITIES_LIBS} ${KDEPIMLIBS_KPIMUTILS_LIBS})
if( NOT IMAPRESOURCE_NO_SOLID)
target_link_libraries(libimapresource ${KDE4_SOLID_LIBS})
......
......@@ -33,6 +33,8 @@
#include <kimap/session.h>
#include <kimap/sessionuiproxy.h>
#include <kpimutils/networkaccesshelper.h>
#include "imapaccount.h"
#include "passwordrequesterinterface.h"
......@@ -44,7 +46,8 @@ SessionPool::SessionPool( int maxPoolSize, QObject *parent)
m_account( 0 ),
m_passwordRequester( 0 ),
m_initialConnectDone( false ),
m_pendingInitialSession( 0 )
m_pendingInitialSession( 0 ),
m_networkAccessHelper( new KPIMUtils::NetworkAccessHelper( this ) )
{
}
......@@ -89,6 +92,8 @@ bool SessionPool::connect( ImapAccount *account )
return false;
}
m_networkAccessHelper->establishConnection();
m_account = account;
#ifndef Q_OS_WINCE
if ( m_account->authenticationMode() == KIMAP::LoginJob::GSSAPI ) {
......@@ -114,6 +119,8 @@ void SessionPool::disconnect( SessionTermination termination )
return;
}
m_networkAccessHelper->releaseConnection();
foreach ( KIMAP::Session *s, m_idlePool+m_reservedPool ) {
killSession( s, termination );
}
......@@ -449,5 +456,3 @@ void SessionPool::onConnectionLost()
}
#include "sessionpool.moc"
......@@ -27,6 +27,7 @@
#include <kimap/listjob.h>
#include <kimap/sessionuiproxy.h>
#include <addemailaddressjob.h>
namespace KIMAP
{
......@@ -34,6 +35,10 @@ namespace KIMAP
class Session;
}
namespace KPIMUtils {
class NetworkAccessHelper;
}
class ImapAccount;
class PasswordRequesterInterface;
......@@ -118,6 +123,8 @@ private:
QStringList m_capabilities;
QList<KIMAP::MailBoxDescriptor> m_namespaces;
KPIMUtils::NetworkAccessHelper* m_networkAccessHelper;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment