mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 16:05:21 +01:00
Linux distros that use NetworkManager: prefill WLAN PSK
Only supported when NetworkManager is used on the Linux distro as wpa_supplicant itself does not support reading PSKs through DBus, only setting them. Closes #457
This commit is contained in:
parent
b1606dd1fb
commit
ef4abc661f
5 changed files with 107 additions and 3 deletions
|
@ -57,6 +57,11 @@
|
|||
#include <QtPlatformHeaders/QEglFSFunctions>
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_LINUX
|
||||
#ifndef QT_NO_DBUS
|
||||
#include "linux/networkmanagerapi.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ImageWriter::ImageWriter(QObject *parent)
|
||||
: QObject(parent), _repo(QUrl(QString(OSLIST_URL))), _dlnow(0), _verifynow(0),
|
||||
|
@ -990,11 +995,16 @@ QString ImageWriter::getPSK(const QString &ssid)
|
|||
}
|
||||
|
||||
return psk;
|
||||
#else
|
||||
#ifndef QT_NO_DBUS
|
||||
NetworkManagerApi nm;
|
||||
return nm.getPSK();
|
||||
#else
|
||||
Q_UNUSED(ssid)
|
||||
return QString();
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
bool ImageWriter::getBoolSetting(const QString &key)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue