From bb21532cc48d88c815c832cf2fefd70cd3dad9a4 Mon Sep 17 00:00:00 2001 From: Bernd Wachter Date: Mon, 24 Aug 2015 14:33:52 +0300 Subject: [PATCH] [dbus] Fix and extend setDeviceMode, JB#31745 Move setDeviceMode to a int instead of custom type. Also make the extended interface with edit mode specification available. --- dbus/org.nemo.ssu.xml | 4 ++++ ssud/ssud.cpp | 11 +++++++++-- ssud/ssud.h | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/dbus/org.nemo.ssu.xml b/dbus/org.nemo.ssu.xml index 291f630..3daf276 100644 --- a/dbus/org.nemo.ssu.xml +++ b/dbus/org.nemo.ssu.xml @@ -63,6 +63,10 @@ + + + + diff --git a/ssud/ssud.cpp b/ssud/ssud.cpp index 08b11a9..714a3b8 100644 --- a/ssud/ssud.cpp +++ b/ssud/ssud.cpp @@ -122,8 +122,15 @@ Ssu::DeviceModeFlags Ssud::deviceMode(){ return ssu.deviceMode(); } -void Ssud::setDeviceMode(enum Ssu::DeviceMode mode){ - ssu.setDeviceMode(mode); +void Ssud::setDeviceMode(int mode){ + setDeviceMode(mode, Ssu::Replace); +} + +void Ssud::setDeviceMode(int mode, int editMode){ + ssu.setDeviceMode( + Ssu::DeviceModeFlags(mode), + Ssu::EditMode(editMode) + ); SsuRepoManager repoManager; repoManager.update(); diff --git a/ssud/ssud.h b/ssud/ssud.h index 9325bb5..c932cfa 100644 --- a/ssud/ssud.h +++ b/ssud/ssud.h @@ -34,7 +34,8 @@ class Ssud: public QObject { void unregisterDevice(); /* repository management */ Ssu::DeviceModeFlags deviceMode(); - void setDeviceMode(enum Ssu::DeviceMode mode); + void setDeviceMode(int mode); + void setDeviceMode(int mode, int editMode); QString flavour(); void setFlavour(const QString &release); QString release(bool rnd);