From 6712098bb073ef43589ba16f4b7060026bf8f6df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Poo-Caama=C3=B1o?= Date: Fri, 15 Dec 2023 21:13:31 -0300 Subject: [PATCH] shell: Move dbus dependent definitions to meson --- meson.build | 11 +++++++++++ shell/ev-application.c | 9 --------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/meson.build b/meson.build index ba607e622..d1a34f163 100644 --- a/meson.build +++ b/meson.build @@ -181,6 +181,17 @@ if ev_platform == 'gnome' if enable_dbus # Check for dbus service dir dbus_service_dir = dependency('dbus-1').get_variable(pkgconfig: 'session_bus_services_dir', pkgconfig_define: ['datadir', ev_datadir]) + + dbus_app_path = '/@0@/Evince'.format(ev_app_id.replace('.', '/')) + dbus_app_interface = '@0@.Application'.format(ev_app_id) + dbus_evince_daemon = '@0@.Daemon'.format(ev_app_id) + dbus_evince_daemon_path = '/@0@/Daemon'.format(ev_app_id.replace('.', '/')) + + config_h.set_quoted('APPLICATION_DBUS_OBJECT_PATH', dbus_app_path) + config_h.set_quoted('APPLICATION_DBUS_INTERFACE', dbus_app_interface) + config_h.set_quoted('EVINCE_DAEMON_SERVICE', dbus_evince_daemon) + config_h.set_quoted('EVINCE_DAEMON_OBJECT_PATH', dbus_evince_daemon_path) + config_h.set_quoted('EVINCE_DAEMON_INTERFACE', dbus_evince_daemon) endif config_h.set('ENABLE_DBUS', enable_dbus) diff --git a/shell/ev-application.c b/shell/ev-application.c index b570b5f42..a87adfea8 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -64,15 +64,6 @@ struct _EvApplicationClass { G_DEFINE_TYPE (EvApplication, ev_application, GTK_TYPE_APPLICATION) -#ifdef ENABLE_DBUS -#define APPLICATION_DBUS_OBJECT_PATH "/org/gnome/evince/Evince" -#define APPLICATION_DBUS_INTERFACE "org.gnome.evince.Application" - -#define EVINCE_DAEMON_SERVICE "org.gnome.evince.Daemon" -#define EVINCE_DAEMON_OBJECT_PATH "/org/gnome/evince/Daemon" -#define EVINCE_DAEMON_INTERFACE "org.gnome.evince.Daemon" -#endif - static void _ev_application_open_uri_at_dest (EvApplication *application, const gchar *uri, GdkScreen *screen,