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