-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathupdatedbusproxy.cpp
More file actions
547 lines (474 loc) · 21.1 KB
/
Copy pathupdatedbusproxy.cpp
File metadata and controls
547 lines (474 loc) · 21.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
// SPDX-FileCopyrightText: 2018 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#include "updatedbusproxy.h"
#include <QDBusArgument>
#include <QDBusInterface>
#include <QDBusMetaType>
#include <QDBusPendingReply>
#include <QDBusReply>
#include <QDBusUnixFileDescriptor>
#include <QLoggingCategory>
#include "common/commondefine.h"
Q_DECLARE_LOGGING_CATEGORY(logCommon)
UpdateDBusProxy::UpdateDBusProxy(QObject *parent)
: QObject(parent)
, m_hostname1Inter(new DDBusInterface(
HostnameService, HostnamePath, HostnameInterface, QDBusConnection::systemBus(), this))
, m_updateInter(new DDBusInterface(
UpdaterService, UpdaterPath, UpdaterInterface, QDBusConnection::systemBus(), this))
, m_managerInter(new DDBusInterface(
ManagerService, ManagerPath, ManagerInterface, QDBusConnection::systemBus(), this))
, m_powerInter(new DDBusInterface(
PowerService, PowerPath, PowerInterface, QDBusConnection::sessionBus(), this))
, m_atomicUpgradeInter(new DDBusInterface(AtomicUpdaterService,
AtomicUpdaterPath,
AtomicUpdaterJobInterface,
QDBusConnection::systemBus(),
this))
, m_smartMirrorInter(new DDBusInterface("org.deepin.dde.Lastore1.Smartmirror",
"/org/deepin/dde/Lastore1/Smartmirror",
"org.deepin.dde.Lastore1.Smartmirror",
QDBusConnection::systemBus(),
this))
, m_lockServiceInter(new DDBusInterface(
LockService, LockPath, LockInterface, QDBusConnection::systemBus(), this))
, m_shutdownFrontInter(new DDBusInterface(
ShutdownFront1Service, ShutdownFront1Path, ShutdownFront1Interface, QDBusConnection::sessionBus(), this))
, m_interWatcher(new QDBusServiceWatcher(UpdaterService, QDBusConnection::systemBus()))
{
qCDebug(logCommon) << "Initialize UpdateDBusProxy with multiple services";
qRegisterMetaType<LastoreUpdatePackagesInfo>("LastoreUpdatePackagesInfo");
qDBusRegisterMetaType<LastoreUpdatePackagesInfo>();
qRegisterMetaType<BatteryPercentageInfo>("BatteryPercentageInfo");
qDBusRegisterMetaType<BatteryPercentageInfo>();
m_interWatcher->setWatchedServices({UpdaterService, ManagerInterface, HostnameService});
connect(m_interWatcher, &QDBusServiceWatcher::serviceRegistered, this, [this](const QString &serviceName) {
qCDebug(logCommon) << "DBus service registered:" << serviceName;
if (serviceName == ManagerService) {
emit managerInterServiceValidChanged(true);
}
});
connect(m_interWatcher, &QDBusServiceWatcher::serviceUnregistered, this, [this](const QString &serviceName) {
qCDebug(logCommon) << "DBus service unregistered:" << serviceName;
if (serviceName == ManagerService) {
emit managerInterServiceValidChanged(false);
}
});
}
UpdateDBusProxy::~UpdateDBusProxy()
{
qCDebug(logCommon) << "Destroying UpdateDBusProxy, cleaning up interfaces";
m_hostname1Inter->deleteLater();
m_updateInter->deleteLater();
m_managerInter->deleteLater();
m_powerInter->deleteLater();
m_atomicUpgradeInter->deleteLater();
}
QString UpdateDBusProxy::staticHostname() const
{
return qvariant_cast<QString>(m_hostname1Inter->property("StaticHostname"));
}
bool UpdateDBusProxy::updateNotify()
{
return qvariant_cast<bool>(m_updateInter->property("UpdateNotify"));
}
void UpdateDBusProxy::SetUpdateNotify(bool in0)
{
qCDebug(logCommon) << "Setting update notify:" << in0;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
m_updateInter->asyncCallWithArgumentList(QStringLiteral("SetUpdateNotify"), argumentList);
}
LastoreUpdatePackagesInfo UpdateDBusProxy::classifiedUpdatablePackages()
{
qCDebug(logCommon) << "Getting classified updatable packages";
QDBusInterface updateInter(m_updateInter->service(),
m_updateInter->path(),
PropertiesInterface,
m_updateInter->connection());
QDBusMessage mess = updateInter.call(QStringLiteral("Get"),
m_updateInter->interface(),
QStringLiteral("ClassifiedUpdatablePackages"));
QVariant v = mess.arguments().first();
const QDBusArgument arg = v.value<QDBusVariant>().variant().value<QDBusArgument>();
LastoreUpdatePackagesInfo packagesInfo;
arg >> packagesInfo;
qCDebug(logCommon) << "Got packages info with" << packagesInfo.size() << "categories";
return packagesInfo;
}
QString UpdateDBusProxy::GetCheckIntervalAndTime()
{
qCDebug(logCommon) << "Getting check interval and time";
QList<QVariant> argumentList;
QDBusMessage reply =
m_updateInter->callWithArgumentList(QDBus::Block,
QStringLiteral("GetCheckIntervalAndTime"),
argumentList);
if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 2) {
QString checkTime = qdbus_cast<QString>(reply.arguments().at(1));
qCDebug(logCommon) << "Check time:" << checkTime;
return checkTime;
} else if (reply.type() == QDBusMessage::ErrorMessage) {
qCWarning(logCommon) << "GetCheckIntervalAndTime failed: " << reply.errorMessage();
}
return {};
}
bool UpdateDBusProxy::autoDownloadUpdates()
{
return qvariant_cast<bool>(m_updateInter->property("AutoDownloadUpdates"));
}
bool UpdateDBusProxy::autoInstallUpdates()
{
return qvariant_cast<bool>(m_updateInter->property("AutoInstallUpdates"));
}
qulonglong UpdateDBusProxy::autoInstallUpdateType()
{
return qvariant_cast<qulonglong>(m_updateInter->property("AutoInstallUpdateType"));
}
bool UpdateDBusProxy::autoCheckUpdates()
{
return qvariant_cast<bool>(m_updateInter->property("AutoCheckUpdates"));
}
void UpdateDBusProxy::SetAutoCheckUpdates(bool in0)
{
qCDebug(logCommon) << "Setting auto check updates:" << in0;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
m_updateInter->asyncCallWithArgumentList(QStringLiteral("SetAutoCheckUpdates"), argumentList);
}
void UpdateDBusProxy::SetAutoDownloadUpdates(bool in0)
{
qCDebug(logCommon) << "Setting auto download updates:" << in0;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
m_updateInter->asyncCallWithArgumentList(QStringLiteral("SetAutoDownloadUpdates"),
argumentList);
}
void UpdateDBusProxy::setAutoInstallUpdates(bool value)
{
qCDebug(logCommon) << "Setting auto install updates property:" << value;
m_updateInter->setProperty("AutoInstallUpdates", QVariant::fromValue(value));
}
void UpdateDBusProxy::SetMirrorSource(const QString &in0)
{
qCDebug(logCommon) << "Setting mirror source:" << in0;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
m_updateInter->asyncCallWithArgumentList(QStringLiteral("SetMirrorSource"), argumentList);
}
bool UpdateDBusProxy::autoClean()
{
return qvariant_cast<bool>(m_managerInter->property("AutoClean"));
}
quint64 UpdateDBusProxy::updateMode()
{
return qvariant_cast<quint64>(m_managerInter->property("UpdateMode"));
}
void UpdateDBusProxy::setUpdateMode(quint64 value)
{
qCDebug(logCommon) << "Setting update mode:" << value;
m_managerInter->setProperty("UpdateMode", QVariant::fromValue(value));
}
QList<QDBusObjectPath> UpdateDBusProxy::jobList()
{
return qvariant_cast<QList<QDBusObjectPath>>(m_managerInter->property("JobList"));
}
QString UpdateDBusProxy::updateStatus()
{
return qvariant_cast<QString>(m_managerInter->property("UpdateStatus"));
}
bool UpdateDBusProxy::p2PUpdateEnable()
{
return qvariant_cast<bool>(m_managerInter->property("P2PUpdateEnable"));
}
bool UpdateDBusProxy::p2PUpdateSupport()
{
return qvariant_cast<bool>(m_managerInter->property("P2PUpdateSupport"));
}
bool UpdateDBusProxy::immutableAutoRecovery()
{
return qvariant_cast<bool>(m_managerInter->property("ImmutableAutoRecovery"));
}
QString UpdateDBusProxy::hardwareId()
{
return qvariant_cast<QString>(m_managerInter->property("HardwareId"));
}
quint64 UpdateDBusProxy::checkUpdateMode()
{
return qvariant_cast<quint64>(m_managerInter->property("CheckUpdateMode"));
}
void UpdateDBusProxy::setCheckUpdateMode(quint64 value)
{
qCDebug(logCommon) << "Setting check update mode:" << value;
m_managerInter->setProperty("CheckUpdateMode", QVariant::fromValue(value));
}
QString UpdateDBusProxy::idleDownloadConfig()
{
return qvariant_cast<QString>(m_updateInter->property("IdleDownloadConfig"));
}
QString UpdateDBusProxy::downloadSpeedLimitConfig()
{
return qvariant_cast<QString>(m_updateInter->property("DownloadSpeedLimitConfig"));
}
bool UpdateDBusProxy::p2pUpdateEnable()
{
return qvariant_cast<bool>(m_updateInter->property("P2PUpdateEnable"));
}
QDBusPendingCall UpdateDBusProxy::CanRollback()
{
qCDebug(logCommon) << "Calling CanRollback async";
return m_managerInter->asyncCall(QStringLiteral("CanRollback"));
}
QDBusPendingCall UpdateDBusProxy::ConfirmRollback(bool confirm)
{
qCDebug(logCommon) << "Calling ConfirmRollback with confirm:" << confirm;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(confirm);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("ConfirmRollback"), argumentList);
}
QDBusPendingCall UpdateDBusProxy::Poweroff(bool reboot)
{
qCDebug(logCommon) << "Calling Poweroff with reboot:" << reboot;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(reboot);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("PowerOff"), argumentList);
}
QDBusPendingReply<QDBusObjectPath> UpdateDBusProxy::UpdateSource()
{
qCDebug(logCommon) << "Calling UpdateSource async";
QList<QVariant> argumentList;
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("UpdateSource"), argumentList);
}
void UpdateDBusProxy::CleanJob(const QString &in0)
{
qCDebug(logCommon) << "Calling CleanJob for job:" << in0;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
m_managerInter->asyncCallWithArgumentList(QStringLiteral("CleanJob"), argumentList);
}
void UpdateDBusProxy::SetAutoClean(bool in0)
{
qCDebug(logCommon) << "Setting auto clean:" << in0;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
m_managerInter->asyncCallWithArgumentList(QStringLiteral("SetAutoClean"), argumentList);
}
void UpdateDBusProxy::StartJob(const QString &in0)
{
qCDebug(logCommon) << "Starting job:" << in0;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
m_managerInter->asyncCallWithArgumentList(QStringLiteral("StartJob"), argumentList);
}
void UpdateDBusProxy::PauseJob(const QString &in0)
{
qCDebug(logCommon) << "Pausing job:" << in0;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
m_managerInter->asyncCallWithArgumentList(QStringLiteral("PauseJob"), argumentList);
}
QDBusPendingReply<QDBusObjectPath> UpdateDBusProxy::InstallPackage(const QString &jobname,
const QString &packages)
{
qCDebug(logCommon) << "Installing package with job:" << jobname << "packages:" << packages;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(jobname) << QVariant::fromValue(packages);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("InstallPackage"),
argumentList);
}
QDBusPendingReply<QDBusObjectPath> UpdateDBusProxy::RemovePackage(const QString &jobname,
const QString &packages)
{
qCDebug(logCommon) << "Removing package with job:" << jobname << "packages:" << packages;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(jobname) << QVariant::fromValue(packages);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("RemovePackage"), argumentList);
}
QDBusPendingReply<QList<QDBusObjectPath>> UpdateDBusProxy::ClassifiedUpgrade(qulonglong in0)
{
qCDebug(logCommon) << "Starting classified upgrade with types:" << in0;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("ClassifiedUpgrade"),
argumentList);
}
QDBusPendingReply<qlonglong> UpdateDBusProxy::PackagesDownloadSize(const QStringList &in0)
{
qCDebug(logCommon) << "Getting download size for" << in0.size() << "packages";
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("PackagesDownloadSize"),
argumentList);
}
QDBusPendingReply<bool> UpdateDBusProxy::PackageExists(const QString &pkgid)
{
qCDebug(logCommon) << "Checking if package exists:" << pkgid;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(pkgid);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("PackageExists"), argumentList);
}
QDBusPendingReply<QDBusObjectPath> UpdateDBusProxy::DistUpgrade()
{
qCDebug(logCommon) << "Starting full distribution upgrade";
return m_managerInter->asyncCall(QStringLiteral("DistUpgrade"));
}
QDBusPendingReply<QDBusObjectPath> UpdateDBusProxy::DistUpgradePartly(int updateTypes, bool doBackup)
{
qCDebug(logCommon) << "Starting partial distribution upgrade, types:" << updateTypes << "backup:" << doBackup;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(updateTypes) << QVariant::fromValue(doBackup);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("DistUpgradePartly"),argumentList);
}
QDBusPendingReply<void> UpdateDBusProxy::SetDownloadSpeedLimit(const QString& config)
{
qCDebug(logCommon) << "Setting download speed limit config:" << config;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(config);
return m_updateInter->asyncCallWithArgumentList(QStringLiteral("SetDownloadSpeedLimit"), argumentList);
}
QDBusPendingReply<qlonglong> UpdateDBusProxy::QueryAllSizeWithSource(int updatetype)
{
qCDebug(logCommon) << "Querying size for update type:" << updatetype;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(updatetype);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("QueryAllSizeWithSource"), argumentList);
}
QDBusPendingReply<QString> UpdateDBusProxy::GetUpdateLogs(int updateType)
{
qCDebug(logCommon) << "Getting update logs for type:" << updateType;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(updateType);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("GetUpdateLogs"), argumentList);
}
QDBusPendingReply<void> UpdateDBusProxy::SetUpgradeDeliveryEnable(bool enable)
{
qCDebug(logCommon) << "Setting upgrade delivery enable :" << enable;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(enable);
return m_updateInter->asyncCallWithArgumentList(QStringLiteral("SetP2PUpdateEnable"), argumentList);
}
QDBusPendingReply<void> UpdateDBusProxy::SetUpgradeDeliveryDownloadSpeedLimit(const QString& downloadLimit)
{
qCDebug(logCommon) << "Setting upgrade delivery download speed limit : " << downloadLimit;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(downloadLimit);
return m_updateInter->asyncCallWithArgumentList(QStringLiteral("SetDeliveryDownloadSpeedLimit"), argumentList);
}
QDBusPendingReply<void> UpdateDBusProxy::SetUpgradeDeliveryUploadSpeedLimit(const QString& uploadLimit)
{
qCDebug(logCommon) << "Setting upgrade delivery upload speed limit : " << uploadLimit;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(uploadLimit);
return m_updateInter->asyncCallWithArgumentList(QStringLiteral("SetDeliveryUploadSpeedLimit"), argumentList);
}
QDBusPendingReply<void> UpdateDBusProxy::ClearUpgradeDeliveryCache()
{
qCDebug(logCommon) << "Clearing upgrade delivery cache";
return m_updateInter->asyncCall(QStringLiteral("CleanTransmissionFiles"));
}
QDBusPendingReply<void> UpdateDBusProxy::SetIdleDownloadConfig(const QString& config)
{
qCDebug(logCommon) << "Setting idle download config:" << config;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(config);
return m_updateInter->asyncCallWithArgumentList(QStringLiteral("SetIdleDownloadConfig"), argumentList);
}
QDBusPendingReply<QDBusObjectPath> UpdateDBusProxy::PrepareDistUpgradePartly(int updateMode)
{
qCDebug(logCommon) << "Preparing partial distribution upgrade with mode:" << updateMode;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(updateMode);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("PrepareDistUpgradePartly"), argumentList);
}
QDBusPendingReply<QDBusObjectPath> UpdateDBusProxy::fixError(const QString &errorType)
{
qCDebug(logCommon) << "Fixing error of type:" << errorType;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(errorType);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("FixError"), argumentList);
}
QDBusPendingCall UpdateDBusProxy::CheckUpgrade(int checkMode, int checkOrder)
{
qCDebug(logCommon) << "Checking upgrade with mode:" << checkMode << "order:" << checkOrder;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(checkMode) << QVariant::fromValue(checkOrder);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("CheckUpgrade"), argumentList);
}
QDBusPendingReply<void> UpdateDBusProxy::GetUpdateDetails(int fd, bool realtime)
{
qCDebug(logCommon) << "Getting update details, fd:" << fd << "realtime:" << realtime;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(QDBusUnixFileDescriptor(fd));
argumentList << QVariant::fromValue(realtime);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("GetUpdateDetails"), argumentList);
}
QDBusPendingReply<void> UpdateDBusProxy::SetShutdownForceUpdate(bool isShutdownUpdate)
{
qCDebug(logCommon) << "Setting shutdown force update , isShutdownUpdate:" << isShutdownUpdate;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(isShutdownUpdate);
return m_managerInter->asyncCallWithArgumentList(QStringLiteral("SetShutdownForceUpdate"), argumentList);
}
bool UpdateDBusProxy::onBattery()
{
return qvariant_cast<bool>(m_powerInter->property("OnBattery"));
}
BatteryPercentageInfo UpdateDBusProxy::batteryPercentage()
{
qCDebug(logCommon) << "Getting battery percentage info";
QDBusInterface powerInter(m_powerInter->service(),
m_powerInter->path(),
PropertiesInterface,
m_powerInter->connection());
QDBusMessage mess = powerInter.call(QStringLiteral("Get"),
m_powerInter->interface(),
QStringLiteral("BatteryPercentage"));
QVariant v = mess.arguments().first();
const QDBusArgument arg = v.value<QDBusVariant>().variant().value<QDBusArgument>();
BatteryPercentageInfo packagesInfo;
arg >> packagesInfo;
qCDebug(logCommon) << "Battery percentage info retrieved";
return packagesInfo;
}
void UpdateDBusProxy::commit(const QString &commitDate)
{
qCDebug(logCommon) << "Committing atomic upgrade with date:" << commitDate;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(commitDate);
m_atomicUpgradeInter->asyncCallWithArgumentList(QStringLiteral("Commit"), argumentList);
}
bool UpdateDBusProxy::atomBackupIsRunning()
{
return qvariant_cast<bool>(m_atomicUpgradeInter->property("Running"));
}
bool UpdateDBusProxy::enable() const
{
return qvariant_cast<bool>(m_smartMirrorInter->property("Enable"));
}
void UpdateDBusProxy::SetEnable(bool enable)
{
qCDebug(logCommon) << "Setting smart mirror enable:" << enable;
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(enable);
m_smartMirrorInter->asyncCallWithArgumentList(QStringLiteral("SetEnable"), argumentList);
}
QString UpdateDBusProxy::CurrentUser()
{
return QDBusPendingReply<QString>(m_lockServiceInter->asyncCall(QStringLiteral("CurrentUser")));
}
void UpdateDBusProxy::Restart()
{
qCInfo(logCommon) << "Calling system restart";
m_shutdownFrontInter->asyncCall(QStringLiteral("Restart"));
}
void UpdateDBusProxy::UpdateAndReboot()
{
qCInfo(logCommon) << "Calling update and reboot";
m_shutdownFrontInter->asyncCall(QStringLiteral("UpdateAndReboot"));
}
void UpdateDBusProxy::UpdateAndShutdown()
{
qCInfo(logCommon) << "Calling update and shutdown";
m_shutdownFrontInter->asyncCall(QStringLiteral("UpdateAndShutdown"));
}