summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2015-05-13 23:22:49 +0200
committerMontel Laurent <[email protected]>2015-05-13 23:22:49 +0200
commitfb50a730f9241e03b1e0a2fa81042558b9712bc1 (patch)
tree142c975ab92d24ac8d27ea613e31876c29df7e87
parent0d023cee720d50748d84fd17a8ae1a65b2437629 (diff)
Fix detect network connection
-rw-r--r--akregator/src/mainwidget.cpp2
-rw-r--r--kmail/manageshowcollectionproperties.cpp12
-rw-r--r--libkdepim/addressline/addresslineedit/addresseelineedit_p.cpp26
3 files changed, 19 insertions, 21 deletions
diff --git a/akregator/src/mainwidget.cpp b/akregator/src/mainwidget.cpp
index 99a1287..c530cdc 100644
--- a/akregator/src/mainwidget.cpp
+++ b/akregator/src/mainwidget.cpp
@@ -307,7 +307,7 @@ Akregator::MainWidget::MainWidget( Part *part, QWidget *parent, ActionManagerImp
}
//Check network status
- if(Solid::Networking::status() == Solid::Networking::Connected ||Solid::Networking::status() == Solid::Networking::Unknown)
+ if(Solid::Networking::status() == Solid::Networking::Connected || Solid::Networking::status() == Solid::Networking::Unknown)
this->m_networkAvailable=true;
else if(Solid::Networking::status() == Solid::Networking::Unconnected)
this->m_networkAvailable=false;
diff --git a/kmail/manageshowcollectionproperties.cpp b/kmail/manageshowcollectionproperties.cpp
index 9b8a3fb..9b2888e 100644
--- a/kmail/manageshowcollectionproperties.cpp
+++ b/kmail/manageshowcollectionproperties.cpp
@@ -90,12 +90,7 @@ void ManageShowCollectionProperties::showCollectionProperties( const QString &pa
dlg->raise();
return;
}
- if ( Solid::Networking::status() == Solid::Networking::Unconnected ) {
- KMessageBox::information(
- mMainWidget,
- i18n( "Network is unconnected. Folder information cannot be updated." ) );
- showCollectionPropertiesContinued( pageToShow, QPointer<KPIM::ProgressItem>() );
- } else {
+ if ( Solid::Networking::status() == Solid::Networking::Connected || Solid::Networking::status() == Solid::Networking::Unknown) {
const Akonadi::AgentInstance agentInstance = Akonadi::AgentManager::self()->instance( mMainWidget->currentFolder()->collection().resource() );
bool isOnline = agentInstance.isOnline();
if (!isOnline) {
@@ -118,6 +113,11 @@ void ManageShowCollectionProperties::showCollectionProperties( const QString &pa
KPIM::ProgressManager::instance(), SLOT(slotStandardCancelHandler(KPIM::ProgressItem*)) );
sync->start();
}
+ } else {
+ KMessageBox::information(
+ mMainWidget,
+ i18n( "Network is unconnected. Folder information cannot be updated." ) );
+ showCollectionPropertiesContinued( pageToShow, QPointer<KPIM::ProgressItem>() );
}
}
diff --git a/libkdepim/addressline/addresslineedit/addresseelineedit_p.cpp b/libkdepim/addressline/addresslineedit/addresseelineedit_p.cpp
index 96d20e0..ec6fdef 100644
--- a/libkdepim/addressline/addresslineedit/addresseelineedit_p.cpp
+++ b/libkdepim/addressline/addresslineedit/addresseelineedit_p.cpp
@@ -670,25 +670,23 @@ void AddresseeLineEditPrivate::slotReturnPressed( const QString & )
void AddresseeLineEditPrivate::slotStartLDAPLookup()
{
- if ( Solid::Networking::status() == Solid::Networking::Unconnected ) {
- return;
- }
+ if ( Solid::Networking::status() == Solid::Networking::Connected || Solid::Networking::status() == Solid::Networking::Unknown) {
+ const KGlobalSettings::Completion mode = q->completionMode();
- const KGlobalSettings::Completion mode = q->completionMode();
+ if ( mode == KGlobalSettings::CompletionNone ) {
+ return;
+ }
- if ( mode == KGlobalSettings::CompletionNone ) {
- return;
- }
+ if ( !s_static->ldapSearch->isAvailable() ) {
+ return;
+ }
- if ( !s_static->ldapSearch->isAvailable() ) {
- return;
- }
+ if ( s_static->ldapLineEdit != q ) {
+ return;
+ }
- if ( s_static->ldapLineEdit != q ) {
- return;
+ startLoadingLDAPEntries();
}
-
- startLoadingLDAPEntries();
}
void AddresseeLineEditPrivate::slotLDAPSearchData( const KLDAP::LdapResult::List &results )