Lines 37-43
Link Here
|
37 |
|
37 |
|
38 |
#include <functional> |
38 |
#include <functional> |
39 |
|
39 |
|
|
|
40 |
#include <config-plasma-vault.h> |
41 |
#ifdef ENABLE_NETWORKMANAGER |
40 |
#include <NetworkManagerQt/Manager> |
42 |
#include <NetworkManagerQt/Manager> |
|
|
43 |
#endif |
41 |
|
44 |
|
42 |
K_PLUGIN_FACTORY_WITH_JSON(PlasmaVaultServiceFactory, |
45 |
K_PLUGIN_FACTORY_WITH_JSON(PlasmaVaultServiceFactory, |
43 |
"plasmavault.json", |
46 |
"plasmavault.json", |
Lines 71-77
public:
Link Here
|
71 |
|
74 |
|
72 |
savedNetworkingState = Expected<NetworkingState, int>::success( |
75 |
savedNetworkingState = Expected<NetworkingState, int>::success( |
73 |
NetworkingState { |
76 |
NetworkingState { |
|
|
77 |
#ifdef ENABLE_NETWORKMANAGER |
74 |
NetworkManager::isNetworkingEnabled() || true, |
78 |
NetworkManager::isNetworkingEnabled() || true, |
|
|
79 |
#else |
80 |
true, |
81 |
#endif |
75 |
{} |
82 |
{} |
76 |
}); |
83 |
}); |
77 |
} |
84 |
} |
Lines 85-91
public:
Link Here
|
85 |
return; |
92 |
return; |
86 |
} |
93 |
} |
87 |
|
94 |
|
|
|
95 |
#ifdef ENABLE_NETWORKMANAGER |
88 |
NetworkManager::setNetworkingEnabled(savedNetworkingState->wasNetworkingEnabled); |
96 |
NetworkManager::setNetworkingEnabled(savedNetworkingState->wasNetworkingEnabled); |
|
|
97 |
#endif |
89 |
} |
98 |
} |
90 |
|
99 |
|
91 |
|
100 |
|
Lines 257-266
void PlasmaVaultService::onVaultStatusChanged(VaultInfo::Status status)
Link Here
|
257 |
|
266 |
|
258 |
// qDebug() << "Vaults inhibitting networking: " << devicesInhibittingNetworking; |
267 |
// qDebug() << "Vaults inhibitting networking: " << devicesInhibittingNetworking; |
259 |
|
268 |
|
|
|
269 |
#ifdef ENABLE_NETWORKMANAGER |
260 |
// Now, let's handle the networking part |
270 |
// Now, let's handle the networking part |
261 |
if (!devicesInhibittingNetworking.isEmpty()) { |
271 |
if (!devicesInhibittingNetworking.isEmpty()) { |
262 |
NetworkManager::setNetworkingEnabled(false); |
272 |
NetworkManager::setNetworkingEnabled(false); |
263 |
} |
273 |
} |
|
|
274 |
#endif |
264 |
|
275 |
|
265 |
d->restoreNetworkingState(); |
276 |
d->restoreNetworkingState(); |
266 |
} |
277 |
} |
267 |
- |
|
|