Skip to content
Snippets Groups Projects
Commit 2650dc1e authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Anthony Léonard
Browse files

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
Branches
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ Q_DECLARE_METATYPE(VectorUInt) ...@@ -40,6 +40,7 @@ Q_DECLARE_METATYPE(VectorUInt)
Q_DECLARE_METATYPE(VectorString) Q_DECLARE_METATYPE(VectorString)
Q_DECLARE_METATYPE(MapStringVectorString) Q_DECLARE_METATYPE(MapStringVectorString)
Q_DECLARE_METATYPE(VectorVectorByte) Q_DECLARE_METATYPE(VectorVectorByte)
Q_DECLARE_METATYPE(DataTransferInfo)
#ifndef ENABLE_LIBWRAP #ifndef ENABLE_LIBWRAP
static bool dbus_metaTypeInit = false; static bool dbus_metaTypeInit = false;
...@@ -55,10 +56,40 @@ inline void registerCommTypes() { ...@@ -55,10 +56,40 @@ inline void registerCommTypes() {
qDBusRegisterMetaType<VectorString> (); qDBusRegisterMetaType<VectorString> ();
qDBusRegisterMetaType<MapStringVectorString> (); qDBusRegisterMetaType<MapStringVectorString> ();
qDBusRegisterMetaType<VectorVectorByte> (); qDBusRegisterMetaType<VectorVectorByte> ();
qDBusRegisterMetaType<DataTransferInfo> ();
dbus_metaTypeInit = true; dbus_metaTypeInit = true;
#endif #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 #pragma GCC diagnostic pop
...@@ -38,6 +38,17 @@ typedef QMap< QString, QMap< QString, QStringList > > MapStringMapStringSt ...@@ -38,6 +38,17 @@ typedef QMap< QString, QMap< QString, QStringList > > MapStringMapStringSt
typedef QMap< QString, QStringList > MapStringStringList ; typedef QMap< QString, QStringList > MapStringStringList ;
typedef QVector< QByteArray > VectorVectorByte ; 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 * This function add a safe way to get an enum class size
* @note it cannot be "const" due to some compiler issues * @note it cannot be "const" due to some compiler issues
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment