diff options
author | Not Zed <NotZed@Ximian.com> | 2004-05-24 15:17:10 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-05-24 15:17:10 +0800 |
commit | 308ab4258cb185d0ec546c1e6d29af26352a626f (patch) | |
tree | 3e0e404692d77b272dabeafa890545aae916d4c4 /mail | |
parent | ec1315f02cb08be3349a76a8aefa25943fd7f7ad (diff) | |
download | gsoc2013-evolution-308ab4258cb185d0ec546c1e6d29af26352a626f.tar gsoc2013-evolution-308ab4258cb185d0ec546c1e6d29af26352a626f.tar.gz gsoc2013-evolution-308ab4258cb185d0ec546c1e6d29af26352a626f.tar.bz2 gsoc2013-evolution-308ab4258cb185d0ec546c1e6d29af26352a626f.tar.lz gsoc2013-evolution-308ab4258cb185d0ec546c1e6d29af26352a626f.tar.xz gsoc2013-evolution-308ab4258cb185d0ec546c1e6d29af26352a626f.tar.zst gsoc2013-evolution-308ab4258cb185d0ec546c1e6d29af26352a626f.zip |
use set_cursor instead of scroll_to_row. See #58383.
2004-05-24 Not Zed <NotZed@Ximian.com>
* em-folder-tree.c (em_folder_tree_set_selected): use set_cursor
instead of scroll_to_row. See #58383.
(get_selected_uris_iterate): removed.
(em_folder_tree_get_selected_uris): use an interative call based
on gtk_tree_selection_get_selected_rows rather than
selected_foreach, as the gtk+ docs suggest. was trying to fix a
bug but it seems gtktreeselection bug (shift-select rows using
keyboard only)
svn path=/trunk/; revision=26058
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/em-folder-tree.c | 42 |
2 files changed, 30 insertions, 21 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index d378adb0e5..4760be9866 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -7,6 +7,15 @@ 2004-05-24 Not Zed <NotZed@Ximian.com> + * em-folder-tree.c (em_folder_tree_set_selected): use set_cursor + instead of scroll_to_row. See #58383. + (get_selected_uris_iterate): removed. + (em_folder_tree_get_selected_uris): use an interative call based + on gtk_tree_selection_get_selected_rows rather than + selected_foreach, as the gtk+ docs suggest. was trying to fix a + bug but it seems gtktreeselection bug (shift-select rows using + keyboard only) + * message-list.c (regen_list_regened): pull the message from the regen list before we check the list and pending uid. diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 67e16ae0bf..a424250707 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -1468,32 +1468,32 @@ void em_folder_tree_set_excluded(EMFolderTree *emft, guint32 flags) emft->priv->excluded = flags; } -static void -get_selected_uris_iterate (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data) -{ - GList **list = (GList **) data; - char *uri; - - gtk_tree_model_get (model, iter, /*COL_STRING_FOLDER_PATH, &path,*/ - COL_STRING_URI, &uri, -1); - *list = g_list_append (*list, g_strdup (uri)); -} - GList * em_folder_tree_get_selected_uris (EMFolderTree *emft) { GtkTreeSelection *selection = gtk_tree_view_get_selection (emft->priv->treeview); - GList *lost = emft->priv->lost_folders; - GList *list = NULL; - + GList *list = NULL, *rows, *l; + GtkTreeModel *model; + /* at first, add lost uris */ - while (lost) { - list = g_list_append (list, g_strdup (lost->data)); - lost = g_list_next (lost); + for (l = emft->priv->lost_folders; l; l = g_list_next(l)) + list = g_list_append (l, g_strdup (l->data)); + + rows = gtk_tree_selection_get_selected_rows(selection, &model); + for (l=rows; l; l=g_list_next(l)) { + GtkTreeIter iter; + GtkTreePath *path = l->data; + + if (gtk_tree_model_get_iter(model, &iter, path)) { + char *uri; + + gtk_tree_model_get(model, &iter, COL_STRING_URI, &uri, -1); + list = g_list_append(list, g_strdup(uri)); + } + gtk_tree_path_free(path); } - - gtk_tree_selection_selected_foreach (selection, get_selected_uris_iterate, &list); - + g_list_free(rows); + return list; } @@ -2736,7 +2736,7 @@ em_folder_tree_set_selected (EMFolderTree *emft, const char *uri) gtk_tree_view_expand_to_path (priv->treeview, tree_path); selection = gtk_tree_view_get_selection (priv->treeview); gtk_tree_selection_select_path (selection, tree_path); - gtk_tree_view_scroll_to_cell (priv->treeview, tree_path, NULL, FALSE, 0.0, 0.0); + gtk_tree_view_set_cursor(priv->treeview, tree_path, NULL, FALSE); gtk_tree_path_free (tree_path); camel_object_unref (store); g_free (path); |