[gnome-applets/gtk3: 12/23] Remove gnome-desktop dependency
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/gtk3: 12/23] Remove gnome-desktop dependency
- Date: Thu, 28 Oct 2010 13:09:27 +0000 (UTC)
commit 6a754c06765fc6ea2ef19d7fe0fe6d90190c701b
Author: Vincent Untz <vuntz gnome org>
Date: Thu Oct 28 14:05:30 2010 +0200
Remove gnome-desktop dependency
We can simply use GDesktopAppInfo to launch a .desktop file.
https://bugzilla.gnome.org/show_bug.cgi?id=623369
configure.in | 10 ++++------
mixer/Makefile.am | 6 ++----
multiload/Makefile.am | 4 ++--
multiload/main.c | 32 +++++++++++++++++++++++---------
4 files changed, 31 insertions(+), 21 deletions(-)
---
diff --git a/configure.in b/configure.in
index f33fb98..977f11d 100644
--- a/configure.in
+++ b/configure.in
@@ -21,7 +21,6 @@ LIBPANEL3_REQUIRED=2.31.2
LIBGTOP_REQUIRED=2.11.92
LIBXKLAVIER_REQUIRED=4.0
LIBWNCK_REQUIRED=2.9.3
-LIBGNOME_DESKTOP_REQUIRED=2.11.1
LIBNOTIFY_REQUIRED=0.3.2
HAL_REQUIRED=0.5.3
DBUS_REQUIRED=1.1.2
@@ -111,6 +110,10 @@ PKG_CHECK_MODULES(GIO, gio-2.0 >= $GIO_REQUIRED)
AC_SUBST(GIO_CFLAGS)
AC_SUBST(GIO_LIBS)
+PKG_CHECK_MODULES(GIO_UNIX, gio-unix-2.0 >= $GIO_REQUIRED)
+AC_SUBST(GIO_UNIX_CFLAGS)
+AC_SUBST(GIO_UNIX_LIBS)
+
dnl -- Check for GTK+ 2.0 (required) ------------------------------------------
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_REQUIRED)
AC_SUBST(GTK_FLAGS)
@@ -126,11 +129,6 @@ PKG_CHECK_MODULES(GNOME_APPLETS3, libpanelapplet-3.0 >= $LIBPANEL3_REQUIRED)
AC_SUBST(GNOME_APPLETS3_CFLAGS)
AC_SUBST(GNOME_APPLETS3_LIBS)
-dnl -- check for gnome-desktop (required) -------------------------------------
-PKG_CHECK_MODULES(GNOMEDESKTOP, gnome-desktop-2.0 >= $LIBGNOME_DESKTOP_REQUIRED)
-AC_SUBST(GNOMEDESKTOP_CFLAGS)
-AC_SUBST(GNOMEDESKTOP_LIBS)
-
dnl -- check for libgtop (optional) -------------------------------------------
build_gtop_applets=false
PKG_CHECK_MODULES(GTOP_APPLETS,
diff --git a/mixer/Makefile.am b/mixer/Makefile.am
index 06ab328..692131a 100644
--- a/mixer/Makefile.am
+++ b/mixer/Makefile.am
@@ -3,8 +3,7 @@ SUBDIRS = docs
INCLUDES = -I. -I$(srcdir) \
-DMIXER_MENU_UI_DIR=\""$(uidir)"\" \
$(MIXER_CFLAGS) \
- $(GNOME_APPLETS3_CFLAGS) \
- $(GNOMEDESKTOP_CFLAGS)
+ $(GNOME_APPLETS3_CFLAGS)
libexec_PROGRAMS = mixer_applet2
@@ -22,8 +21,7 @@ noinst_HEADERS = \
mixer_applet2_LDADD = \
$(MIXER_LIBS) \
- $(GNOME_APPLETS3_LIBS) \
- $(GNOMEDESKTOP_LIBS)
+ $(GNOME_APPLETS3_LIBS)
appletdir = $(datadir)/gnome-panel/applets
applet_in_files = org.gnome.applets.MixerApplet.panel-applet.in
diff --git a/multiload/Makefile.am b/multiload/Makefile.am
index 53b3147..0563b62 100644
--- a/multiload/Makefile.am
+++ b/multiload/Makefile.am
@@ -5,7 +5,7 @@ INCLUDES = \
-DMULTILOAD_MENU_UI_DIR=\""$(uidir)"\" \
$(GNOME_APPLETS3_CFLAGS) \
$(GTOP_APPLETS_CFLAGS) \
- $(GNOMEDESKTOP_CFLAGS)
+ $(GIO_UNIX_CFLAGS)
libexec_PROGRAMS = multiload-applet-2
@@ -24,7 +24,7 @@ multiload_applet_2_SOURCES = \
multiload_applet_2_LDADD = \
$(GNOME_APPLETS3_LIBS) \
$(GTOP_APPLETS_LIBS) \
- $(GNOMEDESKTOP_LIBS)
+ $(GIO_UNIX_LIBS)
schemasdir = @GCONF_SCHEMA_FILE_DIR@
schemas_in_files = multiload.schemas.in
diff --git a/multiload/main.c b/multiload/main.c
index f5cf5f6..eea8ceb 100644
--- a/multiload/main.c
+++ b/multiload/main.c
@@ -19,11 +19,11 @@
#include <time.h>
#include <glibtop.h>
+#include <gio/gdesktopappinfo.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gconf/gconf-client.h>
-#include <libgnome/gnome-desktop-item.h>
#include <panel-applet.h>
#include <panel-applet-gconf.h>
@@ -90,7 +90,7 @@ static void
start_procman (MultiloadApplet *ma)
{
GError *error = NULL;
- GnomeDesktopItem *ditem;
+ GDesktopAppInfo *appinfo;
gchar *monitor;
g_return_if_fail (ma != NULL);
@@ -99,13 +99,27 @@ start_procman (MultiloadApplet *ma)
if (monitor == NULL)
monitor = g_strdup ("gnome-system-monitor.desktop");
- if ((ditem = gnome_desktop_item_new_from_basename (monitor, 0, NULL))) {
- gnome_desktop_item_set_launch_time (ditem, gtk_get_current_event_time ());
- gnome_desktop_item_launch_on_screen (ditem, NULL,
- GNOME_DESKTOP_ITEM_LAUNCH_ONLY_ONE,
- gtk_widget_get_screen (GTK_WIDGET (ma->applet)),
- -1, &error);
- gnome_desktop_item_unref (ditem);
+ appinfo = g_desktop_app_info_new (monitor);
+ if (appinfo) {
+ GdkAppLaunchContext *context;
+
+ context = gdk_app_launch_context_new ();
+ gdk_app_launch_context_set_screen (context,
+ gtk_widget_get_screen (GTK_WIDGET (ma->applet)));
+ gdk_app_launch_context_set_timestamp (context,
+ gtk_get_current_event_time ());
+
+ g_app_info_launch_uris (G_APP_INFO (appinfo), NULL,
+ (GAppLaunchContext *) context,
+ &error);
+
+ g_object_unref (context);
+ g_object_unref (appinfo);
+
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_error_free (error);
+ error = NULL;
+ }
}
else {
gdk_spawn_command_line_on_screen (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]