diff options
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/menus/gal-define-views-dialog.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 57ef0738f7..f0491f29c9 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -112,11 +112,15 @@ gdvd_button_new_dialog_callback(GtkWidget *widget, int id, GalDefineViewsDialog "factory", &factory, NULL); if (name && factory) { - view = gal_view_factory_new_view(factory, - name); - gal_define_views_model_append(GAL_DEFINE_VIEWS_MODEL(dialog->model), view); - gal_view_edit(view); - g_object_unref(view); + gchar *dup_of_name = g_strdup(name); + g_strchomp(dup_of_name); + if (*dup_of_name != '\0') { + view = gal_view_factory_new_view(factory, dup_of_name); + gal_define_views_model_append(GAL_DEFINE_VIEWS_MODEL(dialog->model), view); + gal_view_edit(view); + g_object_unref(view); + } + g_free(dup_of_name); } break; } |