openbsd-ports/x11/gnome/libs/patches/patch-libgnome_gnome-dentry_c

94 lines
3.4 KiB
Plaintext

$OpenBSD: patch-libgnome_gnome-dentry_c,v 1.2 2003/01/02 03:32:25 marcm Exp $
--- libgnome/gnome-dentry.c.orig Tue Aug 6 15:57:14 2002
+++ libgnome/gnome-dentry.c Sat Nov 30 12:43:44 2002
@@ -88,7 +88,7 @@ add_comment_or_name(GList *list, char *l
/*read the names and comments from the desktop file*/
static GList *
-read_names_and_comments(const char *file, int is_kde)
+read_names_and_comments(const char *file, int is_old_kde)
{
GList *i18n_list = NULL;
@@ -97,11 +97,11 @@ read_names_and_comments(const char *file
char *prefix;
gnome_config_push_prefix ("");
- if(!is_kde) {
- prefix = g_strconcat ("=", file, "=/Desktop Entry", NULL);
- } else {
- prefix = g_strconcat ("=", file, "=/KDE Desktop Entry", NULL);
- }
+ if(!is_old_kde) {
+ prefix = g_strconcat ("=", file, "=/Desktop Entry", NULL);
+ } else {
+ prefix = g_strconcat ("=", file, "=/KDE Desktop Entry", NULL);
+ }
iterator = gnome_config_init_iterator(prefix);
g_free(prefix);
gnome_config_pop_prefix ();
@@ -155,7 +155,7 @@ gnome_desktop_entry_load_flags_condition
int exec_length;
char *icon_base;
char *p = NULL;
- gboolean is_kde = FALSE;
+ gboolean is_old_kde = FALSE;
gboolean is_dot_directory = FALSE;
#ifdef __GLIBC__
gboolean is_utf8;
@@ -178,8 +178,8 @@ gnome_desktop_entry_load_flags_condition
gnome_config_push_prefix (prefix);
g_free (prefix);
- is_kde = TRUE;
-
+ is_old_kde = TRUE;
+
name = gnome_config_get_translated_string ("Name");
if (!name) {
gnome_config_pop_prefix ();
@@ -197,7 +197,8 @@ gnome_desktop_entry_load_flags_condition
strcmp (file + strlen (file) - strlen (".directory"), ".directory") == 0)
is_dot_directory = TRUE;
- type = gnome_config_get_string (is_dot_directory ? "Type=Directory" : "Type");
+ if( !(type = gnome_config_get_string ("Type") ) )
+ type = gnome_config_get_string ("Type=Directory");
gnome_config_get_vector ("Exec", &exec_length, &exec_vector);
try_file = gnome_config_get_string ("TryExec");
@@ -249,15 +250,21 @@ gnome_desktop_entry_load_flags_condition
newitem->geometry = gnome_config_get_string ("Geometry");
newitem->multiple_args = gnome_config_get_bool ("MultipleArgs=0");
newitem->location = g_strdup (file);
- newitem->is_kde = is_kde;
icon_base = gnome_config_get_string ("Icon");
if (icon_base && *icon_base) {
/* Sigh, now we need to make them local to the gnome install */
if (*icon_base != '/') {
- if (newitem->is_kde) {
- gchar *iconname = g_concat_dir_and_file (KDE_ICONDIR, icon_base);
+ /*
+ HACK: determine if file is an KDE desktop entry.
+ KDE desktop files don't have the file-extension embedded in icon_base.
+ */
+ if( !strstr( icon_base, "." ) ) {
+ gchar *icon_base_full = g_strconcat (icon_base, ".png", NULL);
+ gchar *iconname = g_concat_dir_and_file (KDE_ICONDIR, icon_base_full);
+ newitem->is_kde = TRUE;
+ g_free (icon_base_full);
if (g_file_exists (iconname))
newitem->icon = iconname;
else {
@@ -293,7 +300,7 @@ gnome_desktop_entry_load_flags_condition
gnome_config_pop_prefix ();
/*get us the Names and comments of different languages*/
- i18n_list = read_names_and_comments (file, is_kde);
+ i18n_list = read_names_and_comments (file, is_old_kde);
gnome_desktop_entry_set_i18n_list (newitem, i18n_list);
if (clean_from_memory_after_load) {