diff --git a/CMakeLists.txt b/CMakeLists.txt index 94d4baa..ed3acbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,29 +1,31 @@ cmake_minimum_required(VERSION 3.16) -set(KF5_MIN_VERSION "5.54") project(xdg-desktop-portal-dde - VERSION 1.0.0 + VERSION 1.0.0 ) set(CMAKE_CXX_STANDARD 17) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_AUTOMOC ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX /usr) + set(CMAKE_INSTALL_PREFIX /usr) endif () + include(GNUInstallDirs) add_subdirectory(src) configure_file( - misc/xdg-desktop-portal-dde.service.in - xdg-desktop-portal-dde.service - @ONLY) + misc/xdg-desktop-portal-dde.service.in + xdg-desktop-portal-dde.service + @ONLY) configure_file( - misc/org.freedesktop.impl.portal.desktop.dde.service.in - org.freedesktop.impl.portal.desktop.dde.service - @ONLY) + misc/org.freedesktop.impl.portal.desktop.dde.service.in + org.freedesktop.impl.portal.desktop.dde.service + @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xdg-desktop-portal-dde.service DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/systemd/user/") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.freedesktop.impl.portal.desktop.dde.service DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services") diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index bf68b2e..1b53933 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -8,8 +8,8 @@ pkgdesc='xdg-desktop-portal backend for deepin' arch=('x86_64' 'aarch64') url='https://github.com/linuxdeepin/xdg-desktop-portal-dde' license=('LGPL3') -depends=('qt5-base' 'qt5-wayland' 'wayland' 'ki18n5' 'dwayland-git' 'knotifications5') -makedepends=('git' 'ninja' 'cmake' 'qt5-tools' 'wayland-protocols' 'extra-cmake-modules') +depends=('qt6-base' 'qt6-wayland' 'wayland') +makedepends=('git' 'ninja' 'cmake' 'qt6-tools' 'wayland-protocols') provides=('xdg-desktop-portal-impl') groups=('deepin-git') source=("${sourcetars[@]}") diff --git a/debian/control b/debian/control index 465748a..1c5a1b5 100644 --- a/debian/control +++ b/debian/control @@ -6,22 +6,12 @@ Build-Depends: cmake (>= 3.0~), dbus-x11, debhelper (>= 11~), - extra-cmake-modules (>= 5.50.0~), - qtwayland5-dev-tools, - libkf5coreaddons-dev (>= 5.50.0~), - libkf5i18n-dev (>= 5.50.0~), - libkf5notifications-dev (>= 5.50.0~), - libkf5widgetsaddons-dev (>= 5.50.0~), - libkf5windowsystem-dev (>= 5.50.0~), - pkg-kde-tools (>= 0.15.18~), - qtbase5-dev (>= 5.11.0~), - qtbase5-private-dev, + qt6-base-dev, + qt6-wayland, + qt6-wayland-dev, + qt6-wayland-dev-tools, libpipewire-0.3-dev, - libgbm-dev, - libepoxy-dev, - libkf5declarative-dev, libwayland-dev, - libdwayland-dev Standards-Version: 4.5.0 Package: xdg-desktop-portal-dde diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ce24b2c..65f8d5f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,26 +1,11 @@ -find_package(QT NAMES Qt5 REQUIRED COMPONENTS Core) find_package( - Qt${QT_VERSION_MAJOR} CONFIG REQUIRED COMPONENTS - Core - Concurrent - DBus - Widgets) -find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) - -set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) - -find_package(QtWaylandScanner REQUIRED) - -find_package(KF5 ${KF5_MIN_VERSION} REQUIRED - I18n - Notifications -) - -find_package(DWayland REQUIRED) -find_package(Wayland 1.15 REQUIRED COMPONENTS Client) -find_package(PkgConfig) - -set(CMAKE_INCLUDE_CURRENT_DIR ON) + Qt6 CONFIG REQUIRED COMPONENTS + Core + Concurrent + DBus + Widgets + WaylandClient) +find_package(Qt6WaylandScannerTools REQUIRED) set_source_files_properties( ${CMAKE_SOURCE_DIR}/misc/org.freedesktop.Notifications.xml @@ -30,75 +15,65 @@ set_source_files_properties( NO_NAMESPACE OFF ) -qt5_add_dbus_interface(NotificationInterface + +qt6_add_dbus_interface(NotificationInterface ${CMAKE_SOURCE_DIR}/misc/org.freedesktop.Notifications.xml notification_interface ) set(SRC - ${NotificationInterface} - xdg-desktop-portal-dde.cpp - ddesktopportal.h - ddesktopportal.cpp - screenshot.h - screenshot.cpp - background.h - background.cpp - filechooser.h - filechooser.cpp - wallpaper.h - wallpaper.cpp - notification.h - notification.cpp - settings.h - settings.cpp - inhibit.h - inhibit.cpp - appchooser.h - appchooser.cpp - appchooserdialog.h - appchooserdialog.cpp - appchooserdelegate.h - appchooserdelegate.cpp - appchoosermodel.h - appchoosermodel.cpp - iteminfo.h - iteminfo.cpp - account.h - account.cpp - globalshortcut.h - globalshortcut.cpp - lockdown.h - lockdown.cpp - secret.h - secret.cpp - request.h - request.cpp - dbushelpers.h - utils.h - utils.cpp -) - -ecm_add_qtwayland_client_protocol(SRC - PROTOCOL ${CMAKE_SOURCE_DIR}/misc/zkde-screencast-unstable-v1.xml - BASENAME zkde-screencast-unstable-v1 -) - -ecm_add_qtwayland_client_protocol(SRC - PROTOCOL ${Wayland_DATADIR}/wayland.xml - BASENAME wayland + ${NotificationInterface} + xdg-desktop-portal-dde.cpp + ddesktopportal.h + ddesktopportal.cpp + screenshot.h + screenshot.cpp + background.h + background.cpp + filechooser.h + filechooser.cpp + wallpaper.h + wallpaper.cpp + notification.h + notification.cpp + settings.h + settings.cpp + inhibit.h + inhibit.cpp + appchooser.h + appchooser.cpp + appchooserdialog.h + appchooserdialog.cpp + appchooserdelegate.h + appchooserdelegate.cpp + appchoosermodel.h + appchoosermodel.cpp + iteminfo.h + iteminfo.cpp + account.h + account.cpp + globalshortcut.h + globalshortcut.cpp + lockdown.h + lockdown.cpp + secret.h + secret.cpp + request.h + request.cpp + dbushelpers.h + utils.h + utils.cpp ) add_executable(${PROJECT_NAME} - ${SRC}) + ${SRC}) target_link_libraries(${PROJECT_NAME} PUBLIC - Qt${QT_VERSION_MAJOR}::Core - Qt${QT_VERSION_MAJOR}::Widgets - Qt${QT_VERSION_MAJOR}::Gui - Qt${QT_VERSION_MAJOR}::DBus - Qt${QT_VERSION_MAJOR}::Concurrent - DWaylandClient - Wayland::Client) + Qt::Core + Qt::Widgets + Qt::Gui + Qt::DBus + Qt::Concurrent + Qt::WaylandClient) install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}) diff --git a/src/notification.cpp b/src/notification.cpp index 9a7e6b6..c183a28 100644 --- a/src/notification.cpp +++ b/src/notification.cpp @@ -49,7 +49,7 @@ void NotificationPortal::AddNotification(const QString &app_id, const QString &i } QStringList actions; - for (const QVariantMap &button : qAsConst(buttons)) { + for (const QVariantMap &button : std::as_const(buttons)) { actions << button.value(QStringLiteral("label")).toString(); }