[Xfce4-commits] <xfdesktop:master> Fix compiling with --disable-desktop-icons

Eric Koegel noreply at xfce.org
Sun Sep 1 16:48:01 CEST 2013


Updating branch refs/heads/master
         to 86a3dc66e2b27771e8c3997a0c2db8d4d9ef2f03 (commit)
       from deed58cbb4fc984bd3bcfc5808533e21c57d1148 (commit)

commit 86a3dc66e2b27771e8c3997a0c2db8d4d9ef2f03
Author: Eric Koegel <eric.koegel at gmail.com>
Date:   Sun Sep 1 17:45:17 2013 +0300

    Fix compiling with --disable-desktop-icons

 common/Makefile.am |   17 ++++-------------
 configure.ac.in    |   20 +++-----------------
 src/xfce-desktop.c |   16 ++++++++--------
 3 files changed, 15 insertions(+), 38 deletions(-)

diff --git a/common/Makefile.am b/common/Makefile.am
index b2f24b0..731ca74 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -7,26 +7,17 @@ libxfdesktop_built_sources = \
 libxfdesktop_la_SOURCES = \
 	$(libxfdesktop_built_sources) \
 	xfdesktop-common.c \
-	xfdesktop-common.h
+	xfdesktop-common.h \
+	xfdesktop-thumbnailer.c \
+	xfdesktop-thumbnailer.h
 
 libxfdesktop_la_CFLAGS = \
 	-I$(top_srcdir)/src \
 	$(LIBXFCE4UTIL_CFLAGS) \
-	$(GTK_CFLAGS)
-
-if ENABLE_DESKTOP_ICONS
-if ENABLE_FILE_ICONS
-
-libxfdesktop_la_SOURCES += \
-	xfdesktop-thumbnailer.c \
-	xfdesktop-thumbnailer.h
-
-libxfdesktop_la_CFLAGS += \
+	$(GTK_CFLAGS) \
 	-DDBUS_API_SUBJECT_TO_CHANGE \
 	$(DBUS_CFLAGS)
 
-endif
-endif
 
 if MAINTAINER_MODE
 
diff --git a/configure.ac.in b/configure.ac.in
index 8a4c309..b5f74d5 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -93,6 +93,9 @@ XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [xfconf_minimum_version])
 XDT_CHECK_OPTIONAL_PACKAGE([GIO_UNIX], [gio-unix-2.0], [glib_minimum_version], [gio-unix],
     [gio-unix, for special treatment of mount points on UNIX])
 
+XDT_CHECK_OPTIONAL_PACKAGE([DBUS], [dbus-glib-1], [dbus_minimum_version], [dbus-glib],
+    [dbus-glib, for dbus calls to the thumbnail and file manager services])
+
 dnl do we want desktop icons at all?
 AC_ARG_ENABLE([desktop-icons],
     [AC_HELP_STRING([--disable-desktop-icons],
@@ -119,23 +122,6 @@ else
     enable_file_icons="yes"
 fi
 
-if test "x$enable_desktop_icons" = "xyes" -a "x$enable_file_icons" = "xyes"; then
-    dnl here i shall abuse the XDT_CHECK_PACKAGE macro
-    XDT_CHECK_PACKAGE([DBUS], [dbus-glib-1], [dbus_minimum_version], [], [
-echo "*** Optional package dbus-glib-1 was either not found on your system"
-echo "*** or is too old.  Please install or upgrade to at least version"
-echo "*** dbus_minimum_version, or adjust the PKG_CONFIG_PATH environment variable"
-echo "*** if you installed the new version of the package in a nonstandard"
-echo "*** prefix.  File/launcher icons will be disabled."
-])
-    enable_file_icons="no"
-    if test "x$DBUS_VERSION" != "x"; then
-        enable_file_icons="yes"
-        AC_DEFINE([ENABLE_FILE_ICONS], [1],
-                  [Define if file icons should be enabled])
-    fi
-fi
-
 AM_CONDITIONAL([ENABLE_FILE_ICONS], [test "x$enable_file_icons" = "xyes"])
 
 
diff --git a/src/xfce-desktop.c b/src/xfce-desktop.c
index 42712aa..4410358 100644
--- a/src/xfce-desktop.c
+++ b/src/xfce-desktop.c
@@ -795,7 +795,7 @@ xfce_desktop_class_init(XfceDesktopClass *klass)
                                                       XFCE_DESKTOP_ICON_STYLE_FILES,
 #else
                                                       XFCE_DESKTOP_ICON_STYLE_WINDOWS,
-#endif
+#endif /* ENABLE_FILE_ICONS */
                                                       XFDESKTOP_PARAM_FLAGS));
 
     g_object_class_install_property(gobject_class, PROP_ICON_SIZE,
@@ -819,6 +819,8 @@ xfce_desktop_class_init(XfceDesktopClass *klass)
                                                          FALSE,
                                                          XFDESKTOP_PARAM_FLAGS));
 
+#endif /* ENABLE_DESKTOP_ICONS */
+
     g_object_class_install_property(gobject_class, PROP_SINGLE_WORKSPACE_MODE,
                                     g_param_spec_boolean("single-workspace-mode",
                                                          "single-workspace-mode",
@@ -832,7 +834,7 @@ xfce_desktop_class_init(XfceDesktopClass *klass)
                                                      "single-workspace-number",
                                                      0, G_MAXINT16, 0,
                                                      XFDESKTOP_PARAM_FLAGS));
-#endif
+
 #undef XFDESKTOP_PARAM_FLAGS
 }
 
@@ -999,7 +1001,6 @@ xfce_desktop_realize(GtkWidget *widget)
     
     screen_set_selection(desktop);
 
-    /* We have to force wnck to initialize */
     wnck_screen = wnck_screen_get(gdk_screen_get_number(desktop->priv->gscreen));
     desktop->priv->wnck_screen = wnck_screen;
 
@@ -1258,13 +1259,12 @@ xfce_desktop_style_set(GtkWidget *w,
 static void
 xfce_desktop_connect_settings(XfceDesktop *desktop)
 {
+#ifdef ENABLE_DESKTOP_ICONS
+#define ICONS_PREFIX "/desktop-icons/"
     XfconfChannel *channel = desktop->priv->channel;
 
     xfce_desktop_freeze_updates(desktop);
 
-#ifdef ENABLE_DESKTOP_ICONS
-#define ICONS_PREFIX "/desktop-icons/"
-
     xfconf_g_property_bind(channel, ICONS_PREFIX "style",
                            XFCE_TYPE_DESKTOP_ICON_STYLE,
                            G_OBJECT(desktop), "icon-style");
@@ -1275,10 +1275,10 @@ xfce_desktop_connect_settings(XfceDesktop *desktop)
     xfconf_g_property_bind(channel, ICONS_PREFIX "use-custom-font-size",
                            G_TYPE_BOOLEAN,
                            G_OBJECT(desktop), "icon-font-size-set");
-#undef ICONS_PREFIX
-#endif
 
     xfce_desktop_thaw_updates(desktop);
+#undef ICONS_PREFIX
+#endif
 }
 
 static gboolean


More information about the Xfce4-commits mailing list