diff options
author | Gilbert Fang <gilbert.fang@sun.com> | 2002-12-11 13:51:47 +0800 |
---|---|---|
committer | Mike Kestner <mkestner@src.gnome.org> | 2002-12-11 13:51:47 +0800 |
commit | 8d8578a64dda64c7bc4e05d687026f977e370aa4 (patch) | |
tree | 9a063771940be035ad6154526169935bd6ed959e /widgets | |
parent | d7abc9734655e3671252cd7623a346145d3fc2c3 (diff) | |
download | gsoc2013-evolution-8d8578a64dda64c7bc4e05d687026f977e370aa4.tar.gz gsoc2013-evolution-8d8578a64dda64c7bc4e05d687026f977e370aa4.tar.zst gsoc2013-evolution-8d8578a64dda64c7bc4e05d687026f977e370aa4.zip |
check for null or blank view names
2002-12-10 Gilbert Fang <gilbert.fang@sun.com>
* gal-define-views-dialog.c (gdvd_button_new_dialog_callback):
check for null or blank view names
svn path=/trunk/; revision=19096
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; } |