network manager qt - how to get the passwords

Jan Grulich jgrulich at redhat.com
Thu Aug 27 18:27:53 UTC 2015


Hi,

On Thursday 27 of August 2015 09:43:54 Boettger, Heiko wrote:
> Hi,
> 
> I am currently developing a gui for our products to edit the network
> settings. One thing which I cannot figure out is how to get the passwords.
> Simply calling  NetworkManager::Security8021xSetting::password() or any of
> the other password-methods doesn't seem to work.
>

Unfortunately it doesn't work that way, you need to call 
NetworkManager::Connection::secrets() for the connection you want secrets for and 
pass the setting type as a parameter (in your case it would be 
"NetworkManager::Setting::Security8021x" enum). This would return you a 
QDBusPendingReply so you need to wait for the reply to finish or connect to a signal 
finished() and do whatever you want to do with the secrets. Using 
NetworkManager::Security8021xSetting::password() would work only in case you
already have secrets as a part of the setting.
 
> Is there somewhere a good documentation or example showing how it works?
> 

You can check how everything work in plasma-nm [1]. If you want to check how to get 
secrets go to libs/editor/connectiondetailseditor.cpp. You can also ping me anytime on 
IRC on #solid channel.

[1] - https://quickgit.kde.org/?p=plasma-nm.git[1] 


> Thanks
> Heiko

Regards,
Jan
-- 
Jan Grulich <jgrulich at redhat.com>
Software Engineer, Desktop team
Red Hat Czech

--------
[1] https://quickgit.kde.org/?p=plasma-nm.git
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150827/dffcd421/attachment.html>


More information about the Kde-frameworks-devel mailing list