Commit 2650dc1e authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Anthony Léonard

new libring XML API support

Add support the new libring data-transfer feature (DBus/wrapper).
This patch fixes only the build and doesn't add full support
for the data-transfer feature (come later),

Change-Id: If98966e28bf324260dcfc55760e11bda3e21f62b
Reviewed-by: default avatarAnthony Léonard <anthony.leonard@savoirfairelinux.com>
parent ef81c667
......@@ -40,6 +40,7 @@ Q_DECLARE_METATYPE(VectorUInt)
Q_DECLARE_METATYPE(VectorString)
Q_DECLARE_METATYPE(MapStringVectorString)
Q_DECLARE_METATYPE(VectorVectorByte)
Q_DECLARE_METATYPE(DataTransferInfo)
#ifndef ENABLE_LIBWRAP
static bool dbus_metaTypeInit = false;
......@@ -55,10 +56,40 @@ inline void registerCommTypes() {
qDBusRegisterMetaType<VectorString> ();
qDBusRegisterMetaType<MapStringVectorString> ();
qDBusRegisterMetaType<VectorVectorByte> ();
qDBusRegisterMetaType<DataTransferInfo> ();
dbus_metaTypeInit = true;
#endif
}
#ifndef ENABLE_LIBWRAP
static inline QDBusArgument &operator<<(QDBusArgument& argument, const DataTransferInfo& info)
{
argument.beginStructure();
argument << info.isOutgoing;
argument << info.lastEvent;
argument << info.totalSize;
argument << info.bytesProgress;
argument << info.displayName;
argument << info.path;
argument.endStructure();
return argument;
}
static inline const QDBusArgument &operator>>(const QDBusArgument& argument, DataTransferInfo& info)
{
argument.beginStructure();
argument >> info.isOutgoing;
argument >> info.lastEvent;
argument >> info.totalSize;
argument >> info.bytesProgress;
argument >> info.displayName;
argument >> info.path;
argument.endStructure();
return argument;
}
#endif
#pragma GCC diagnostic pop
......@@ -38,6 +38,17 @@ typedef QMap< QString, QMap< QString, QStringList > > MapStringMapStringSt
typedef QMap< QString, QStringList > MapStringStringList ;
typedef QVector< QByteArray > VectorVectorByte ;
// Adapted from libring DRing::DataTransferInfo
struct DataTransferInfo
{
bool isOutgoing;
uint lastEvent;
qulonglong totalSize;
qulonglong bytesProgress;
QString displayName;
QString path;
};
/**
* This function add a safe way to get an enum class size
* @note it cannot be "const" due to some compiler issues
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment