Commit 8822c250 authored by Nate Graham's avatar Nate Graham 🔩
Browse files

Find qdbus command correctly

Summary:
Spectacle's Desktop file assumes that `qdbus` is in $PATH. However this is not
guaranteed; the command lives in the Qt binaries dir which is not typically in $PATH,
and distros typically create symlinks with different names in `/usr/bin`, but not all
create a second compatibility symlink at `/usr/bin/qdbus` that points to the version
for the current Qt version.

Therefore, we should find the command in the Qt binaries dir itself rather than relying
on these compatibility symlinks.

BUG: 413007
FIXED-IN: 20.04.0

Test Plan:
- Delete the `/usr/bin/qdbus` symlink, if you have one
- Compile and install Spectacle
- Hit PrintScreen
- See that Spectacle still opens

Reviewers: davidedmundson, #spectacle, sitter

Reviewed By: sitter

Subscribers: sitter, #plasma, rdieter, kossebau, fvogt, davidre

Tags: #spectacle

Differential Revision: https://phabricator.kde.org/D25883
parent 3d244743
......@@ -39,6 +39,7 @@ include(ECMSetupVersion)
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
include(ECMQueryQmake)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
......@@ -112,6 +113,9 @@ if (NOT XCB_FOUND OR NOT XCB_COMPONENTS_FOUND)
message(FATAL_ERROR "No suitable backend platform was found. Currently supported platforms are: XCB Components Required: ${XCB_COMPONENTS_ERRORS}")
endif()
# locate qdbus in the Qt path because not every distro makes a symlink at /usr/bin/qdbus
query_qmake(QtBinariesDir QT_INSTALL_BINS)
# hand off to subdirectories
add_subdirectory(src)
......
# install the .desktop and rc files in the correct place
configure_file(org.kde.spectacle.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/org.kde.spectacle.desktop)
install(
PROGRAMS org.kde.spectacle.desktop
PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.spectacle.desktop
DESTINATION ${XDG_APPS_INSTALL_DIR}
)
......
......@@ -137,7 +137,7 @@ Keywords[uk]=знімок;захоплення;друк;знімок вікна;
Keywords[x-test]=xxsnapshotxx;xxcapturexx;xxprintxx;xxscreenshotxx;xxsnippingxx;xxsnipxx;
Keywords[zh_CN]=snapshot;capture;print;screenshot;snipping;snip;快照;截图;抓取;屏幕截图;截屏;抓屏;
Keywords[zh_TW]=snapshot;capture;print;screenshot;snipping;snip;截圖;擷取;截圖程式
Exec=qdbus org.kde.Spectacle / StartAgent
Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / StartAgent
Icon=spectacle
Type=Application
Terminal=false
......@@ -187,7 +187,7 @@ Name[uk]=Захопити зображення усієї стільниці
Name[x-test]=xxCapture Entire Desktopxx
Name[zh_CN]=截取整个桌面
Name[zh_TW]=擷取整個桌面
Exec=qdbus org.kde.Spectacle / FullScreen false
Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / FullScreen false
X-KDE-Shortcuts=Shift+Print
[Desktop Action CurrentMonitorScreenShot]
......@@ -230,7 +230,7 @@ Name[uk]=Захопити зображення на моніторі
Name[x-test]=xxCapture Current Monitorxx
Name[zh_CN]=截取当前显示器
Name[zh_TW]=擷取目前螢幕
Exec=qdbus org.kde.Spectacle / CurrentScreen false
Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / CurrentScreen false
[Desktop Action ActiveWindowScreenShot]
......@@ -273,7 +273,7 @@ Name[uk]=Захопити зображення активного вікна
Name[x-test]=xxCapture Active Windowxx
Name[zh_CN]=截取活动窗口
Name[zh_TW]=擷取作用中的視窗
Exec=qdbus org.kde.Spectacle / ActiveWindow true false
Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / ActiveWindow true false
X-KDE-Shortcuts=Meta+Print
[Desktop Action RectangularRegionScreenShot]
......@@ -316,5 +316,5 @@ Name[uk]=Захопити прямокутну область екрана
Name[x-test]=xxCapture Rectangular Regionxx
Name[zh_CN]=截取矩形区域
Name[zh_TW]=擷取矩形區域
Exec=qdbus org.kde.Spectacle / RectangularRegion true
Exec=@QtBinariesDir@/qdbus org.kde.Spectacle / RectangularRegion true
X-KDE-Shortcuts=Meta+Shift+Print
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment