Commit 01e2bf19 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

Removes the dependency on libgnome* by removing some ancient code that

2008-10-07  Alexander Larsson  <alexl@redhat.com>

	Removes the dependency on libgnome* by removing some
	ancient code that uses it and pulling in some code from
	libgnome that we need internally and that other apps that
	don't want to require libgnome needs.
	
        * gnome-desktop-thumbnail.c: Added.
        * gnome-thumbnail-pixbuf-utils.c: Added.
        * libgnomeui/gnome-desktop-thumbnail.h: Added.
	Added a copy of gnome-thumbnail from libgnomeui, renamed
	to GnomeDesktopThumbnail.
	
        * gnome-desktop-utils.c: Added.
        * libgnome/gnome-desktop-utils.h: Added.
	Add gnome_desktop_prepend_terminal_to_vector (from libgnome).
	Used internally and by nautilus.
	
        * gnome-ditem-edit.c:
        * gnome-hint.c: 
	* test-hint.c:
	* test-ditem-edit.c:
        * libgnomeui/gnome-ditem-edit.h: Removed.
        * libgnomeui/gnome-hint.h: Removed.
	Remove gnome-ditem-edit and gnome-hint.
	
        * gnome-bg.c:
        * libgnomeui/gnome-bg.h:
	Use GnomeDesktopThumbnail instead of GnomeThumbnail
	
        * gnome-desktop-2.0.pc.in:
	Remove libgnomeui dependency
	
        * gnome-desktop-item.c:
        * libgnome/gnome-desktop-item.h:
	Don't use libgnome* stuff.
	If needed, instead use the new copies from gnome-desktop.
	This drops backwards compat for really old gnome1 and kde2 icons
	in desktop files...
	
        * test-ditem.c:
	Don't use gnome-program.

        * Makefile.am:
        * libgnome/Makefile.am:
        * libgnomeui/Makefile.am:
	Update for removed/added files

2008-10-07  Alexander Larsson  <alexl@redhat.com>

        * configure.in:
	Bump version to 2.25.1
	Remove dependencies on libgnome*
	

