From 0cd03f0e0c61a30972b810aa9c176ef0358d0cd8 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Tue, 24 Nov 1998 03:58:05 +0000 Subject: [PATCH] 1998-11-23 Federico Mena Quintero * gdesktop.c (desktop_icon_info_place): Save the icon position when it is moved. (desktop_destroy): Removed the save_icons_pos() function and do not invoke it from desktop_destroy(). --- gnome/ChangeLog | 7 +++++++ gnome/gdesktop.c | 28 +++++++--------------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 6b738b554..668b52fa9 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,10 @@ +1998-11-23 Federico Mena Quintero + + * gdesktop.c (desktop_icon_info_place): Save the icon position + when it is moved. + (desktop_destroy): Removed the save_icons_pos() function and do + not invoke it from desktop_destroy(). + 1998-11-23 Miguel de Icaza * gwidget.c (x_list_insert): Make it work with the new CList diff --git a/gnome/gdesktop.c b/gnome/gdesktop.c index 520daf6a6..65c5c1717 100644 --- a/gnome/gdesktop.c +++ b/gnome/gdesktop.c @@ -181,6 +181,7 @@ static void desktop_icon_info_place (struct desktop_icon_info *dii, int auto_pos, int xpos, int ypos) { int u, v; + char *filename; if (auto_pos) get_icon_auto_pos (&xpos, &ypos); @@ -203,6 +204,12 @@ desktop_icon_info_place (struct desktop_icon_info *dii, int auto_pos, int xpos, dii->x = xpos; dii->y = ypos; gtk_widget_set_uposition (dii->dicon, xpos, ypos); + + /* Save the information */ + + filename = g_concat_dir_and_file (desktop_directory, dii->filename); + gmeta_set_icon_pos (filename, dii->x, dii->y); + g_free (filename); } /* Unselects all the desktop icons */ @@ -628,25 +635,6 @@ desktop_init (void) load_initial_desktop_icons (); } -/* Saves the icon position metadata for all the icons in the desktop */ -static void -save_icons_pos (void) -{ - int i; - GList *l; - struct desktop_icon_info *dii; - char *filename; - - for (i = 0; i < (layout_cols * layout_rows); i++) - for (l = layout_slots[i].icons; l; l = l->next) { - dii = l->data; - - filename = g_concat_dir_and_file (desktop_directory, dii->filename); - gmeta_set_icon_pos (filename, dii->x, dii->y); - g_free (filename); - } -} - /** * desktop_destroy * @@ -659,8 +647,6 @@ desktop_destroy (void) GList *l; struct desktop_icon_info *dii; - save_icons_pos (); - /* Destroy the desktop icons */ for (i = 0; i < (layout_cols * layout_rows); i++) {