Commit 2bd0af0d authored by jpetrell's avatar jpetrell

Merge branch 'jb40252' into 'master'

[ssu] Expose Ssu to QML. Contributes to JB#40252

See merge request !16
parents ac93ab38 1d2c0b32
......@@ -11,6 +11,7 @@
#include <qqml.h>
#include "declarativessufeaturemodel.h"
#include "declarativessudeviceinfo.h"
#include "../libssu/ssu.h"
static QObject *device_info_factory(QQmlEngine *, QJSEngine *)
{
......@@ -27,6 +28,7 @@ public:
{
qmlRegisterType<DeclarativeSsuFeatureModel>("Nemo.Ssu", 1, 0, "FeatureModel");
qmlRegisterSingletonType<DeclarativeSsuDeviceInfo>("Nemo.Ssu", 1, 1, "DeviceInfo", device_info_factory);
qmlRegisterType<Ssu>("Nemo.Ssu", 1, 1, "Ssu");
}
};
......
......@@ -22,6 +22,9 @@ class Ssu: public QObject
friend class UrlResolverTest;
Q_PROPERTY(bool registered READ isRegistered NOTIFY registrationStatusChanged)
Q_PROPERTY(DeviceModeFlags deviceMode READ deviceMode CONSTANT)
Q_PROPERTY(QString domain READ domain CONSTANT)
public:
/**
* Filters to control the output of the repository lookup methods
......@@ -53,6 +56,7 @@ public:
};
Q_DECLARE_FLAGS(DeviceModeFlags, DeviceMode)
Q_FLAGS(DeviceModeFlags)
/**
* A list of types ssu provides shiny values suitable for displaying
......
......@@ -136,7 +136,8 @@ QString Ssud::domain()
return ssu.domain();
}
Ssu::DeviceModeFlags Ssud::deviceMode()
// called by DBus Adaptor, return integer instead of enum Ssu::DeviceModeFlags
int Ssud::deviceMode()
{
autoclose.start();
return ssu.deviceMode();
......
......@@ -35,7 +35,7 @@ public slots:
void unregisterDevice();
QString domain();
/* repository management */
Ssu::DeviceModeFlags deviceMode();
int deviceMode();
void setDeviceMode(int mode);
void setDeviceMode(int mode, int editMode);
QString flavour();
......
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