diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-06-12 07:19:59 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-06-12 07:19:59 +0800 |
commit | c7a07e5ca8b63d0e7c5f9de0509f1e36cfd649bb (patch) | |
tree | 059999020875f945070e6cc22c456b3b7f3dc8f3 /mail | |
parent | 4c4af08d38310c756bf94aa3a9b2a46fdb54680c (diff) | |
download | gsoc2013-evolution-c7a07e5ca8b63d0e7c5f9de0509f1e36cfd649bb.tar.gz gsoc2013-evolution-c7a07e5ca8b63d0e7c5f9de0509f1e36cfd649bb.tar.zst gsoc2013-evolution-c7a07e5ca8b63d0e7c5f9de0509f1e36cfd649bb.zip |
Free any old select_uri string we may have. (emft_tree_row_expanded):
2004-06-11 Jeffrey Stedfast <fejj@ximian.com>
* em-folder-tree.c (em_folder_tree_set_selected): Free any old
select_uri string we may have.
(emft_tree_row_expanded): Remove the gross hack that was here.
(emft_get_folder_info__got): Check for priv->select_uri and try
selecting it (if we can't select it yet, it'll just be re-queued
for later).
(emft_tree_row_activated): Clear the select_uri if set, the user's
selection overrules any auto-selection.
(emft_tree_selection_changed): Same.
svn path=/trunk/; revision=26318
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 12 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 36 |
2 files changed, 31 insertions, 17 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 8a4b463d9f..de32f33fab 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,15 @@ +2004-06-11 Jeffrey Stedfast <fejj@ximian.com> + + * em-folder-tree.c (em_folder_tree_set_selected): Free any old + select_uri string we may have. + (emft_tree_row_expanded): Remove the gross hack that was here. + (emft_get_folder_info__got): Check for priv->select_uri and try + selecting it (if we can't select it yet, it'll just be re-queued + for later). + (emft_tree_row_activated): Clear the select_uri if set, the user's + selection overrules any auto-selection. + (emft_tree_selection_changed): Same. + 2004-06-11 Not Zed <NotZed@Ximian.com> * em-folder-tree.c (emft_tree_button_press): rearrange the setting diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 1988fc2d73..b69b179a2e 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -1663,8 +1663,15 @@ emft_get_folder_info__got (struct _mail_msg *mm) gtk_tree_store_set (model, &root, COL_BOOL_LOAD_SUBDIRS, FALSE, -1); - if (m->select_uri) + if (m->select_uri) { em_folder_tree_set_selected (m->emft, m->select_uri); + } else if (priv->select_uri) { + char *uri = priv->select_uri; + + priv->select_uri = NULL; + em_folder_tree_set_selected (m->emft, uri); + g_free (uri); + } emft_queue_save_state (m->emft); } @@ -1728,10 +1735,8 @@ emft_tree_row_expanded (GtkTreeView *treeview, GtkTreeIter *root, GtkTreePath *t { struct _EMFolderTreePrivate *priv = emft->priv; struct _EMFolderTreeGetFolderInfo *m; - CamelStore *store, *store2; - char *select_uri = NULL; GtkTreeModel *model; - CamelException ex; + CamelStore *store; gboolean load; char *path; @@ -1750,17 +1755,6 @@ emft_tree_row_expanded (GtkTreeView *treeview, GtkTreeIter *root, GtkTreePath *t return; } - camel_exception_init (&ex); - if (priv->select_uri && - (store2 = (CamelStore *) camel_session_get_service (session, priv->select_uri, CAMEL_PROVIDER_STORE, &ex))) { - if (store2 == store) { - select_uri = priv->select_uri; - priv->select_uri = NULL; - } - camel_object_unref (store2); - } - camel_exception_clear (&ex); - m = mail_msg_new (&get_folder_info_op, NULL, sizeof (struct _EMFolderTreeGetFolderInfo)); m->root = gtk_tree_row_reference_new (model, tree_path); camel_object_ref (store); @@ -1769,7 +1763,7 @@ emft_tree_row_expanded (GtkTreeView *treeview, GtkTreeIter *root, GtkTreePath *t g_object_ref(emft); m->top = g_strdup (path); m->flags = CAMEL_STORE_FOLDER_INFO_RECURSIVE; - m->select_uri = select_uri; + m->select_uri = NULL; e_thread_put (mail_thread_new, (EMsg *) m); } @@ -1811,7 +1805,10 @@ emft_tree_row_activated (GtkTreeView *treeview, GtkTreePath *tree_path, GtkTreeV gtk_tree_model_get (model, &iter, COL_STRING_FULL_NAME, &path, COL_STRING_URI, &uri, COL_UINT_FLAGS, &flags, -1); - + + g_free (priv->select_uri); + priv->select_uri = NULL; + g_free (priv->selected_uri); priv->selected_uri = g_strdup (uri); @@ -2699,6 +2696,9 @@ emft_tree_selection_changed (GtkTreeSelection *selection, EMFolderTree *emft) gtk_tree_model_get (model, &iter, COL_STRING_FULL_NAME, &path, COL_STRING_URI, &uri, COL_UINT_FLAGS, &flags, -1); + g_free (priv->select_uri); + priv->select_uri = NULL; + g_free (priv->selected_uri); priv->selected_uri = g_strdup (uri); @@ -2726,6 +2726,8 @@ em_folder_tree_set_selected (EMFolderTree *emft, const char *uri) g_return_if_fail (EM_IS_FOLDER_TREE (emft)); priv = emft->priv; + g_free (priv->select_uri); + priv->select_uri = NULL; camel_exception_init (&ex); if (!(store = (CamelStore *) camel_session_get_service (session, uri, CAMEL_PROVIDER_STORE, &ex))) { |