33#include < qdbusextratypes.h>
44#include < qhash.h>
55#include < qobject.h>
6+ #include < qproperty.h>
67#include < qtmetamacros.h>
78#include < qtypes.h>
89
910#include " ../../dbus/properties.hpp"
1011#include " ../network.hpp"
1112#include " ../wifi.hpp"
12- #include " device.hpp"
1313#include " nm/dbus_nm_backend.h"
1414
1515namespace qs ::network {
1616
1717class NetworkManager : public NetworkBackend {
1818 Q_OBJECT;
1919
20- signals:
21- void wifiEnabledChanged (bool enabled);
22- void wifiHardwareEnabledChanged (bool enabled);
23- void wifiDeviceAdded (WifiDevice* device);
24- void wifiDeviceRemoved (WifiDevice* device);
25-
2620public:
2721 explicit NetworkManager (QObject* parent = nullptr );
22+
2823 [[nodiscard]] bool isAvailable () const override ;
2924 [[nodiscard]] bool wifiEnabled () const { return this ->bWifiEnabled ; };
3025 [[nodiscard]] bool wifiHardwareEnabled () const { return this ->bWifiHardwareEnabled ; };
3126
27+ signals:
28+ void wifiDeviceAdded (WifiDevice* device);
29+ void wifiDeviceRemoved (WifiDevice* device);
30+ void wifiEnabledChanged (bool enabled);
31+ void wifiHardwareEnabledChanged (bool enabled);
32+
3233public slots:
3334 void setWifiEnabled (bool enabled);
3435
@@ -43,11 +44,11 @@ private slots:
4344 );
4445
4546private:
47+ static NetworkConnectionState::Enum toNetworkDeviceState (NMDeviceState::Enum state);
4648 void init ();
4749 void registerDevices ();
4850 void registerDevice (const QString& path);
4951 void registerWifiDevice (const QString& path);
50- static NetworkConnectionState::Enum toNetworkDeviceState (NMDeviceState::Enum state);
5152
5253 QHash<QString, NetworkDevice*> mDeviceHash ;
5354
0 commit comments