From 9c4285f1754fba201f7355df46dcf589910e15bb Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 6 Jul 2005 11:10:37 +0000 Subject: [PATCH] Fix DBUS configure checks. 2005-07-06 Christian Persch * configure.ac: Fix DBUS configure checks. * shell/ev-metadata-manager.c: (ev_metadata_manager_set_int), (ev_metadata_manager_set_double), (ev_metadata_manager_set_string), (ev_metadata_manager_set_boolean): Plug mem leaks. * shell/ev-window.c: (page_changed_cb), (ev_window_run_fullscreen), (ev_window_stop_fullscreen), (ev_window_run_presentation), (ev_window_stop_presentation), (ev_window_zoom_changed_cb), (ev_window_continuous_changed_cb), (ev_window_dual_mode_changed_cb), (ev_window_new): Fix the build without DBUS. --- ChangeLog | 20 ++++++++++++++++++++ configure.ac | 12 ++++++++---- shell/ev-metadata-manager.c | 8 ++++++++ shell/ev-window.c | 20 ++++++++++++++++++-- 4 files changed, 54 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7678511a..76c3db47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2005-07-06 Christian Persch + + * configure.ac: + + Fix DBUS configure checks. + + * shell/ev-metadata-manager.c: (ev_metadata_manager_set_int), + (ev_metadata_manager_set_double), (ev_metadata_manager_set_string), + (ev_metadata_manager_set_boolean): + + Plug mem leaks. + + * shell/ev-window.c: (page_changed_cb), (ev_window_run_fullscreen), + (ev_window_stop_fullscreen), (ev_window_run_presentation), + (ev_window_stop_presentation), (ev_window_zoom_changed_cb), + (ev_window_continuous_changed_cb), + (ev_window_dual_mode_changed_cb), (ev_window_new): + + Fix the build without DBUS. + 2005-07-06 Marco Pesenti Gritti * shell/ev-metadata-manager.c: (parse_value), (save_values), diff --git a/configure.ac b/configure.ac index d28f9e86..dbf81579 100644 --- a/configure.ac +++ b/configure.ac @@ -50,12 +50,16 @@ PKG_CHECK_MODULES(POPPLER_GLIB, poppler-glib >= $POPPLER_REQUIRED) GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` AC_SUBST(GLIB_GENMARSHAL) -PKG_CHECK_EXISTS([dbus-glib-1 >= $DBUS_GLIB_REQUIRED], [enable_dbus=yes], - [AC_MSG_WARN("DBUS support is disabled since dbus 0.33 or higher was not found") - enable_dbus=no]) +PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED], + [enable_dbus=yes],[enable_dbus=no]) +AC_SUBST([DBUS_CFLAGS]) +AC_SUBST([DBUS_LIBS]) + +if test "x$enable_dbus" = "xno"; then + AC_MSG_WARN([DBUS support is disabled since dbus $DBUS_GLIB_REQUIRED or higher was not found]) +fi if test "x$enable_dbus" = "xyes" ; then - PKG_CHECK_MODULES([DBUS], [dbus-glib-1 >= $DBUS_GLIB_REQUIRED]) AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool], [no]) if test x$DBUS_BINDING_TOOL = "xno" ; then diff --git a/shell/ev-metadata-manager.c b/shell/ev-metadata-manager.c index 6e709e32..053ef947 100644 --- a/shell/ev-metadata-manager.c +++ b/shell/ev-metadata-manager.c @@ -560,6 +560,8 @@ ev_metadata_manager_set_int (const gchar *uri, const gchar *key, int value) g_value_set_int (&val, value); ev_metadata_manager_set (uri, key, &val); + + g_value_unset (&value); } void @@ -571,6 +573,8 @@ ev_metadata_manager_set_double (const gchar *uri, const gchar *key, double value g_value_set_double (&val, value); ev_metadata_manager_set (uri, key, &val); + + g_value_unset (&value); } void @@ -582,6 +586,8 @@ ev_metadata_manager_set_string (const gchar *uri, const gchar *key, const gchar g_value_set_string (&val, value); ev_metadata_manager_set (uri, key, &val); + + g_value_unset (&value); } void @@ -593,4 +599,6 @@ ev_metadata_manager_set_boolean (const gchar *uri, const gchar *key, gboolean va g_value_set_boolean (&val, value); ev_metadata_manager_set (uri, key, &val); + + g_value_unset (&value); } diff --git a/shell/ev-window.c b/shell/ev-window.c index 88392d96..4aef9afc 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -619,7 +619,9 @@ page_changed_cb (EvPageCache *page_cache, { update_action_sensitivity (ev_window); +#ifdef ENABLE_METADATA ev_metadata_manager_set_int (ev_window->priv->uri, "page", page); +#endif } static void @@ -1736,7 +1738,9 @@ ev_window_run_fullscreen (EvWindow *window) gtk_window_fullscreen (GTK_WINDOW (window)); ev_window_update_fullscreen_popup (window); +#ifdef ENABLE_METADATA ev_metadata_manager_set_boolean (window->priv->uri, "fullscreen", TRUE); +#endif } static void @@ -1764,7 +1768,9 @@ ev_window_stop_fullscreen (EvWindow *window) gtk_window_unfullscreen (GTK_WINDOW (window)); update_chrome_visibility (window); +#ifdef ENABLE_METADATA ev_metadata_manager_set_boolean (window->priv->uri, "fullscreen", FALSE); +#endif } static void @@ -1810,7 +1816,9 @@ ev_window_run_presentation (EvWindow *window) ev_window_update_presentation_action (window); update_chrome_visibility (window); +#ifdef ENABLE_METADATA ev_metadata_manager_set_boolean (window->priv->uri, "presentation", TRUE); +#endif } static void @@ -1827,7 +1835,9 @@ ev_window_stop_presentation (EvWindow *window) ev_window_update_presentation_action (window); update_chrome_visibility (window); +#ifdef ENABLE_METADATA ev_metadata_manager_set_boolean (window->priv->uri, "presentation", FALSE); +#endif } static void @@ -2241,8 +2251,10 @@ ev_window_zoom_changed_cb (EvView *view, GParamSpec *pspec, EvWindow *ev_window) { update_action_sensitivity (ev_window); +#ifdef ENABLE_METADATA ev_metadata_manager_set_double (ev_window->priv->uri, "zoom", ev_view_get_zoom (EV_VIEW (ev_window->priv->view))); +#endif } static void @@ -2277,16 +2289,22 @@ static void ev_window_continuous_changed_cb (EvView *view, GParamSpec *pspec, EvWindow *ev_window) { ev_window_update_continuous_action (ev_window); + +#ifdef ENABLE_METADATA ev_metadata_manager_set_boolean (ev_window->priv->uri, "continuous", ev_view_get_continuous (EV_VIEW (ev_window->priv->view))); +#endif } static void ev_window_dual_mode_changed_cb (EvView *view, GParamSpec *pspec, EvWindow *ev_window) { ev_window_update_dual_page_action (ev_window); + +#ifdef ENABLE_METADATA ev_metadata_manager_set_boolean (ev_window->priv->uri, "dual-page", ev_view_get_dual_page (EV_VIEW (ev_window->priv->view))); +#endif } static char * @@ -3453,5 +3471,3 @@ ev_window_new (void) return ev_window; } - - -- 2.43.5