diff --git a/dbus/org.nemo.ssu.xml b/dbus/org.nemo.ssu.xml
index 0b4835c..e9711ee 100644
--- a/dbus/org.nemo.ssu.xml
+++ b/dbus/org.nemo.ssu.xml
@@ -94,9 +94,9 @@
-
-
-
+
+
+
diff --git a/ssucli/ssucli.cpp b/ssucli/ssucli.cpp
index 23cf14e..5cd7578 100644
--- a/ssucli/ssucli.cpp
+++ b/ssucli/ssucli.cpp
@@ -22,6 +22,8 @@
SsuCli::SsuCli()
: QObject()
{
+ qDBusRegisterMetaType();
+
connect(this, SIGNAL(done()),
QCoreApplication::instance(), SLOT(quit()), Qt::DirectConnection);
connect(&ssu, SIGNAL(done()),
diff --git a/ssucli/ssucli.pro b/ssucli/ssucli.pro
index ca44a91..eb3b7c8 100644
--- a/ssucli/ssucli.pro
+++ b/ssucli/ssucli.pro
@@ -11,5 +11,5 @@ SOURCES = main.cpp \
ssu_dbus_interface.files = ../dbus/org.nemo.ssu.xml
ssu_dbus_interface.source_flags = -c SsuProxy
-ssu_dbus_interface.header_flags = -c SsuProxy -i ssud/ssud_include.h
+ssu_dbus_interface.header_flags = -c SsuProxy -i ssud/ssud_dbus.h
DBUS_INTERFACES += ssu_dbus_interface
diff --git a/ssud/ssud.cpp b/ssud/ssud.cpp
index 8c9f52f..5e702a0 100644
--- a/ssud/ssud.cpp
+++ b/ssud/ssud.cpp
@@ -19,6 +19,8 @@ const char *Ssud::OBJECT_PATH = "/org/nemo/ssu";
Ssud::Ssud(QObject *parent)
: QObject(parent)
{
+ qDBusRegisterMetaType();
+ qDBusRegisterMetaType>();
QDBusConnection connection = QDBusConnection::systemBus();
if (!connection.registerObject(OBJECT_PATH, this)) {
qFatal("Cannot register object at %s", OBJECT_PATH);
@@ -232,14 +234,19 @@ void Ssud::updateRepos()
autoclose.start();
}
-QVariantList Ssud::listRepos(bool rnd)
+QList Ssud::listRepos(bool rnd)
{
- QVariantList reposList;
+ QList reposList;
SsuRepoManager repoManager;
for (const QString &repo : repoManager.repos(rnd)) {
const QString repoUrl = ssu.repoUrl(repo, rnd);
- reposList << QVariantMap({{ "url", repoUrl }, { "name", repo }});
+
+ SsuRepo ssuRepo;
+ ssuRepo.name = repo;
+ ssuRepo.url = repoUrl;
+
+ reposList.append(ssuRepo);
}
autoclose.start();
return reposList;
diff --git a/ssud/ssud.h b/ssud/ssud.h
index 23d071d..17ddcea 100644
--- a/ssud/ssud.h
+++ b/ssud/ssud.h
@@ -13,7 +13,7 @@
#include
#include "libssu/ssu.h"
-#include "ssud_include.h"
+#include "ssud_dbus.h"
class Ssud: public QObject
{
@@ -46,7 +46,7 @@ public slots:
void modifyRepo(int action, const QString &repo);
void addRepo(const QString &repo, const QString &url);
void updateRepos();
- QVariantList listRepos(bool rnd);
+ QList listRepos(bool rnd);
bool error();
QString lastError();
diff --git a/ssud/ssud.pro b/ssud/ssud.pro
index 1547f57..7615bc1 100644
--- a/ssud/ssud.pro
+++ b/ssud/ssud.pro
@@ -7,7 +7,7 @@ CONFIG += link_pkgconfig
HEADERS = \
ssud.h \
- ssud_include.h
+ ssud_dbus.h
SOURCES = \
ssud.cpp \
main.cpp
@@ -27,5 +27,5 @@ INSTALLS += systemd service conf
ssu_dbus_adaptor.files = ../dbus/org.nemo.ssu.xml
ssu_dbus_adaptor.source_flags = -c SsuAdaptor
-ssu_dbus_adaptor.header_flags = -c SsuAdaptor -i ssud/ssud_include.h
+ssu_dbus_adaptor.header_flags = -c SsuAdaptor -i ssud/ssud_dbus.h
DBUS_ADAPTORS += ssu_dbus_adaptor
diff --git a/ssud/ssud_dbus.h b/ssud/ssud_dbus.h
new file mode 100644
index 0000000..53bf2b1
--- /dev/null
+++ b/ssud/ssud_dbus.h
@@ -0,0 +1,32 @@
+#ifndef SSUD_INCLUDE_H
+#define SSUD_INCLUDE_H
+
+#include
+#include
+#include
+
+struct SsuRepo {
+ QString name;
+ QString url;
+ QVariantMap parameters;
+};
+
+inline QDBusArgument &operator<<(QDBusArgument &argument, const SsuRepo &myRepo)
+{
+ argument.beginStructure();
+ argument << myRepo.name << myRepo.url << myRepo.parameters;
+ argument.endStructure();
+ return argument;
+}
+
+inline const QDBusArgument &operator>>(const QDBusArgument &argument, SsuRepo &myRepo)
+{
+ argument.beginStructure();
+ argument >> myRepo.name >> myRepo.url >> myRepo.parameters;
+ argument.endStructure();
+ return argument;
+}
+
+Q_DECLARE_METATYPE(SsuRepo)
+
+#endif // SSUD_INCLUDE_H
diff --git a/ssud/ssud_include.h b/ssud/ssud_include.h
deleted file mode 100644
index 8d660d6..0000000
--- a/ssud/ssud_include.h
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef SSUD_INCLUDE_H
-#define SSUD_INCLUDE_H
-
-#endif // SSUD_INCLUDE_H