Christophe Oosterlynck
2012-08-07 09:35:11 UTC
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>
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>