Skip to content

Commit 05f78cd

Browse files
wangrong1069deepin-bot[bot]
authored andcommitted
feat: Adapt to V23 dde dbus interface
As title. Log: Adapt to V23 dde dbus interface
1 parent ac0b197 commit 05f78cd

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

src/main/dbusmanager.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#define DBUSMANAGER_H
88
#include "service.h"
99

10+
#include <DSysInfo>
11+
1012
#include <QObject>
1113
#include <QList>
1214
#include <QVariant>
@@ -20,19 +22,24 @@
2022
#define KWINDBUSPATH "/KWin"
2123

2224
// deepin Appearance
23-
#define APPEARANCESERVICE "com.deepin.daemon.Appearance"
24-
#define APPEARANCEPATH "/com/deepin/daemon/Appearance"
25+
inline const char *getAppearanceService() { return Dtk::Core::DSysInfo::majorVersion().toInt() >= 23 ? "org.deepin.dde.Appearance1" : "com.deepin.daemon.Appearance"; }
26+
inline const char *getAppearancePath() { return Dtk::Core::DSysInfo::majorVersion().toInt() >= 23 ? "/org/deepin/dde/Appearance1" : "/com/deepin/daemon/Appearance"; }
27+
#define APPEARANCESERVICE getAppearanceService()
28+
#define APPEARANCEPATH getAppearancePath()
2529

2630
// sound effect 音效服务
27-
#define SOUND_EFFECT_SERVICE "com.deepin.daemon.SoundEffect"
28-
#define SOUND_EFFECT_PATH "/com/deepin/daemon/SoundEffect"
29-
#define SOUND_EFFECT_INTERFACE "com.deepin.daemon.SoundEffect"
30-
#define SOUND_EFFECT_METHOD(method) QDBusMessage::createMethodCall(SOUND_EFFECT_SERVICE, SOUND_EFFECT_PATH, SOUND_EFFECT_INTERFACE, (method))
31+
inline const char *getSoundEffectService() { return Dtk::Core::DSysInfo::majorVersion().toInt() >= 23 ? "org.deepin.dde.SoundEffect1" : "com.deepin.daemon.SoundEffect"; }
32+
inline const char *getSoundEffectPath() { return Dtk::Core::DSysInfo::majorVersion().toInt() >= 23 ? "/org/deepin/dde/SoundEffect1" : "/com/deepin/daemon/SoundEffect"; }
33+
inline const char *getSoundEffectInterface() { return Dtk::Core::DSysInfo::majorVersion().toInt() >= 23 ? "org.deepin.dde.SoundEffect1" : "com.deepin.daemon.SoundEffect"; }
34+
#define SOUND_EFFECT_METHOD(method) QDBusMessage::createMethodCall(getSoundEffectService(), getSoundEffectPath(), getSoundEffectInterface(), (method))
3135

3236
// gesture 触控板手势
33-
#define GESTURE_SERVICE "com.deepin.daemon.Gesture"
34-
#define GESTURE_PATH "/com/deepin/daemon/Gesture"
35-
#define GESTURE_INTERFACE "com.deepin.daemon.Gesture"
37+
inline const char *getGestureService() { return Dtk::Core::DSysInfo::majorVersion().toInt() >= 23 ? "org.deepin.dde.Gesture1" : "com.deepin.daemon.Gesture"; }
38+
inline const char *getGesturePath() { return Dtk::Core::DSysInfo::majorVersion().toInt() >= 23 ? "/org/deepin/dde/Gesture1" : "/com/deepin/daemon/Gesture"; }
39+
inline const char *getGestureInterface() { return Dtk::Core::DSysInfo::majorVersion().toInt() >= 23 ? "org.deepin.dde.Gesture1" : "com.deepin.daemon.Gesture"; }
40+
#define GESTURE_SERVICE getGestureService()
41+
#define GESTURE_PATH getGesturePath()
42+
#define GESTURE_INTERFACE getGestureInterface()
3643
#define GESTURE_SIGNAL "Event"
3744

3845
// deepin wm 窗管

0 commit comments

Comments
 (0)