diff --git a/ChangeLog b/ChangeLog index 7258abe88a..fdf52398e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 14 00:26:49 MEST 1998 Sven Neumann + + * app/fileops.c + * app/menus.c + * app/preferences_dialog.c: fixed a few bugs in the new MRU list + Mon Jul 13 03:00:46 PDT 1998 Jay Cox * brush_select.c gimpbrushlist.c: fixed brush ref counting diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index f434efeb4f..474216699b 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -1070,7 +1070,7 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (spinbutton), "changed", (GtkSignalFunc) file_prefs_spinbutton_callback, - &last_opened_size); + &edit_last_opened_size); gtk_widget_show (spinbutton); label = gtk_label_new ("Interface"); diff --git a/app/fileops.c b/app/fileops.c index a6375e3203..59bf8b2255 100644 --- a/app/fileops.c +++ b/app/fileops.c @@ -750,9 +750,10 @@ file_open (char *filename, char* raw_filename) /* display the image */ gdisplay_new (gimage, 0x0101); - } - idea_add( filename ); + idea_add (filename); + menus_last_opened_add (filename); + } return return_val; } @@ -803,12 +804,14 @@ file_save (GimpImage* gimage, /* set the image title */ gimage_set_filename (gimage, filename); + + idea_add( filename ); + menus_last_opened_add (filename); } g_free (return_vals); g_free (args); - idea_add( filename ); return return_val; } @@ -856,7 +859,6 @@ file_open_ok_callback (GtkWidget *w, { file_dialog_hide (client_data); gtk_widget_set_sensitive (GTK_WIDGET (fs), TRUE); - menus_last_opened_add (filename); return; } diff --git a/app/gui/menus.c b/app/gui/menus.c index 0fa8a94190..a24ec51124 100644 --- a/app/gui/menus.c +++ b/app/gui/menus.c @@ -39,7 +39,6 @@ static void menus_init (void); static GSList *last_opened_raw_filenames = NULL; -static gint num_entries = 0; static GtkItemFactoryEntry toolbox_entries[] = { @@ -415,11 +414,13 @@ menus_last_opened_update_labels () GString *entry_filename, *path; GtkWidget *widget; gint i; + guint num_entries; entry_filename = g_string_new (""); path = g_string_new (""); filename_slist = last_opened_raw_filenames; + num_entries = g_slist_length (last_opened_raw_filenames); for (i = 1; i <= num_entries; i++) { @@ -444,10 +445,14 @@ menus_last_opened_add (gchar *filename) { GString *raw_filename; GtkWidget *widget; + guint num_entries; + + num_entries = g_slist_length (last_opened_raw_filenames); if (num_entries == last_opened_size) { - g_slist_free (g_slist_last (last_opened_raw_filenames)); + g_slist_remove_link (last_opened_raw_filenames, + g_slist_last (last_opened_raw_filenames)); } raw_filename = g_string_new (filename); @@ -459,9 +464,6 @@ menus_last_opened_add (gchar *filename) gtk_widget_show (widget); } - if (num_entries < last_opened_size) - num_entries++; - menus_last_opened_update_labels (); } diff --git a/app/gui/preferences-dialog.c b/app/gui/preferences-dialog.c index f434efeb4f..474216699b 100644 --- a/app/gui/preferences-dialog.c +++ b/app/gui/preferences-dialog.c @@ -1070,7 +1070,7 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (spinbutton), "changed", (GtkSignalFunc) file_prefs_spinbutton_callback, - &last_opened_size); + &edit_last_opened_size); gtk_widget_show (spinbutton); label = gtk_label_new ("Interface"); diff --git a/app/menus.c b/app/menus.c index 0fa8a94190..a24ec51124 100644 --- a/app/menus.c +++ b/app/menus.c @@ -39,7 +39,6 @@ static void menus_init (void); static GSList *last_opened_raw_filenames = NULL; -static gint num_entries = 0; static GtkItemFactoryEntry toolbox_entries[] = { @@ -415,11 +414,13 @@ menus_last_opened_update_labels () GString *entry_filename, *path; GtkWidget *widget; gint i; + guint num_entries; entry_filename = g_string_new (""); path = g_string_new (""); filename_slist = last_opened_raw_filenames; + num_entries = g_slist_length (last_opened_raw_filenames); for (i = 1; i <= num_entries; i++) { @@ -444,10 +445,14 @@ menus_last_opened_add (gchar *filename) { GString *raw_filename; GtkWidget *widget; + guint num_entries; + + num_entries = g_slist_length (last_opened_raw_filenames); if (num_entries == last_opened_size) { - g_slist_free (g_slist_last (last_opened_raw_filenames)); + g_slist_remove_link (last_opened_raw_filenames, + g_slist_last (last_opened_raw_filenames)); } raw_filename = g_string_new (filename); @@ -459,9 +464,6 @@ menus_last_opened_add (gchar *filename) gtk_widget_show (widget); } - if (num_entries < last_opened_size) - num_entries++; - menus_last_opened_update_labels (); } diff --git a/app/menus/menus.c b/app/menus/menus.c index 0fa8a94190..a24ec51124 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -39,7 +39,6 @@ static void menus_init (void); static GSList *last_opened_raw_filenames = NULL; -static gint num_entries = 0; static GtkItemFactoryEntry toolbox_entries[] = { @@ -415,11 +414,13 @@ menus_last_opened_update_labels () GString *entry_filename, *path; GtkWidget *widget; gint i; + guint num_entries; entry_filename = g_string_new (""); path = g_string_new (""); filename_slist = last_opened_raw_filenames; + num_entries = g_slist_length (last_opened_raw_filenames); for (i = 1; i <= num_entries; i++) { @@ -444,10 +445,14 @@ menus_last_opened_add (gchar *filename) { GString *raw_filename; GtkWidget *widget; + guint num_entries; + + num_entries = g_slist_length (last_opened_raw_filenames); if (num_entries == last_opened_size) { - g_slist_free (g_slist_last (last_opened_raw_filenames)); + g_slist_remove_link (last_opened_raw_filenames, + g_slist_last (last_opened_raw_filenames)); } raw_filename = g_string_new (filename); @@ -459,9 +464,6 @@ menus_last_opened_add (gchar *filename) gtk_widget_show (widget); } - if (num_entries < last_opened_size) - num_entries++; - menus_last_opened_update_labels (); } diff --git a/app/preferences_dialog.c b/app/preferences_dialog.c index f434efeb4f..474216699b 100644 --- a/app/preferences_dialog.c +++ b/app/preferences_dialog.c @@ -1070,7 +1070,7 @@ file_pref_cmd_callback (GtkWidget *widget, gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (spinbutton), "changed", (GtkSignalFunc) file_prefs_spinbutton_callback, - &last_opened_size); + &edit_last_opened_size); gtk_widget_show (spinbutton); label = gtk_label_new ("Interface"); diff --git a/app/widgets/gimpitemfactory.c b/app/widgets/gimpitemfactory.c index 0fa8a94190..a24ec51124 100644 --- a/app/widgets/gimpitemfactory.c +++ b/app/widgets/gimpitemfactory.c @@ -39,7 +39,6 @@ static void menus_init (void); static GSList *last_opened_raw_filenames = NULL; -static gint num_entries = 0; static GtkItemFactoryEntry toolbox_entries[] = { @@ -415,11 +414,13 @@ menus_last_opened_update_labels () GString *entry_filename, *path; GtkWidget *widget; gint i; + guint num_entries; entry_filename = g_string_new (""); path = g_string_new (""); filename_slist = last_opened_raw_filenames; + num_entries = g_slist_length (last_opened_raw_filenames); for (i = 1; i <= num_entries; i++) { @@ -444,10 +445,14 @@ menus_last_opened_add (gchar *filename) { GString *raw_filename; GtkWidget *widget; + guint num_entries; + + num_entries = g_slist_length (last_opened_raw_filenames); if (num_entries == last_opened_size) { - g_slist_free (g_slist_last (last_opened_raw_filenames)); + g_slist_remove_link (last_opened_raw_filenames, + g_slist_last (last_opened_raw_filenames)); } raw_filename = g_string_new (filename); @@ -459,9 +464,6 @@ menus_last_opened_add (gchar *filename) gtk_widget_show (widget); } - if (num_entries < last_opened_size) - num_entries++; - menus_last_opened_update_labels (); }