2000-07-17 Andrew V. Samoilov <sav@bcs.zp.ua>

* gdesktop-init.c (desktop_init_at): fname released after use
	(desktop_load_init_from): don't release icon if it is null
	(gdesktop_links_init): ditto
This commit is contained in:
Andrew V. Samoilov 2000-07-17 10:26:01 +00:00
parent d935f42c9c
commit a454ff5648
2 changed files with 15 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2000-07-17 Andrew V. Samoilov <sav@bcs.zp.ua>
* gdesktop-init.c (desktop_init_at): fname released after use
(desktop_load_init_from): don't release icon if it is null
(gdesktop_links_init): ditto
2000-07-03 Jonathan Blandford <jrb@redhat.com> 2000-07-03 Jonathan Blandford <jrb@redhat.com>
* gdesktop-init.c (gdesktop_links_init): set the initial icon of * gdesktop-init.c (gdesktop_links_init): set the initial icon of

View File

@ -44,18 +44,17 @@ desktop_load_init_from (const char *file)
*/ */
if (strcmp (type, "url") == 0){ if (strcmp (type, "url") == 0){
int used; int used;
char *icon = NULL, *url; char *icon, *url;
char *icon2 = NULL; char *icon2 = NULL;
url = gnome_config_get_string ("url"); url = gnome_config_get_string ("url");
icon = gnome_config_get_string_with_default ("icon=", &used); icon = gnome_config_get_string_with_default ("icon=", &used);
if (!icon) if (icon){
icon2 = g_concat_dir_and_file (ICONDIR, "gnome-http-url.png");
else {
icon2 = gnome_pixmap_file (icon); icon2 = gnome_pixmap_file (icon);
g_free (icon);
}
if (!icon2) if (!icon2)
icon2 = g_concat_dir_and_file (ICONDIR, "gnome-http-url.png"); icon2 = g_concat_dir_and_file (ICONDIR, "gnome-http-url.png");
}
if (url && *url){ if (url && *url){
char *filename = g_concat_dir_and_file (desktop_directory, key); char *filename = g_concat_dir_and_file (desktop_directory, key);
@ -65,7 +64,6 @@ desktop_load_init_from (const char *file)
if (url) if (url)
g_free (url); g_free (url);
g_free (icon);
g_free (icon2); g_free (icon2);
} }
g_free (title); g_free (title);
@ -132,6 +130,7 @@ desktop_init_at (const char *dir)
} }
desktop_load_init_from (fname); desktop_load_init_from (fname);
g_free (fname);
} }
closedir (d); closedir (d);
} }
@ -152,9 +151,10 @@ gdesktop_links_init (void)
link_name = g_concat_dir_and_file (desktop_directory, "Trash"); link_name = g_concat_dir_and_file (desktop_directory, "Trash");
icon = gnome_pixmap_file ("mc/gnome-trashcan.png"); icon = gnome_pixmap_file ("mc/gnome-trashcan.png");
mc_mkdir (link_name, S_IRUSR | S_IWUSR | S_IXUSR ); mc_mkdir (link_name, S_IRUSR | S_IWUSR | S_IXUSR );
if (icon) if (icon){
gnome_metadata_set (link_name, "icon-filename", strlen (icon) + 1, icon); gnome_metadata_set (link_name, "icon-filename", strlen (icon) + 1, icon);
g_free (icon); g_free (icon);
}
g_free (link_name); g_free (link_name);
/* Create custom links */ /* Create custom links */