summaryrefslogtreecommitdiffstats
path: root/kmail/accountmanager.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-16 01:50:36 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-12-16 01:50:36 +0000
commitd4b702756e673463c9fc008bc6e5931aac6a9011 (patch)
tree56d925d93b2b1468fdcf6b55fbdd5bad008f74c6 /kmail/accountmanager.cpp
parent460c52653ab0dcca6f19a4f492ed2c5e4e963ab0 (diff)
downloadtdepim-d4b702756e673463c9fc008bc6e5931aac6a9011.tar.gz
tdepim-d4b702756e673463c9fc008bc6e5931aac6a9011.zip
* gcc4.4 compilation fixes
* kmail crash issues resolved * automake updates git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1062791 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/accountmanager.cpp')
-rw-r--r--kmail/accountmanager.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/kmail/accountmanager.cpp b/kmail/accountmanager.cpp
index c27432ae4..54a1b4166 100644
--- a/kmail/accountmanager.cpp
+++ b/kmail/accountmanager.cpp
@@ -18,6 +18,7 @@
#include "kmfiltermgr.h"
#include "globalsettings.h"
+#include <dcopclient.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kdebug.h>
@@ -190,6 +191,34 @@ void AccountManager::processNextCheck( bool _newMail )
return;
}
+ if ( curAccount->type() == "imap" || curAccount->type() == "cachedimap" || curAccount->type() == "pop" )
+ {
+ // Check with the network status daemon whether the network is available
+ const int NetWorkStatusUnknown = 1;
+ const int NetWorkStatusOnline = 8;
+ QCString replyType;
+ QByteArray params;
+ QByteArray reply;
+
+ QDataStream stream( params, IO_WriteOnly );
+ stream << static_cast<NetworkAccount*>( curAccount )->host();
+
+ if ( kapp->dcopClient()->call( "kded", "networkstatus", "status(QString)",
+ params, replyType, reply ) && ( replyType == "int" ) )
+ {
+ int result;
+ QDataStream stream2( reply, IO_ReadOnly );
+ stream2 >> result;
+ kdDebug() << k_funcinfo << "networkstatus status = " << result << endl;
+ // if it's not unknown (no networks announced by network control apps), and not offline, give up now
+ if ( ( result != NetWorkStatusUnknown ) && ( result != NetWorkStatusOnline ) )
+ {
+ emit checkedMail( false, mInteractive, mTotalNewInFolder );
+ return;
+ }
+ }
+ }
+
connect( curAccount, SIGNAL( finishedCheck( bool, CheckStatus ) ),
this, SLOT( processNextCheck( bool ) ) );