Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.96 KB | None | 0 0
  1. diff --git a/libs/handler.cpp b/libs/handler.cpp
  2. index 99e501d4..b0a0da7e 100644
  3. --- a/libs/handler.cpp
  4. +++ b/libs/handler.cpp
  5. @@ -90,17 +90,13 @@ Handler::Handler(QObject *parent)
  6.          NetworkManager::ActiveConnection::Ptr hotspot = NetworkManager::findActiveConnection(Configuration::hotspotConnectionPath());
  7.          if (!hotspot) {
  8.              Configuration::setHotspotConnectionPath(QString());
  9. -            Q_EMIT hotspotDisabled();
  10.          }
  11.      }
  12.  
  13.      m_hotspotSupported = checkHotspotSupported();
  14.  
  15.      if (NetworkManager::checkVersion(1, 16, 0)) {
  16. -        connect(NetworkManager::notifier(), &NetworkManager::Notifier::primaryConnectionTypeChanged, [this] () {
  17. -            m_hotspotSupported = checkHotspotSupported();
  18. -            Q_EMIT hotspotSupportedChanged(m_hotspotSupported);
  19. -        });
  20. +        connect(NetworkManager::notifier(), &NetworkManager::Notifier::primaryConnectionTypeChanged, this, &Handler::primaryConnectionTypeChanged);
  21.      }
  22.  }
  23.  
  24. @@ -870,6 +866,13 @@ void Handler::hotspotCreated(QDBusPendingCallWatcher *watcher)
  25.      }
  26.  }
  27.  
  28. +void Handler::primaryConnectionTypeChanged(NetworkManager::ConnectionSettings::ConnectionType type)
  29. +{
  30. +    Q_UNUSED(type)
  31. +    m_hotspotSupported = checkHotspotSupported();
  32. +    Q_EMIT hotspotSupportedChanged(m_hotspotSupported);
  33. +}
  34. +
  35.  #if WITH_MODEMMANAGER_SUPPORT
  36.  void Handler::unlockRequiredChanged(MMModemLock modemLock)
  37.  {
  38. diff --git a/libs/handler.h b/libs/handler.h
  39. index 60bb1f5e..b1e7bf66 100644
  40. --- a/libs/handler.h
  41. +++ b/libs/handler.h
  42. @@ -129,6 +129,7 @@ private Q_SLOTS:
  43.      void secretAgentError(const QString &connectionPath, const QString &message);
  44.      void replyFinished(QDBusPendingCallWatcher *watcher);
  45.      void hotspotCreated(QDBusPendingCallWatcher *watcher);
  46. +    void primaryConnectionTypeChanged(NetworkManager::ConnectionSettings::ConnectionType type);
  47.  #if WITH_MODEMMANAGER_SUPPORT
  48.      void unlockRequiredChanged(MMModemLock modemLock);
  49.  #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement