1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-04 17:30:55 +00:00

Add Flatpak patches to Dolphin depending on CMake definition

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
This commit is contained in:
Claudio Cambra 2022-01-04 21:53:44 +00:00
parent dafa1e1f20
commit 3abc4cfcd4
3 changed files with 24 additions and 7 deletions

View File

@ -175,13 +175,22 @@ install(FILES
COMPONENT Devel COMPONENT Devel
) )
ecm_generate_dbus_service_file( if(FLATPAK)
NAME org.freedesktop.FileManager1 ecm_generate_dbus_service_file(
EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon" NAME org.freedesktop.FileManager1
SYSTEMD_SERVICE plasma-dolphin.service EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR} SYSTEMD_SERVICE plasma-dolphin.service
RENAME org.kde.dolphin.FileManager1.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}) ecm_install_configured_files(INPUT plasma-dolphin.service.in DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR})

View File

@ -340,6 +340,10 @@ target_sources(dolphin PRIVATE
main.cpp main.cpp
) )
if(FLATPAK)
target_compile_definitions(dolphin PRIVATE FLATPAK)
endif()
# Sets the icon on Windows and OSX # Sets the icon on Windows and OSX
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png") file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
ecm_add_app_icon(dolphin_APPICON_SRCS ICONS ${ICONS_SRCS}) ecm_add_app_icon(dolphin_APPICON_SRCS ICONS ${ICONS_SRCS})

View File

@ -154,7 +154,11 @@ int main(int argc, char **argv)
QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement); QObject::connect(&app, &QGuiApplication::commitDataRequest, disableSessionManagement);
QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement); QObject::connect(&app, &QGuiApplication::saveStateRequest, disableSessionManagement);
#ifdef FLATPAK
KDBusService dolphinDBusService(KDBusService::NoExitOnFailure);
#else
KDBusService dolphinDBusService; KDBusService dolphinDBusService;
#endif
DBusInterface interface; DBusInterface interface;
interface.setAsDaemon(); interface.setAsDaemon();
return app.exec(); return app.exec();