aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-04-08 08:06:43 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-04-08 08:06:43 +0800
commit909bdc093cfe9af816b17829ee0ca73da09d02a4 (patch)
treebe02c24a48da8fbd3043cffcede873e415a9bfbb /mail/em-folder-tree.c
parentc5c09ba7baa6f24cce04f29c6541492810bdb6f3 (diff)
downloadgsoc2013-evolution-909bdc093cfe9af816b17829ee0ca73da09d02a4.tar.gz
gsoc2013-evolution-909bdc093cfe9af816b17829ee0ca73da09d02a4.tar.zst
gsoc2013-evolution-909bdc093cfe9af816b17829ee0ca73da09d02a4.zip
Check that emft_selection_get_selected() returns TRUE before we try to use
2004-04-07 Jeffrey Stedfast <fejj@ximian.com> * em-folder-tree.c (emft_tree_button_press): Check that emft_selection_get_selected() returns TRUE before we try to use the iter. Fixes bug #56652. (emft_popup_delete_response): Same idea here. (emft_popup_delete_folder): Same. (emft_popup_rename_folder): Same. (emft_popup_properties): Same. svn path=/trunk/; revision=25366
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r--mail/em-folder-tree.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index 585abaf10a..102c87b65d 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -2339,7 +2339,9 @@ emft_popup_delete_response (GtkWidget *dialog, guint response, EMFolderTree *emf
return;
selection = gtk_tree_view_get_selection (priv->treeview);
- emft_selection_get_selected (selection, &model, &iter);
+ if (!emft_selection_get_selected (selection, &model, &iter))
+ return;
+
gtk_tree_model_get (model, &iter, COL_STRING_FOLDER_PATH, &path,
COL_POINTER_CAMEL_STORE, &store, -1);
@@ -2364,7 +2366,9 @@ emft_popup_delete_folder (GtkWidget *item, EMFolderTree *emft)
char *title, *path;
selection = gtk_tree_view_get_selection (priv->treeview);
- emft_selection_get_selected (selection, &model, &iter);
+ if (!emft_selection_get_selected (selection, &model, &iter))
+ return;
+
gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store, COL_STRING_FOLDER_PATH, &path, -1);
local = mail_component_peek_local_store (NULL);
@@ -2411,7 +2415,9 @@ emft_popup_rename_folder (GtkWidget *item, EMFolderTree *emft)
local = mail_component_peek_local_store (NULL);
selection = gtk_tree_view_get_selection (priv->treeview);
- emft_selection_get_selected (selection, &model, &iter);
+ if (!emft_selection_get_selected (selection, &model, &iter))
+ return;
+
gtk_tree_model_get (model, &iter, COL_STRING_FOLDER_PATH, &folder_path,
COL_STRING_DISPLAY_NAME, &name,
COL_POINTER_CAMEL_STORE, &store,
@@ -2494,7 +2500,9 @@ emft_popup_properties (GtkWidget *item, EMFolderTree *emft)
char *uri;
selection = gtk_tree_view_get_selection (priv->treeview);
- emft_selection_get_selected (selection, &model, &iter);
+ if (!emft_selection_get_selected (selection, &model, &iter))
+ return;
+
gtk_tree_model_get (model, &iter, COL_STRING_URI, &uri, -1);
em_folder_properties_show(NULL, NULL, uri);
@@ -2559,7 +2567,9 @@ emft_tree_button_press (GtkTreeView *treeview, GdkEventButton *event, EMFolderTr
/* FIXME: we really need the folderinfo to build a proper menu */
selection = gtk_tree_view_get_selection (treeview);
- emft_selection_get_selected (selection, &model, &iter);
+ if (!emft_selection_get_selected (selection, &model, &iter))
+ return FALSE;
+
gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store,
COL_STRING_URI, &uri, COL_STRING_FOLDER_PATH, &path,
COL_BOOL_IS_STORE, &isstore, -1);