Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit fb50a730 authored by Laurent Montel's avatar Laurent Montel 😁

Fix detect network connection

parent 0d023cee
......@@ -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;
......
......@@ -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>() );
}
}
......
......@@ -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 )
......
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