Commit 70c5d48f authored by Jan Grulich's avatar Jan Grulich
Browse files

Do not emit signals from lambda slot and constructor

This apparently might lead to a crash when restarting NetworkManager
parent b756b246
......@@ -90,17 +90,13 @@ Handler::Handler(QObject *parent)
NetworkManager::ActiveConnection::Ptr hotspot = NetworkManager::findActiveConnection(Configuration::hotspotConnectionPath());
if (!hotspot) {
Configuration::setHotspotConnectionPath(QString());
Q_EMIT hotspotDisabled();
}
}
m_hotspotSupported = checkHotspotSupported();
if (NetworkManager::checkVersion(1, 16, 0)) {
connect(NetworkManager::notifier(), &NetworkManager::Notifier::primaryConnectionTypeChanged, [this] () {
m_hotspotSupported = checkHotspotSupported();
Q_EMIT hotspotSupportedChanged(m_hotspotSupported);
});
connect(NetworkManager::notifier(), &NetworkManager::Notifier::primaryConnectionTypeChanged, this, &Handler::primaryConnectionTypeChanged);
}
}
......@@ -870,6 +866,13 @@ void Handler::hotspotCreated(QDBusPendingCallWatcher *watcher)
}
}
void Handler::primaryConnectionTypeChanged(NetworkManager::ConnectionSettings::ConnectionType type)
{
Q_UNUSED(type)
m_hotspotSupported = checkHotspotSupported();
Q_EMIT hotspotSupportedChanged(m_hotspotSupported);
}
#if WITH_MODEMMANAGER_SUPPORT
void Handler::unlockRequiredChanged(MMModemLock modemLock)
{
......
......@@ -129,6 +129,7 @@ private Q_SLOTS:
void secretAgentError(const QString &connectionPath, const QString &message);
void replyFinished(QDBusPendingCallWatcher *watcher);
void hotspotCreated(QDBusPendingCallWatcher *watcher);
void primaryConnectionTypeChanged(NetworkManager::ConnectionSettings::ConnectionType type);
#if WITH_MODEMMANAGER_SUPPORT
void unlockRequiredChanged(MMModemLock modemLock);
#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