yhkylin-backup-tools/common/mydefine.cpp

33 lines
1.5 KiB
C++
Raw Normal View History

2021-08-06 10:20:03 +08:00
#include "mydefine.h"
#include <QDBusMetaType>
// Marshall the MyStructure data into a D-Bus argument
QDBusArgument &operator<<(QDBusArgument &argument, const BackupWrapper &backupWrapper)
{
argument.beginStructure();
2021-11-17 11:47:15 +08:00
argument << backupWrapper.m_type << backupWrapper.m_iPosition << backupWrapper.m_comment << backupWrapper.m_backupName
<< backupWrapper.m_uuid << backupWrapper.m_backupPaths << backupWrapper.m_backupExcludePaths << backupWrapper.m_prefixDestPath
2021-08-06 10:20:03 +08:00
<< backupWrapper.m_note << backupWrapper.m_frontUserName << backupWrapper.m_frontUid
2021-12-11 09:49:09 +08:00
<< backupWrapper.m_gid << backupWrapper.m_isOtherMachine;
2021-08-06 10:20:03 +08:00
argument.endStructure();
return argument;
}
// Retrieve the MyStructure data from the D-Bus argument
const QDBusArgument &operator>>(const QDBusArgument &argument, BackupWrapper &backupWrapper)
{
argument.beginStructure();
2021-11-17 11:47:15 +08:00
argument >> backupWrapper.m_type >> backupWrapper.m_iPosition >> backupWrapper.m_comment >> backupWrapper.m_backupName
>> backupWrapper.m_uuid >> backupWrapper.m_backupPaths >> backupWrapper.m_backupExcludePaths >> backupWrapper.m_prefixDestPath
2021-08-06 10:20:03 +08:00
>> backupWrapper.m_note >> backupWrapper.m_frontUserName >> backupWrapper.m_frontUid
2021-12-11 09:49:09 +08:00
>> backupWrapper.m_gid >> backupWrapper.m_isOtherMachine;
2021-08-06 10:20:03 +08:00
argument.endStructure();
return argument;
}
void BackupWrapper::registerMetaType()
{
qRegisterMetaType<BackupWrapper>("BackupWrapper");
qDBusRegisterMetaType<BackupWrapper>();
}