Discussion:
libnm-qt: NetworkManager::Settings should load settings if network-manager service is already running
Christophe Oosterlynck
2012-08-07 09:35:11 UTC
Permalink
When the NetworkManager::Settings singleton is loaded, it only connects to
the serviceAppeared() signal from NetworkManager::notifier() to call its
init() method and load the current settings from NetworkManager (load all
the connections etc...). In my case the NetworkManager service is already
running when loading the library => init() is never called and
NetworkManager::Settings doesn't know anything about the connections that
were already available.

Calling the init() method when the NetworkManager service is available at
load time solves my problem and seems like a proper fix.

Btw, is this the best way to report bugs for libnm-qt or should I report
somewhere else?

Best regards,

Christophe

--- a/settings.cpp Tue Aug 07 11:28:23 2012 +0200
+++ b/settings.cpp Tue Aug 07 11:28:29 2012 +0200
@@ -33,6 +33,9 @@
{
connect(NetworkManager::notifier(), SIGNAL(serviceDisappeared()),
this, SLOT(daemonUnregistered()));
connect(NetworkManager::notifier(), SIGNAL(serviceAppeared()), this,
SLOT(init()));
+ if (NetworkManager::status() != NetworkManager::Unknown) {
+ init();
+ }
}

void NetworkManager::Settings::SettingsPrivate::init()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-networkmanager/attachments/20120807/a69e8d2a/attachment.html>
Christophe Oosterlynck
2012-08-08 08:10:09 UTC
Permalink
When the NetworkManager::Settings singleton is loaded, it only connects to
the serviceAppeared() signal from NetworkManager::notifier() to call its
init() method and load the current settings from NetworkManager (load all
the connections etc...). In my case the NetworkManager service is already
running when loading the library => init() is never called and
NetworkManager::Settings doesn't know anything about the connections that
were already available.

Calling the init() method when the NetworkManager service is available at
load time solves my problem and seems like a proper fix.

Btw, is this the best way to report bugs for libnm-qt or should I report
somewhere else?

Best regards,

Christophe

--- a/settings.cpp Tue Aug 07 11:28:23 2012 +0200
+++ b/settings.cpp Tue Aug 07 11:28:29 2012 +0200
@@ -33,6 +33,9 @@
{
connect(NetworkManager::notifier(), SIGNAL(serviceDisappeared()),
this, SLOT(daemonUnregistered()));
connect(NetworkManager::notifier(), SIGNAL(serviceAppeared()), this,
SLOT(init()));
+ if (NetworkManager::status() != NetworkManager::Unknown) {
+ init();
+ }
}

void NetworkManager::Settings::SettingsPrivate::init()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-networkmanager/attachments/20120808/336367aa/attachment.html>
Christophe Oosterlynck
2012-08-08 09:39:08 UTC
Permalink
When the NetworkManager::Settings singleton is loaded, it only connects to
the serviceAppeared() signal from NetworkManager::notifier() to call its
init() method and load the current settings from NetworkManager (load all
the connections etc...). In my case the NetworkManager service is already
running when loading the library => init() is never called and
NetworkManager::Settings doesn't know anything about the connections that
were already available.

Calling the init() method when the NetworkManager service is available at
load time solves my problem and seems like a proper fix.

Btw, is this the best way to report bugs for libnm-qt or should I report
somewhere else?

Best regards,

Christophe

--- a/settings.cpp Tue Aug 07 11:28:23 2012 +0200
+++ b/settings.cpp Tue Aug 07 11:28:29 2012 +0200
@@ -33,6 +33,9 @@
{
connect(NetworkManager::notifier(), SIGNAL(serviceDisappeared()),
this, SLOT(daemonUnregistered()));
connect(NetworkManager::notifier(), SIGNAL(serviceAppeared()), this,
SLOT(init()));
+ if (NetworkManager::status() != NetworkManager::Unknown) {
+ init();
+ }
}

void NetworkManager::Settings::SettingsPrivate::init()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-networkmanager/attachments/20120808/356f8fb7/attachment.html>
Lamarque V. Souza
2012-08-08 12:09:04 UTC
Permalink
Post by Christophe Oosterlynck
When the NetworkManager::Settings singleton is loaded, it only connects to
the serviceAppeared() signal from NetworkManager::notifier() to call its
init() method and load the current settings from NetworkManager (load all
the connections etc...). In my case the NetworkManager service is already
running when loading the library => init() is never called and
NetworkManager::Settings doesn't know anything about the connections that
were already available.
Calling the init() method when the NetworkManager service is available at
load time solves my problem and seems like a proper fix.
Btw, is this the best way to report bugs for libnm-qt or should I report
somewhere else?
You can report the bugs here.
--
Lamarque V. Souza
KDE's Network Management maintainer
http://planetkde.org/pt-br
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-networkmanager/attachments/20120808/4fa7d9b1/attachment.html>
Loading...