mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-01 07:05:48 +00:00
fix: 修复debian打包使用AM宏不生效的问题
原因:rule中定义的宏只在CMakeLists.txt文件中生效,在c++代码中不生效 解决方案:在CMakeLists.txt文件中直接定义一个宏来判断是否使用AM,这样c++代码中就可以使用CMakeLists.txt文件中的宏 Log: Influence: 任务栏是否使用AM服务 Task: https://pms.uniontech.com/task-view-133075.html Change-Id: Icea6ac1ac4d86dfc4f4aab040deabe99a9d1d83c
This commit is contained in:
parent
c3b956d0dc
commit
5f4429b3f8
@ -52,6 +52,8 @@ endif()
|
||||
|
||||
file(GLOB INTERFACES "interfaces/*.h")
|
||||
|
||||
add_compile_definitions(USE_AM)
|
||||
|
||||
#因为单元测试需要直接测试源代码,而主程序代码中include的单元使用了相对路径
|
||||
#单元测试的CMakeLists和主程序的CMakeLists路径不同,编译单元测试时会提示找不到文件
|
||||
#因此设置搜索路径
|
||||
|
3
debian/rules
vendored
3
debian/rules
vendored
@ -12,5 +12,4 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- \
|
||||
-DHOST_MULTIARCH="$(DEB_HOST_MULTIARCH)" \
|
||||
-DUSE_AM=YES
|
||||
-DHOST_MULTIARCH="$(DEB_HOST_MULTIARCH)"
|
||||
|
@ -100,11 +100,17 @@ void LauncherItem::mouseReleaseEvent(QMouseEvent *e)
|
||||
if (e->button() != Qt::LeftButton)
|
||||
return;
|
||||
|
||||
#ifdef USE_AM
|
||||
DDBusSender dbusSender = DDBusSender()
|
||||
.service("org.deepin.dde.Launcher1")
|
||||
.path("/org/deepin/dde/Launcher1")
|
||||
.interface("org.deepin.dde.Launcher1");
|
||||
#else
|
||||
DDBusSender dbusSender = DDBusSender()
|
||||
.service("com.deepin.dde.Launcher")
|
||||
.path("/com/deepin/dde/Launcher")
|
||||
.interface("com.deepin.dde.Launcher");
|
||||
|
||||
#endif
|
||||
QDBusPendingReply<bool> visibleReply = dbusSender.property("Visible").get();
|
||||
if (!visibleReply.value())
|
||||
dbusSender.method("Show").call();
|
||||
|
Loading…
x
Reference in New Issue
Block a user