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
|
/*
* SPDX-FileCopyrightText: 2025 Lasath Fernando <devel@lasath.org>
*
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/
#include "SysupdateInternal.h"
#include <QMetaEnum>
#include <qdbusargument.h>
#include <qdbusmetatype.h>
QDBusArgument &operator<<(QDBusArgument &argument, const Sysupdate::Job &job)
{
argument.beginStructure();
argument << job.id << static_cast<int>(job.type) << job.progressPercent << job.objectPath;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, Sysupdate::Job &job)
{
int type;
argument.beginStructure();
argument >> job.id >> type >> job.progressPercent >> job.objectPath;
job.type = static_cast<Sysupdate::JobType>(type);
argument.endStructure();
return argument;
}
Q_DECLARE_METATYPE(Sysupdate::Job)
Q_DECLARE_METATYPE(Sysupdate::JobList)
QDBusArgument &operator<<(QDBusArgument &argument, const Sysupdate::Target &target)
{
argument.beginStructure();
argument << target.targetClass << target.name << target.objectPath;
argument.endStructure();
return argument;
}
const QDBusArgument &operator>>(const QDBusArgument &argument, Sysupdate::Target &target)
{
argument.beginStructure();
argument >> target.targetClass >> target.name >> target.objectPath;
argument.endStructure();
return argument;
}
Q_DECLARE_METATYPE(Sysupdate::Target)
Q_DECLARE_METATYPE(Sysupdate::TargetList)
|