diff options
author | James Willcox <jwillcox@gnome.org> | 2003-08-01 16:59:47 +0000 |
---|---|---|
committer | James Willcox <jwillcox@src.gnome.org> | 2003-08-01 16:59:47 +0000 |
commit | d922865ac654a441ad09bb1c9ffc55f863adf439 (patch) | |
tree | c7f27f5e6e690510603c2dab7a96e9d120696706 /components | |
parent | b4c07db8f3b7312634dc913fefb2d35280999290 (diff) | |
download | nautilus-d922865ac654a441ad09bb1c9ffc55f863adf439.tar.gz |
Fix a typo. Bug #116843.
2003-08-01 James Willcox <jwillcox@gnome.org>
* libnautilus-private/apps_nautilus_preferences.schemas.in:
Fix a typo. Bug #116843.
* components/emblem/nautilus-emblem-view.c: When adding emblems,
give people a chance to rename invalid keywords instead of just
bombing out. Fixes #104169.
Diffstat (limited to 'components')
-rw-r--r-- | components/emblem/nautilus-emblem-view.c | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/components/emblem/nautilus-emblem-view.c b/components/emblem/nautilus-emblem-view.c index e58414891..6fe77d3e2 100644 --- a/components/emblem/nautilus-emblem-view.c +++ b/components/emblem/nautilus-emblem-view.c @@ -106,6 +106,7 @@ typedef struct _Emblem { GdkPixbuf *pixbuf; char *uri; char *name; + char *keyword; } Emblem; BONOBO_CLASS_BOILERPLATE (NautilusEmblemView, nautilus_emblem_view, @@ -471,6 +472,11 @@ destroy_emblem (Emblem *emblem, gpointer user_data) g_free (emblem->uri); emblem->uri = NULL; } + + if (emblem->keyword != NULL) { + g_free (emblem->keyword); + emblem->keyword = NULL; + } g_free (emblem); } @@ -598,7 +604,7 @@ add_emblems_dialog_response_cb (GtkWidget *dialog, int response, { Emblem *emblem; GSList *emblems; - char *keyword; + GSList *l; switch (response) { case GTK_RESPONSE_CANCEL: @@ -613,18 +619,33 @@ add_emblems_dialog_response_cb (GtkWidget *dialog, int response, emblems = g_object_get_data (G_OBJECT (dialog), "emblems-to-add"); - while (emblems != NULL) { - emblem = (Emblem *)emblems->data; + for (l = emblems; l; l = l->next) { + char *keyword; + + emblem = (Emblem *)l->data; + if (emblem->keyword != NULL) { + /* this one has already been verified */ + continue; + } keyword = nautilus_emblem_create_unique_keyword (emblem->name); + if (!nautilus_emblem_verify_keyword + (GTK_WINDOW (dialog), keyword, emblem->name)) { + g_free (keyword); + return; + } else { + emblem->keyword = keyword; + } + + } + + for (l = emblems; l; l = l->next) { + emblem = (Emblem *)l->data; + nautilus_emblem_install_custom_emblem (emblem->pixbuf, - keyword, + emblem->keyword, emblem->name, GTK_WINDOW (dialog)); - - g_free (keyword); - - emblems = emblems->next; } gtk_widget_destroy (dialog); |