|
|
|
@ -169,6 +169,18 @@ KMKernel::KMKernel (TQObject *parent, const char *name) :
|
|
|
|
|
|
|
|
|
|
connectDCOPSignal( 0, 0, "kmailSelectFolder(TQString)",
|
|
|
|
|
"selectFolder(TQString)", false );
|
|
|
|
|
|
|
|
|
|
mNetworkManager = TDEGlobal::networkManager();
|
|
|
|
|
if (mNetworkManager) {
|
|
|
|
|
connect( mNetworkManager, TQT_SIGNAL( networkDeviceStateChanged( TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString ) ),
|
|
|
|
|
this, TQT_SLOT( slotNetworkStateChanged( TDENetworkConnectionStatus::TDENetworkConnectionStatus newState, TDENetworkConnectionStatus::TDENetworkConnectionStatus previousState, TQString hwAddress ) ) );
|
|
|
|
|
if (networkStateConnected()) {
|
|
|
|
|
resumeNetworkJobs();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
stopNetworkJobs();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KMKernel::~KMKernel ()
|
|
|
|
@ -2456,6 +2468,38 @@ int KMKernel::timeOfLastMessageCountChange() const
|
|
|
|
|
return mTimeOfLastMessageCountChange;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool KMKernel::networkStateConnected()
|
|
|
|
|
{
|
|
|
|
|
if (mNetworkManager) {
|
|
|
|
|
TDENetworkGlobalManagerFlags::TDENetworkGlobalManagerFlags networkStatus = mNetworkManager->backendStatus();
|
|
|
|
|
if ((networkStatus & TDENetworkGlobalManagerFlags::Connected)
|
|
|
|
|
|| (networkStatus & TDENetworkGlobalManagerFlags::BackendUnavailable)
|
|
|
|
|
|| (networkStatus == TDENetworkGlobalManagerFlags::Unknown)
|
|
|
|
|
){
|
|
|
|
|
// Connected or no backend available
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// Not connected
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
// Assume connected
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void KMKernel::slotNetworkStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString)
|
|
|
|
|
{
|
|
|
|
|
if (networkStateConnected()) {
|
|
|
|
|
resumeNetworkJobs();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
stopNetworkJobs();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Wallet *KMKernel::wallet() {
|
|
|
|
|
static bool walletOpenFailed = false;
|
|
|
|
|
if ( mWallet && mWallet->isOpen() )
|
|
|
|
|