svn path=/trunk/; revision=5252
parent b9ee9a38
2008-10-07 Alexander Larsson <alexl@redhat.com>
* configure.in:
Bump version to 2.25.1
Remove dependencies on libgnome*
2008-09-22 Vincent Untz <vuntz@gnome.org>
* configure.in: post-release bump to 2.24.1
......
AC_INIT([gnome-desktop], [2.24.1],
AC_INIT([gnome-desktop], [2.25.1],
[http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-desktop])
AC_CONFIG_SRCDIR([libgnome-desktop])
......@@ -69,21 +69,17 @@ fi
dnl If you add a version number here, you *must* add an AC_SUBST line for
dnl it too, or it will never make it into the spec file!
LIBXML_REQUIRED=2.4.20
GDK_PIXBUF_REQUIRED=2.4.0
GTK_REQUIRED=2.11.3
GLIB_REQUIRED=2.15.4
GCONF_REQUIRED=2.0.0
LIBGNOMEUI_REQUIRED=2.6.0
STARTUP_NOTIFICATION_REQUIRED=0.5
XRANDR_REQUIRED=1.2
AC_SUBST(LIBXML_REQUIRED)
AC_SUBST(GTK_REQUIRED)
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GDK_PIXBUF_REQUIRED)
AC_SUBST(GCONF_REQUIRED)
AC_SUBST(LIBGNOMEUI_REQUIRED)
AC_SUBST(STARTUP_NOTIFICATION_REQUIRED)
AC_SUBST(XRANDR_REQUIRED)
......@@ -119,7 +115,7 @@ AC_SUBST(XLIB_LIBS)
dnl pkg-config dependency checks
PKG_CHECK_MODULES(GNOME_DESKTOP, libxml-2.0 >= $LIBXML_REQUIRED gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED gconf-2.0 >= $GCONF_REQUIRED $STARTUP_NOTIFICATION_PACKAGE)
PKG_CHECK_MODULES(GNOME_DESKTOP, gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED gconf-2.0 >= $GCONF_REQUIRED $STARTUP_NOTIFICATION_PACKAGE)
dnl for gnome-about
AM_PATH_PYTHON
......
2008-10-07 Alexander Larsson <alexl@redhat.com>
Removes the dependency on libgnome* by removing some
ancient code that uses it and pulling in some code from
libgnome that we need internally and that other apps that
don't want to require libgnome needs.
* gnome-desktop-thumbnail.c: Added.
* gnome-thumbnail-pixbuf-utils.c: Added.
* libgnomeui/gnome-desktop-thumbnail.h: Added.
Added a copy of gnome-thumbnail from libgnomeui, renamed
to GnomeDesktopThumbnail.
* gnome-desktop-utils.c: Added.
* libgnome/gnome-desktop-utils.h: Added.
Add gnome_desktop_prepend_terminal_to_vector (from libgnome).
Used internally and by nautilus.
* gnome-ditem-edit.c:
* gnome-hint.c:
* test-hint.c:
* test-ditem-edit.c:
* libgnomeui/gnome-ditem-edit.h: Removed.
* libgnomeui/gnome-hint.h: Removed.
Remove gnome-ditem-edit and gnome-hint.
* gnome-bg.c:
* libgnomeui/gnome-bg.h:
Use GnomeDesktopThumbnail instead of GnomeThumbnail
* gnome-desktop-2.0.pc.in:
Remove libgnomeui dependency
* gnome-desktop-item.c:
* libgnome/gnome-desktop-item.h:
Don't use libgnome* stuff.
If needed, instead use the new copies from gnome-desktop.
This drops backwards compat for really old gnome1 and kde2 icons
in desktop files...
* test-ditem.c:
Don't use gnome-program.
* Makefile.am:
* libgnome/Makefile.am:
* libgnomeui/Makefile.am:
Update for removed/added files
==================== 2.24.0 ====================
2008-09-22 Vincent Untz <vuntz@gnome.org>
......
......@@ -14,12 +14,13 @@ INCLUDES = \
lib_LTLIBRARIES = libgnome-desktop-2.la
noinst_PROGRAMS = test-ditem test-hint test-ditem-edit
noinst_PROGRAMS = test-ditem
libgnome_desktop_2_la_SOURCES = \
gnome-desktop-item.c \
gnome-ditem-edit.c \
gnome-hint.c \
gnome-desktop-utils.c \
gnome-desktop-thumbnail.c \
gnome-thumbnail-pixbuf-utils.c \
gnome-bg.c \
display-name.c \
gnome-rr.c \
......@@ -44,21 +45,6 @@ test_ditem_LDADD = \
$(XLIB_LIBS) \
$(GNOME_DESKTOP_LIBS)
test_hint_SOURCES = \
test-hint.c
test_hint_LDADD = \
libgnome-desktop-2.la \
$(XLIB_LIBS) \
$(GNOME_DESKTOP_LIBS)
test_ditem_edit_SOURCES = test-ditem-edit.c
test_ditem_edit_LDADD = \
libgnome-desktop-2.la \
$(XLIB_LIBS) \
$(GNOME_DESKTOP_LIBS)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gnome-desktop-2.0.pc
......
......@@ -30,6 +30,7 @@ Author: Soren Sandmann <sandmann@redhat.com>
#include <string.h>
#include <math.h>
#include <stdarg.h>
#include <stdlib.h>
#include <gio/gio.h>
......@@ -38,7 +39,6 @@ Author: Soren Sandmann <sandmann@redhat.com>
#include <X11/Xatom.h>
#include <gconf/gconf-client.h>
#include <libgnomeui/libgnomeui.h>
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnomeui/gnome-bg.h>
......@@ -151,7 +151,7 @@ static void pixbuf_blend (GdkPixbuf *src,
double alpha);
/* Thumbnail utilities */
static GdkPixbuf *create_thumbnail_for_filename (GnomeThumbnailFactory *factory,
static GdkPixbuf *create_thumbnail_for_filename (GnomeDesktopThumbnailFactory *factory,
const char *filename);
static gboolean get_thumb_annotations (GdkPixbuf *thumb,
int *orig_width,
......@@ -164,7 +164,7 @@ static gboolean is_different (GnomeBG *bg,
const char *filename);
static time_t get_mtime (const char *filename);
static GdkPixbuf *create_img_thumbnail (GnomeBG *bg,
GnomeThumbnailFactory *factory,
GnomeDesktopThumbnailFactory *factory,
GdkScreen *screen,
int dest_width,
int dest_height);
......@@ -934,7 +934,7 @@ get_original_size (const char *filename,
gboolean
gnome_bg_get_image_size (GnomeBG *bg,
GnomeThumbnailFactory *factory,
GnomeDesktopThumbnailFactory *factory,
int *width,
int *height)
{
......@@ -987,7 +987,7 @@ fit_factor (int from_width, int from_height,
GdkPixbuf *
gnome_bg_create_thumbnail (GnomeBG *bg,
GnomeThumbnailFactory *factory,
GnomeDesktopThumbnailFactory *factory,
GdkScreen *screen,
int dest_width,
int dest_height)
......@@ -1315,7 +1315,7 @@ get_as_slideshow (GnomeBG *bg, const char *filename)
}
static GdkPixbuf *
get_as_thumbnail (GnomeBG *bg, GnomeThumbnailFactory *factory, const char *filename)
get_as_thumbnail (GnomeBG *bg, GnomeDesktopThumbnailFactory *factory, const char *filename)
{
const FileCacheEntry *ent;
if ((ent = file_cache_lookup (bg, THUMBNAIL, filename))) {
......@@ -1458,7 +1458,7 @@ scale_thumbnail (GnomeBGPlacement placement,
static GdkPixbuf *
create_img_thumbnail (GnomeBG *bg,
GnomeThumbnailFactory *factory,
GnomeDesktopThumbnailFactory *factory,
GdkScreen *screen,
int dest_width,
int dest_height)
......@@ -2251,7 +2251,7 @@ read_slideshow_file (const char *filename,
/* Thumbnail utilities */
static GdkPixbuf *
create_thumbnail_for_filename (GnomeThumbnailFactory *factory,
create_thumbnail_for_filename (GnomeDesktopThumbnailFactory *factory,
const char *filename)
{
char *thumb;
......@@ -2266,7 +2266,7 @@ create_thumbnail_for_filename (GnomeThumbnailFactory *factory,
uri = g_filename_to_uri (filename, NULL, NULL);
thumb = gnome_thumbnail_factory_lookup (factory, uri, mtime);
thumb = gnome_desktop_thumbnail_factory_lookup (factory, uri, mtime);
if (thumb) {
result = gdk_pixbuf_new_from_file (thumb, NULL);
......@@ -2287,10 +2287,10 @@ create_thumbnail_for_filename (GnomeThumbnailFactory *factory,
g_object_unref (orig);
gnome_thumbnail_factory_save_thumbnail (factory, result, uri, mtime);
gnome_desktop_thumbnail_factory_save_thumbnail (factory, result, uri, mtime);
}
else {
gnome_thumbnail_factory_create_failed_thumbnail (factory, uri, mtime);
gnome_desktop_thumbnail_factory_create_failed_thumbnail (factory, uri, mtime);
}
}
......
......@@ -5,7 +5,7 @@ includedir=@includedir@
Name: gnome-desktop-2.0
Description: Utility library for loading .desktop files
Requires: gtk+-2.0 libgnomeui-2.0 @STARTUP_NOTIFICATION_PACKAGE@
Requires: gtk+-2.0 @STARTUP_NOTIFICATION_PACKAGE@
Version: @VERSION@
Libs: -L${libdir} -lgnome-desktop-2
Cflags: -I${includedir}/gnome-desktop-2.0
......@@ -39,11 +39,8 @@
#include <time.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <libgnome/gnome-util.h>
#include <libgnome/gnome-exec.h>
#include <libgnome/gnome-url.h>
#include <locale.h>
#include <popt.h>
#include <stdlib.h>
#include <gio/gio.h>
......@@ -57,8 +54,10 @@
#define sure_string(s) ((s)!=NULL?(s):"")
#define GNOME_DESKTOP_USE_UNSTABLE_API
#undef GNOME_DISABLE_DEPRECATED
#include <libgnome/gnome-desktop-item.h>
#include <libgnome/gnome-desktop-utils.h>
struct _GnomeDesktopItem {
int refcount;
......@@ -1788,7 +1787,7 @@ ditem_execute (const GnomeDesktopItem *item,
/* ignore errors */
}
gnome_prepend_terminal_to_vector (&term_argc, &term_argv);
gnome_desktop_prepend_terminal_to_vector (&term_argc, &term_argv);
}
args = make_args (file_list);
......@@ -2068,7 +2067,10 @@ gnome_desktop_item_launch_on_screen_with_env (
return -1;
}
retval = gnome_url_show (url, error);
retval = gtk_show_uri (screen,
url,
GDK_CURRENT_TIME,
error);
return retval ? 0 : -1;
}
......@@ -2449,178 +2451,6 @@ gnome_desktop_item_get_file_status (const GnomeDesktopItem *item)
return retval;
}
static char *kde_icondir = NULL;
static GSList *hicolor_kde_48 = NULL;
static GSList *hicolor_kde_32 = NULL;
static GSList *hicolor_kde_22 = NULL;
static GSList *hicolor_kde_16 = NULL;
/* XXX: maybe we don't care about locolor
static GSList *locolor_kde_48 = NULL;
static GSList *locolor_kde_32 = NULL;
static GSList *locolor_kde_22 = NULL;
static GSList *locolor_kde_16 = NULL;
*/
static GSList *
add_dirs (GSList *list, const char *dirname)
{
DIR *dir;
struct dirent *dent;
dir = opendir (dirname);
if (dir == NULL)
return list;
list = g_slist_prepend (list, g_strdup (dirname));
while ((dent = readdir (dir)) != NULL) {
char *full;
/* skip hidden and self/parent references */
if (dent->d_name[0] == '.')
continue;
full = g_build_filename (dirname, dent->d_name, NULL);
if (g_file_test (full, G_FILE_TEST_IS_DIR)) {
list = g_slist_prepend (list, full);
list = add_dirs (list, full);
} else {
g_free (full);
}
}
closedir (dir);
return list;
}
static void
init_kde_dirs (void)
{
char *dirname;
if (kde_icondir == NULL)
return;
#define ADD_DIRS(color,size) \
dirname = g_build_filename (kde_icondir, #color, \
#size "x" #size , NULL); \
color ## _kde_ ## size = add_dirs (NULL, dirname); \
g_free (dirname);
ADD_DIRS (hicolor, 48);
ADD_DIRS (hicolor, 32);
ADD_DIRS (hicolor, 22);
ADD_DIRS (hicolor, 16);
/* XXX: maybe we don't care about locolor
ADD_DIRS (locolor, 48);
ADD_DIRS (locolor, 32);
ADD_DIRS (locolor, 22);
*/
#undef ADD_DIRS
}
static GSList *
get_kde_dirs (int size)
{
GSList *list = NULL;
if (kde_icondir == NULL)
return NULL;
if (size > 32) {
/* 48-inf */
list = g_slist_concat (g_slist_copy (hicolor_kde_48),
g_slist_copy (hicolor_kde_32));
list = g_slist_concat (list,
g_slist_copy (hicolor_kde_22));
list = g_slist_concat (list,
g_slist_copy (hicolor_kde_16));
} else if (size > 22) {
/* 23-32 */
list = g_slist_concat (g_slist_copy (hicolor_kde_32),
g_slist_copy (hicolor_kde_48));
list = g_slist_concat (list,
g_slist_copy (hicolor_kde_22));
list = g_slist_concat (list,
g_slist_copy (hicolor_kde_16));
} else if (size > 16) {
/* 17-22 */
list = g_slist_concat (g_slist_copy (hicolor_kde_22),
g_slist_copy (hicolor_kde_32));
list = g_slist_concat (list,
g_slist_copy (hicolor_kde_48));
list = g_slist_concat (list,
g_slist_copy (hicolor_kde_16));
} else {
/* 1-16 */
list = g_slist_concat (g_slist_copy (hicolor_kde_16),
g_slist_copy (hicolor_kde_22));
list = g_slist_concat (list,
g_slist_copy (hicolor_kde_32));
list = g_slist_concat (list,
g_slist_copy (hicolor_kde_48));
}
list = g_slist_append (list, kde_icondir);
return list;
}
/* similar function is in panel/main.c */
static void
find_kde_directory (void)
{
int i;
const char *kdedir;
char *try_prefixes[] = {
"/usr",
"/opt/kde",
"/opt/kde2",
"/usr/local",
"/kde",
"/kde2",
NULL
};
if (kde_icondir != NULL)
return;
kdedir = g_getenv ("KDEDIR");
if (kdedir != NULL) {
kde_icondir = g_build_filename (kdedir, "share", "icons", NULL);
init_kde_dirs ();
return;
}
/* if what configure gave us works use that */
if (g_file_test (KDE_ICONDIR, G_FILE_TEST_IS_DIR)) {
kde_icondir = g_strdup (KDE_ICONDIR);
init_kde_dirs ();
return;
}
for (i = 0; try_prefixes[i] != NULL; i++) {
char *try;
try = g_build_filename (try_prefixes[i], "share", "applnk", NULL);
if (g_file_test (try, G_FILE_TEST_IS_DIR)) {
g_free (try);
kde_icondir = g_build_filename (try_prefixes[i], "share", "icons", NULL);
init_kde_dirs ();
return;
}
g_free (try);
}
/* absolute fallback, these don't exist, but we're out of options
here */
kde_icondir = g_strdup (KDE_ICONDIR);
init_kde_dirs ();
}
/**
* gnome_desktop_item_find_icon:
* @icon_theme: a #GtkIconTheme
......@@ -2640,11 +2470,11 @@ gnome_desktop_item_find_icon (GtkIconTheme *icon_theme,
int desired_size,
int flags)
{
GtkIconInfo *info;
char *full = NULL;
g_return_val_if_fail (icon_theme == NULL ||
GTK_IS_ICON_THEME (icon_theme) ||
GNOME_IS_ICON_THEME (icon_theme), NULL);
GTK_IS_ICON_THEME (icon_theme), NULL);
if (icon == NULL || strcmp(icon,"") == 0) {
return NULL;
......@@ -2669,82 +2499,22 @@ gnome_desktop_item_find_icon (GtkIconTheme *icon_theme,
strcmp (p, ".svg") == 0)) {
*p = 0;
}
/* For backwards compat we support GnomeIconTheme too */
if (GNOME_IS_ICON_THEME (icon_theme)) {
full = gnome_icon_theme_lookup_icon (icon_theme,
icon_no_extension,
desired_size,
NULL, NULL);
} else {
GtkIconInfo *info;
info = gtk_icon_theme_lookup_icon (icon_theme,
icon_no_extension,
desired_size,
0);
full = NULL;
if (info) {
full = g_strdup (gtk_icon_info_get_filename (info));
gtk_icon_info_free (info);
}
}
g_free (icon_no_extension);
}
if (full == NULL) { /* Fall back on old Gnome/KDE code */
GSList *kde_dirs = NULL;
GSList *li;
const char *exts[] = { ".png", ".xpm", NULL };
const char *no_exts[] = { "", NULL };
const char **check_exts;
full = gnome_program_locate_file (NULL,
GNOME_FILE_DOMAIN_PIXMAP,
icon,
TRUE /* only_if_exists */,
NULL /* ret_locations */);
if (full == NULL)
full = gnome_program_locate_file (NULL,
GNOME_FILE_DOMAIN_APP_PIXMAP,
icon,
TRUE /* only_if_exists */,
NULL /* ret_locations */);
/* if we found something or no kde, then just return now */
if (full != NULL ||
flags & GNOME_DESKTOP_ITEM_ICON_NO_KDE)
return full;
/* If there is an extention don't add any extensions */
if (strchr (icon, '.') != NULL) {
check_exts = no_exts;
} else {
check_exts = exts;
}
find_kde_directory ();
kde_dirs = get_kde_dirs (desired_size);
for (li = kde_dirs; full == NULL && li != NULL; li = li->next) {
int i;
for (i = 0; full == NULL && check_exts[i] != NULL; i++) {
full = g_strconcat (li->data, G_DIR_SEPARATOR_S, icon,
check_exts[i], NULL);
if ( ! g_file_test (full, G_FILE_TEST_EXISTS)) {
g_free (full);
full = NULL;
}
}
info = gtk_icon_theme_lookup_icon (icon_theme,
icon_no_extension,
desired_size,
0);
full = NULL;
if (info) {
full = g_strdup (gtk_icon_info_get_filename (info));
gtk_icon_info_free (info);
}
g_slist_free (kde_dirs);
g_free (icon_no_extension);
}
return full;
return full;
}
......
This diff is collapsed.
/* -*- Mode: C; c-set-style: linux indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* gnome-desktop-utils.c - Utilities for the GNOME Desktop
Copyright (C) 1998 Tom Tromey
All rights reserved.
This file is part of the Gnome Library.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/*
@NOTATION@
*/
#include <config.h>
#include <glib.h>
#include <gconf/gconf-client.h>
#include <glib/gi18n-lib.h>
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome/gnome-desktop-utils.h>
/**
* gnome_desktop_prepend_terminal_to_vector:
* @argc: a pointer to the vector size
* @argv: a pointer to the vector
*
* Description: Prepends a terminal (either the one configured as default in
* the user's GNOME setup, or one of the common xterm emulators) to the passed
* in vector, modifying it in the process. The vector should be allocated with
* #g_malloc, as this will #g_free the original vector. Also all elements must
* have been allocated separately. That is the standard glib/GNOME way of
* doing vectors however. If the integer that @argc points to is negative, the
* size will first be computed. Also note that passing in pointers to a vector
* that is empty, will just create a new vector for you.
**/
void
gnome_desktop_prepend_terminal_to_vector (int *argc, char ***argv)
{
#ifndef G_OS_WIN32
char **real_argv;
int real_argc;
int i, j;
char **term_argv = NULL;
int term_argc = 0;
GConfClient *client;
gchar *terminal = NULL;
char **the_argv;
g_return_if_fail (argc != NULL);
g_return_if_fail (argv != NULL);
/* sanity */
if(*argv == NULL)
*argc = 0;
the_argv = *argv;
/* compute size if not given */
if (*argc < 0) {
for (i = 0; the_argv[i] != NULL; i++)
;
*argc = i;
}
client = gconf_client_get_default ();
terminal = gconf_client_get_string (client, "/desktop/gnome/applications/terminal/exec", NULL);
g_object_unref (client);
if (terminal) {
gchar *command_line;
gchar *exec_flag;
exec_flag = gconf_client_get_string (client, "/desktop/gnome/applications/terminal/exec_arg", NULL);
if (exec_flag == NULL)
command_line = g_strdup (terminal);
else
command_line = g_strdup_printf ("%s %s", terminal,
exec_flag);
g_shell_parse_argv (command_line,
&term_argc,
&term_argv,
NULL /* error */);
g_free (command_line);
g_free (exec_flag);
g_free (terminal);
}
if (term_argv == NULL) {
char *check;
term_argc = 2;
term_argv = g_new0 (char *, 3);
check = g_find_program_in_path ("gnome-terminal");
if (check != NULL) {
term_argv[0] = check;
/* Note that gnome-terminal takes -x and
* as -e in gnome-terminal is broken we use that. */
term_argv[1] = g_strdup ("-x");
} else {
if (check == NULL)
check = g_find_program_in_path ("nxterm");
if (check == NULL)
check = g_find_program_in_path ("color-xterm");
if (check == NULL)
check = g_find_program_in_path ("rxvt");
if (check == NULL)
check = g_find_program_in_path ("xterm");
if (check == NULL)
check = g_find_program_in_path ("dtterm");
if (check == NULL) {
g_warning (_("Cannot find a terminal, using "
"xterm, even if it may not work"));
check = g_strdup ("xterm");
}
term_argv[0] = check;
term_argv[1] = g_strdup ("-e");
}
}
real_argc = term_argc + *argc;
real_argv = g_new (char *, real_argc + 1);
for (i = 0; i < term_argc; i++)
real_argv[i] = term_argv[i];
for (j = 0; j < *argc; j++, i++)
real_argv[i] = (char *)the_argv[j];
real_argv[i] = NULL;
g_free (*argv);
*argv = real_argv;
*argc = real_argc;