diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-05-14 22:00:09 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-05-14 22:00:09 +0800 |
commit | 310189326247ec07951b30c52abc69050be5d2b9 (patch) | |
tree | 13cb469834f605b585ac0d2286c5848670db3be1 /shell | |
parent | 6ed6cd5bf316e07b1f3f698f38b8cde748031f22 (diff) | |
download | gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.gz gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.bz2 gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.lz gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.xz gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.tar.zst gsoc2013-evolution-310189326247ec07951b30c52abc69050be5d2b9.zip |
Protect against unknown folder types better.
svn path=/trunk/; revision=3025
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 7 | ||||
-rw-r--r-- | shell/e-folder-type-repository.c | 15 |
2 files changed, 22 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 4f0924778d..e692ac0cf3 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,12 @@ 2000-05-14 Ettore Perazzoli <ettore@helixcode.com> + * e-folder-type-repository.c + (e_folder_type_repository_get_control_id_for_type): Protect + against non-existing types. + (e_folder_type_repository_get_icon_for_type): Likewise. + +2000-05-14 Ettore Perazzoli <ettore@helixcode.com> + * e-storage-set-view.c (folder_compare_cb): Callback comparison function for comparing folders based on their names. diff --git a/shell/e-folder-type-repository.c b/shell/e-folder-type-repository.c index d53c0d95d7..c96ab5a5b6 100644 --- a/shell/e-folder-type-repository.c +++ b/shell/e-folder-type-repository.c @@ -231,6 +231,11 @@ e_folder_type_repository_get_icon_name_for_type (EFolderTypeRepository *folder_t g_return_val_if_fail (type_name != NULL, NULL); folder_type = get_folder_type (folder_type_repository, type_name); + if (folder_type == NULL) { + g_warning ("%s: Unknown type -- %s", __FUNCTION__, type_name); + return NULL; + } + return folder_type->icon_name; } @@ -245,6 +250,11 @@ e_folder_type_repository_get_icon_for_type (EFolderTypeRepository *folder_type_r g_return_val_if_fail (type_name != NULL, NULL); folder_type = get_folder_type (folder_type_repository, type_name); + if (folder_type == NULL) { + g_warning ("%s: Unknown type -- %s", __FUNCTION__, type_name); + return NULL; + } + return folder_type->icon_pixbuf; } @@ -259,6 +269,11 @@ e_folder_type_repository_get_control_id_for_type (EFolderTypeRepository *folder_ g_return_val_if_fail (type_name != NULL, NULL); folder_type = get_folder_type (folder_type_repository, type_name); + if (folder_type == NULL) { + g_warning ("%s: Unknown type -- %s", __FUNCTION__, type_name); + return NULL; + } + return folder_type->control_id; } |