Skip to content

Commit

Permalink
[dbus] Fix and extend setDeviceMode, JB#31745
Browse files Browse the repository at this point in the history
Move setDeviceMode to a int instead of custom type. Also make the
extended interface with edit mode specification available.
  • Loading branch information
Bernd Wachter committed Aug 24, 2015
1 parent 0136629 commit bb21532
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions dbus/org.nemo.ssu.xml
Expand Up @@ -63,6 +63,10 @@
<method name="setDeviceMode">
<arg direction="in" type="i" name="mode"/>
</method>
<method name="setDeviceMode">
<arg direction="in" type="i" name="mode"/>
<arg direction="in" type="i" name="editMode"/>
</method>
<method name="flavour">
<arg direction="out" type="s" name="flavour"/>
</method>
Expand Down
11 changes: 9 additions & 2 deletions ssud/ssud.cpp
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion ssud/ssud.h
Expand Up @@ -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);
Expand Down

0 comments on commit bb21532

Please sign in to comment.