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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user