From 1872b4e9d887e280103e803eafb7915576619eb8 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 2 Jul 2015 15:23:38 +1000 Subject: [PATCH] [connman-qt] Fixes MER#1142 Let defaultRoute properties get updated too and partially revert 4e1ee1b79d0c0995ee0b7379f03318e38e7a018a --- libconnman-qt/networkservice.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libconnman-qt/networkservice.cpp b/libconnman-qt/networkservice.cpp index 0ce688c..1865d7b 100644 --- a/libconnman-qt/networkservice.cpp +++ b/libconnman-qt/networkservice.cpp @@ -475,9 +475,9 @@ void NetworkService::reconnectServiceInterface() connect(m_service, SIGNAL(PropertyChanged(QString,QDBusVariant)), this, SLOT(updateProperty(QString,QDBusVariant))); - if (state().isEmpty()) //saved services have an empty state and cached properties + if (state().isEmpty() || m_path == QStringLiteral("/")) //saved services have an empty state and cached properties QTimer::singleShot(500,this,SIGNAL(propertiesReady())); - else if (m_path != QStringLiteral("/") && m_service->isValid()) { + else { QDBusPendingReply reply = m_service->GetProperties(); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); @@ -594,6 +594,15 @@ void NetworkService::setPath(const QString &path) resetProperties(); reconnectServiceInterface(); + + if (!m_service || !m_service->isValid()) + return; + + QDBusPendingReply reply = m_service->GetProperties(); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); + + connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), + this, SLOT(getPropertiesFinished(QDBusPendingCallWatcher*))); } bool NetworkService::connected()