]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Add Flatpak patches to Dolphin depending on CMake definition
authorClaudio Cambra <claudio.cambra@gmail.com>
Tue, 4 Jan 2022 21:53:44 +0000 (21:53 +0000)
committerClaudio Cambra <claudio.cambra@gmail.com>
Tue, 4 Jan 2022 21:53:44 +0000 (21:53 +0000)
When Dolphin gets packaged as a flatpak, this patch gets applied:

https://invent.kde.org/packaging/flatpak-kde-applications/-/blob/master/dolphinpatch.patch

That's not really an ideal solution, so this is probably a better idea -- to upstream the patches and apply them depending on a CMake definition

CMakeLists.txt
src/CMakeLists.txt
src/main.cpp

index 6ab68cc9329944539fdf57cb9fcae118a56b2ebf..2f26ae85f96ac7f3a9501518b95a3135c2107073 100644 (file)
@@ -175,13 +175,22 @@ install(FILES
     COMPONENT Devel
 )
 
-ecm_generate_dbus_service_file(
-   NAME org.freedesktop.FileManager1
-   EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
-   SYSTEMD_SERVICE plasma-dolphin.service
-   DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
-   RENAME org.kde.dolphin.FileManager1.service
-)
+if(FLATPAK)
+    ecm_generate_dbus_service_file(
+        NAME org.freedesktop.FileManager1
+        EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
+        SYSTEMD_SERVICE plasma-dolphin.service
+        DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
+    )
+else()
+    ecm_generate_dbus_service_file(
+        NAME org.freedesktop.FileManager1
+        EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
+        SYSTEMD_SERVICE plasma-dolphin.service
+        DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
+        RENAME org.kde.dolphin.FileManager1.service
+    )
+endif()
 
 ecm_install_configured_files(INPUT plasma-dolphin.service.in DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR})
 
index b97a5d7c0018a873b8c92352d1baf277eff19edc..651f021e6400841e6e36766ba5371f9027be5475 100644 (file)
@@ -340,6 +340,10 @@ target_sources(dolphin PRIVATE
     main.cpp
 )
 
+if(FLATPAK)
+    target_compile_definitions(dolphin PRIVATE FLATPAK)
+endif()
+
 # Sets the icon on Windows and OSX
 file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
 ecm_add_app_icon(dolphin_APPICON_SRCS ICONS ${ICONS_SRCS})
index cda28c80c709ad67ed729ef51236ee0852139156..7a2d42ea5cfe6843a0c1a621ed36b4e9f7eda67f 100644 (file)
@@ -154,7 +154,11 @@ int main(int argc, char **argv)
         QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
         QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
 
+#ifdef FLATPAK
+        KDBusService dolphinDBusService(KDBusService::NoExitOnFailure);
+#else
         KDBusService dolphinDBusService;
+#endif
         DBusInterface interface;
         interface.setAsDaemon();
         return app.exec();