Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deepin_reader.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ versionAtLeast(QT_VERSION, 6.0.0) {
QT += core gui widgets network sql dbus svg webchannel webenginewidgets concurrent xml

# Qt5 specific configurations
PKGCONFIG += dtkwidget dframeworkdbus
PKGCONFIG += dtkwidget dtkgui dtkcore

QMAKE_LRELEASE = lrelease

Expand Down
27 changes: 15 additions & 12 deletions reader/app/DBusObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,22 @@
#include "Application.h"
#include "Global.h"

#include <QDBusConnection>

Check warning on line 11 in reader/app/DBusObject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDBusConnection> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QDebug>

Check warning on line 12 in reader/app/DBusObject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDebug> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <DSysInfo>

Check warning on line 14 in reader/app/DBusObject.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DSysInfo> not found. Please note: Cppcheck does not need standard library headers to get proper results.

// gesture 触控板手势
#define DBUS_SERVER "com.deepin.Reader"
#define DBUS_SERVER_PATH "/com/deepin/Reader"

#ifdef OS_BUILD_V23
#define DBUS_GESTURE "org.deepin.dde.Gesture1"
#define DBUS_GESTURE_PATH "/org/deepin/dde/Gesture1"
#define DBUS_GESTURE_INTERFACE "org.deepin.dde.Gesture1"
#else
#define DBUS_GESTURE "com.deepin.daemon.Gesture"
#define DBUS_GESTURE_PATH "/com/deepin/daemon/Gesture"
#define DBUS_GESTURE_INTERFACE "com.deepin.daemon.Gesture"
#endif
#define DBUS_GESTURE_SIGNAL "Event"

#define DBUS_IM "com.deepin.im"
#define DBUS_IM_PATH "/com/deepin/im"
#define DBUS_IM_INTERFACE "com.deepin.im"
#define DBUS_IM_SIGNAL "imActiveChanged"

DCORE_USE_NAMESPACE

DBusObject *DBusObject::s_instance = nullptr;

DBusObject *DBusObject::instance()
Expand Down Expand Up @@ -65,7 +58,17 @@

dbus.registerObject(DBUS_SERVER_PATH, this, QDBusConnection::ExportScriptableSlots);

QDBusConnection::systemBus().connect(DBUS_GESTURE, DBUS_GESTURE_PATH, DBUS_GESTURE_INTERFACE, DBUS_GESTURE_SIGNAL, this, SIGNAL(sigTouchPadEventSignal(QString, QString, int)));
const QString gestureSignal = "Event";
QString gestureName = "com.deepin.daemon.Gesture";
QString gesturePath = "/com/deepin/daemon/Gesture";
// check if os edition on v23 or later
const int osMajor = DSysInfo::majorVersion().toInt();
if (osMajor >= 23) {
gestureName = "org.deepin.dde.Gesture1";
gesturePath = "/org/deepin/dde/Gesture1";
}

QDBusConnection::systemBus().connect(gestureName, gesturePath, gestureName, gestureSignal, this, SIGNAL(sigTouchPadEventSignal(QString, QString, int)));

return true;
}
Expand Down
11 changes: 0 additions & 11 deletions reader/app/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,9 @@
#include <QKeyEvent>
#include <QObject>
#include <QPainter>
#include <QString>

Check warning on line 12 in reader/app/Utils.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QString> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QIcon>

Check warning on line 13 in reader/app/Utils.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QIcon> not found. Please note: Cppcheck does not need standard library headers to get proper results.

// gesture 触控板手势
#ifdef OS_BUILD_V23
#define GESTURE_SERVICE "org.deepin.dde.Gesture"
#define GESTURE_PATH "/org/deepin/dde/Gesture"
#define GESTURE_INTERFACE "org.deepin.dde.Gesture"
#else
#define GESTURE_SERVICE "com.deepin.daemon.Gesture"
#define GESTURE_PATH "/com/deepin/daemon/Gesture"
#define GESTURE_INTERFACE "com.deepin.daemon.Gesture"
#endif
#define GESTURE_SIGNAL "Event"

class Utils : public QObject
{
Expand Down
10 changes: 1 addition & 9 deletions reader/reader.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ equals(QT_MAJOR_VERSION, 6) {
QT += core gui widgets network sql dbus svg webchannel webenginewidgets concurrent xml

# Qt5 specific configurations
PKGCONFIG += dtkwidget dframeworkdbus
PKGCONFIG += dtkwidget dtkgui dtkcore

QMAKE_LRELEASE = lrelease
}
Expand Down Expand Up @@ -72,14 +72,6 @@ TEMPLATE = app

#DEFINES += PERF_ON

# 判断系统环境
MAJOR_VERSION=$$system("cat /etc/os-version | grep MajorVersion | grep -o '[0-9]\+'")
message("MAJOR_VERSION: " $$MAJOR_VERSION)
equals(MAJOR_VERSION, 25) {
message("----------------- OS_BUILD_V25 on")
DEFINES += OS_BUILD_V23
}

#Install
target.path = $$PREFIX/bin

Expand Down
2 changes: 1 addition & 1 deletion reader/src.pri
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ equals(QT_MAJOR_VERSION, 6) {
QT += core gui widgets network sql dbus svg webchannel webenginewidgets concurrent xml

# Qt5 specific configurations
PKGCONFIG += dtkwidget dframeworkdbus
PKGCONFIG += dtkwidget dtkgui dtkcore

QMAKE_LRELEASE = lrelease
}
Expand Down