Commit babf6054 authored by Andrew Branson's avatar Andrew Branson

[DBus] Wrap the default DBus client in a utility class. JB#47762

parent 1d0cefbf
......@@ -2,8 +2,8 @@ TARGET = ssu
include(../ssulibrary.pri)
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_dbus.h
ssu_dbus_interface.source_flags = -c SsuDBusInterface
ssu_dbus_interface.header_flags = -c SsuDBusInterface -i ssud/ssud_dbus.h
DBUS_INTERFACES += ssu_dbus_interface
# TODO: which headers are public? i.e. to be installed
......@@ -12,7 +12,7 @@ public_headers = \
ssudeviceinfo.h \
ssurepomanager.h \
ssufeaturemodel.h \
ssu_interface.h
ssuproxy.h
HEADERS = \
$${public_headers} \
......@@ -33,7 +33,8 @@ SOURCES = \
ssufeaturemodel.cpp \
ssuvariables.cpp \
ssurepomanager.cpp \
ssusettings.cpp
ssusettings.cpp \
ssuproxy.cpp
CONFIG += link_pkgconfig
QT += network xml dbus
......
#include <QDBusConnection>
#include "ssuproxy.h"
SsuProxy::SsuProxy()
: SsuDBusInterface("org.nemo.ssu", "/org/nemo/ssu", QDBusConnection::systemBus(), 0)
{
}
/**
* @file ssuproxy.h
* @copyright 2019 Jolla Ltd.
* @copyright 2019 Open Mobile Platform LLC.
* @copyright LGPLv2+
* @date 2019
*/
/*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef _SSUPROXY_H
#define _SSUPROXY_H
#include "../libssu/ssu_interface.h"
class SsuProxy: public SsuDBusInterface
{
Q_OBJECT
public:
SsuProxy();
};
#endif // _SSUPROXY_H
......@@ -45,7 +45,7 @@ SsuCli::SsuCli()
connect(&ssu, SIGNAL(done()),
this, SLOT(handleResponse()));
ssuProxy = new SsuProxy("org.nemo.ssu", "/org/nemo/ssu", QDBusConnection::systemBus(), 0);
ssuProxy = new SsuProxy();
connect(ssuProxy, SIGNAL(done()),
this, SLOT(handleDBusResponse()));
......
......@@ -31,7 +31,7 @@
#include <QDebug>
#include "libssu/ssu.h"
#include "../libssu/ssu_interface.h"
#include "libssu/ssuproxy.h"
class SsuCli: public QObject
{
......
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