diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 20c422b42..d8b6f6559 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,5 +1,11 @@ 1999-01-05 Miguel de Icaza + * gdesktop.c (desktop_icon_drop_uri_list): Implement + drops-on-executable. + + * gmetadata.c, gaction.c, gdesktop.c, gicon.c: Use g_free instead + of free to follow the convention in gnome-metadata.c + * gtools.c (query_dialog): Fix the new version of this. It was overwriting memory all over. diff --git a/gnome/gaction.c b/gnome/gaction.c index d8a46ddeb..a892e40d1 100644 --- a/gnome/gaction.c +++ b/gnome/gaction.c @@ -34,13 +34,13 @@ gmc_open_filename (char *fname, GList *args) if (gnome_metadata_get (fname, "fm-open", &size, &buf) == 0){ gmc_execute (fname, buf); - free (buf); + g_free (buf); return 1; } if (gnome_metadata_get (fname, "open", &size, &buf) == 0){ gmc_execute (fname, buf); - free (buf); + g_free (buf); return 1; } @@ -85,13 +85,13 @@ gmc_view (char *filename, int start_line) if (gnome_metadata_get (filename, "fm-view", &size, &buf) == 0){ gmc_run_view (filename, buf); - free (buf); + g_free (buf); return 1; } if (gnome_metadata_get (filename, "view", &size, &buf) == 0){ gmc_run_view (filename, buf); - free (buf); + g_free (buf); return 1; } diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index 189a3022c..81bb559d4 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -1112,7 +1112,7 @@ desktop_icon_drop_uri_list (DesktopIconInfo *dii, GdkDragContext *context, GtkSe */ if (gnome_metadata_get (filename, "drop-action", &size, &buf) == 0){ /*action_drop (filename, buf, context, data);*/ /* Fixme: i'm undefined */ - free (buf); + g_free (buf); goto out; } @@ -1132,10 +1132,39 @@ desktop_icon_drop_uri_list (DesktopIconInfo *dii, GdkDragContext *context, GtkSe } /* - * 4. Executable. Try metadata keys for "open" and mime type for "open" + * 4. Executable. Try metadata keys for "open". */ if (is_exe (fe->buf.st_mode) && if_link_is_exe (fe)){ + GList *names, *l; + int len, i; + char **drops; + + /* Convert the list of filenames into an array of char */ + names = gnome_uri_list_extract_uris (data->data); + len = g_list_length (names); + drops = (char **) g_malloc (sizeof (char *) * (len+1)); + + for (l = names, i = 0; i < len; i++, l = l->next){ + char *text = l->data; + + if (strncmp (text, "file:", 5) == 0) + text += 5; + + drops [i] = text; + } + drops [i] = NULL; + if (gnome_metadata_get (filename, "open", &size, &buf) == 0){ + exec_extension (filename, buf, drops, NULL, 0); + goto out2; + } + exec_extension (filename, "%f %q", drops, NULL, 0); + + g_free (drops); + out2: + gnome_uri_list_free_strings (names); + g_free (buf); + } out: diff --git a/gnome/gicon.c b/gnome/gicon.c index 2fd3d0f92..16b52cc38 100644 --- a/gnome/gicon.c +++ b/gnome/gicon.c @@ -223,7 +223,10 @@ gicon_get_icon_for_file_speed (file_entry *fe, gboolean do_quick) if (fe->f.stalled_link) return icon_view_stalled; + /* BEtter effect; do not use the symlink icon */ +#if 0 return icon_view_symlink; +#endif } /* @@ -236,7 +239,7 @@ gicon_get_icon_for_file_speed (file_entry *fe, gboolean do_quick) if (gnome_metadata_get (fe->fname, "icon-inline-png", &size, &buf) == 0){ image = gdk_imlib_inlined_png_to_image (buf, size); - free (buf); + g_free (buf); if (image) return image; @@ -248,7 +251,7 @@ gicon_get_icon_for_file_speed (file_entry *fe, gboolean do_quick) if (gnome_metadata_get (fe->fname, "icon-filename", &size, &buf) == 0){ image = gicon_get_by_filename (buf); - free (buf); + g_free (buf); if (image) return image; diff --git a/gnome/gtools.c b/gnome/gtools.c index 8ee040778..27681a85c 100644 --- a/gnome/gtools.c +++ b/gnome/gtools.c @@ -81,6 +81,8 @@ int query_dialog (char *header, char *text, int flags, int count, ...) g_slist_foreach (allocated, g_free, NULL); g_slist_free (allocated); + g_free (buttons); + return result; }