diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ChangeLog.ja | 8 | ||||
-rw-r--r-- | src/folderview.c | 37 | ||||
-rw-r--r-- | src/imap.c | 2 |
4 files changed, 35 insertions, 19 deletions
@@ -1,5 +1,12 @@ 2005-04-13 + * src/imap.c: imap_close(): don't do anything if item->path is NULL. + * src/folderview.c: removed unused GtkStyle. + folderview_select_row(): don't expand the row itself. + folderview_selection_changed(): fixed a memory leak. + +2005-04-13 + * src/rfc2015.c: pgp_sign(): fixed missing brackets. Check if result->signatures is not NULL (fix crashes when ~/.gnupg doesn't exist). diff --git a/ChangeLog.ja b/ChangeLog.ja index 9f06b2a7..b2823f91 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,13 @@ 2005-04-13 + * src/imap.c: imap_close(): item->path が NULL の場合は何もしない + ようにした。 + * src/folderview.c: 未使用の GtkStyle を削除。 + folderview_select_row(): その行自身は展開しないようにした。 + folderview_selection_changed(): メモリリークを修正。 + +2005-04-13 + * src/rfc2015.c: pgp_sign(): 括弧が抜けていたのを修正。 result->signatures が NULL でないかどうかをチェック(~/.gnupg が 存在しない場合にクラッシュするのを修正)。 diff --git a/src/folderview.c b/src/folderview.c index 8d3da98e..fd08b0f6 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -92,9 +92,6 @@ enum static GList *folderview_list = NULL; -static GtkStyle *bold_style; -static GtkStyle *bold_color_style; - static GdkPixbuf *inbox_pixbuf; static GdkPixbuf *outbox_pixbuf; static GdkPixbuf *folder_pixbuf; @@ -477,14 +474,6 @@ void folderview_init(FolderView *folderview) stock_pixbuf_gdk(treeview, STOCK_PIXMAP_DIR_NOSELECT, &foldernoselect_pixbuf); stock_pixbuf_gdk(treeview, STOCK_PIXMAP_TRASH, &trash_pixbuf); - - if (!bold_style) { - bold_style = gtk_style_copy(gtk_widget_get_style(treeview)); - pango_font_description_set_weight - (bold_style->font_desc, PANGO_WEIGHT_BOLD); - bold_color_style = gtk_style_copy(bold_style); - bold_color_style->fg[GTK_STATE_NORMAL] = folderview->color_new; - } } FolderView *folderview_get(void) @@ -538,16 +527,22 @@ void folderview_select(FolderView *folderview, FolderItem *item) static void folderview_select_row(FolderView *folderview, GtkTreeIter *iter) { - GtkTreePath *path; + GtkTreeModel *model = GTK_TREE_MODEL(folderview->store); + GtkTreePath *path, *parent_path; + GtkTreeIter parent; g_return_if_fail(iter != NULL); - path = gtk_tree_model_get_path - (GTK_TREE_MODEL(folderview->store), iter); + path = gtk_tree_model_get_path(model, iter); - folderview->open_folder = TRUE; + if (gtk_tree_model_iter_parent(model, &parent, iter)) { + parent_path = gtk_tree_model_get_path(model, &parent); + gtk_tree_view_expand_to_path + (GTK_TREE_VIEW(folderview->treeview), parent_path); + gtk_tree_path_free(parent_path); + } - gtk_tree_view_expand_to_path(GTK_TREE_VIEW(folderview->treeview), path); + folderview->open_folder = TRUE; gtk_tree_view_set_cursor(GTK_TREE_VIEW(folderview->treeview), path, NULL, FALSE); if (folderview->summaryview->folder_item && @@ -1596,13 +1591,18 @@ static void folderview_selection_changed(GtkTreeSelection *selection, folderview->open_folder = FALSE; gtk_tree_model_get(model, &iter, COL_FOLDER_ITEM, &item, -1); - if (!item) return; + if (!item) { + gtk_tree_path_free(path); + return; + } if (item->path) debug_print(_("Folder %s is selected\n"), item->path); - if (summary_is_locked(folderview->summaryview)) + if (summary_is_locked(folderview->summaryview)) { + gtk_tree_path_free(path); return; + } if (folderview->opened) { GtkTreePath *open_path = NULL; @@ -1611,7 +1611,6 @@ static void folderview_selection_changed(GtkTreeSelection *selection, if (gtk_tree_path_compare(open_path, path) == 0) { gtk_tree_path_free(open_path); gtk_tree_path_free(path); - folderview->open_folder = FALSE; return; } gtk_tree_path_free(open_path); @@ -1453,6 +1453,8 @@ static gint imap_close(Folder *folder, FolderItem *item) g_return_val_if_fail(folder != NULL, -1); + if (!item->path) return 0; + session = imap_session_get(folder); if (!session) return -1; |