[Xfce4-commits] <xfce4-indicator-plugin:master> Check if indicator-ng.h exists
Andrzej
noreply at xfce.org
Sun Oct 27 02:26:01 CET 2013
Updating branch refs/heads/master
to c551c14a5c415d7bcb67975a3ca013a9318a71e7 (commit)
from 4689cb32aaa835d9b80ebf573a91f0da2f19cc84 (commit)
commit c551c14a5c415d7bcb67975a3ca013a9318a71e7
Author: Andrzej <ndrwrdck at gmail.com>
Date: Sun Oct 27 01:25:31 2013 +0000
Check if indicator-ng.h exists
It is a workaround for incorrect/lack of versioning in libindicator.
To be removed when libindicator with indicator-ng API is released.
configure.ac.in | 16 +++++++++++++---
panel-plugin/indicator.c | 12 +++++++++---
2 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index e9ddc74..1be4cc1 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -86,6 +86,15 @@ XDT_CHECK_PACKAGE([XFCONF], [libxfconf-0], [4.6.0])
INDICATOR_PKGNAME=indicator3-0.4
XDT_CHECK_PACKAGE([INDICATOR], [${INDICATOR_PKGNAME}], [12.10.1])
+dnl ********************************************************************
+dnl *** Check if libindicator has indicator-ng.h headery ***
+dnl *** At the moment this cannot be derived from the version number ***
+dnl ********************************************************************
+AC_LANG_PUSH([C])
+CPPFLAGS=`$PKG_CONFIG --cflags ${INDICATOR_PKGNAME}`
+AC_CHECK_HEADERS([libindicator/indicator-ng.h], [HAVE_INDICATOR_NG_H=yes], [HAVE_INDICATOR_NG_H=no])
+AC_LANG_POP
+
dnl ****************************
dnl *** Optional IDO library ***
dnl ****************************
@@ -134,10 +143,11 @@ dnl ***************************
echo
echo "Build Configuration:"
echo
-echo "* Debug Support: $enable_debug"
+echo "* Debug Support: $enable_debug"
+echo "* Use IndicatorNg API: $HAVE_INDICATOR_NG_H"
if test x"$IDO_FOUND" = x"yes"; then
-echo "* Use IDO library: yes"
+echo "* Use IDO library: yes"
else
-echo "* Use IDO library: no"
+echo "* Use IDO library: no"
fi
echo
diff --git a/panel-plugin/indicator.c b/panel-plugin/indicator.c
index e812b48..f4b60cb 100644
--- a/panel-plugin/indicator.c
+++ b/panel-plugin/indicator.c
@@ -38,7 +38,9 @@
#include <libxfce4util/libxfce4util.h>
#include <libxfce4panel/xfce-panel-plugin.h>
#include <libindicator/indicator-object.h>
+#ifdef HAVE_LIBINDICATOR_INDICATOR_NG_H
#include <libindicator/indicator-ng.h>
+#endif
#include "indicator.h"
#include "indicator-box.h"
@@ -63,9 +65,11 @@ static gboolean indicator_load_indicator (IndicatorPlu
const gchar *name);
static gboolean indicator_load_module (IndicatorPlugin *indicator,
const gchar *name);
+#ifdef HAVE_LIBINDICATOR_INDICATOR_NG_H
static gboolean indicator_load_service (IndicatorPlugin *indicator,
const gchar *name);
static void indicator_load_services (IndicatorPlugin *indicator);
+#endif
static void indicator_load_modules (IndicatorPlugin *indicator);
@@ -300,7 +304,9 @@ indicator_construct (XfcePanelPlugin *plugin)
/* load 'em */
indicator_load_modules (indicator);
+#ifdef HAVE_LIBINDICATOR_INDICATOR_NG_H
indicator_load_services (indicator);
+#endif
if (indicator->indicator_count == 0) {
/* A label to allow for click through */
@@ -375,7 +381,7 @@ indicator_load_indicator (IndicatorPlugin *indicator,
g_return_val_if_fail (XFCE_IS_INDICATOR_PLUGIN (indicator), 0);
g_return_val_if_fail(name != NULL, FALSE);
- g_debug ("Load indicator_ng: %s", name);
+ g_debug ("Load indicator: %s", name);
indicator_config_add_known_indicator (indicator->config, name);
@@ -427,7 +433,7 @@ indicator_load_module (IndicatorPlugin *indicator,
return indicator_load_indicator (indicator, io, name);
}
-
+#ifdef HAVE_LIBINDICATOR_INDICATOR_NG_H
static gboolean
indicator_load_service (IndicatorPlugin *indicator,
const gchar *name)
@@ -499,7 +505,7 @@ indicator_load_services (IndicatorPlugin *indicator)
g_dir_close (indicators_ng_dir);
}
-
+#endif
More information about the Xfce4-commits
mailing list