From c1fc1e725742277809ae6c625bdf80434879f232 Mon Sep 17 00:00:00 2001 From: Colin Leroy Date: Tue, 4 Jul 2006 16:53:47 +0000 Subject: [PATCH] 2006-07-04 [colin] 2.3.1cvs58 * src/mimeview.c * src/textview.c Use left click to select, middle click to open on mimeparts links * src/common/utils.c Fix segfault --- ChangeLog | 9 +++++++++ PATCHSETS | 1 + configure.ac | 2 +- src/common/utils.c | 2 ++ src/mimeview.c | 6 +++++- src/textview.c | 13 ++++++++----- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index a9d5d549c..19b669510 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-07-04 [colin] 2.3.1cvs58 + + * src/mimeview.c + * src/textview.c + Use left click to select, middle click to open + on mimeparts links + * src/common/utils.c + Fix segfault + 2006-07-04 [colin] 2.3.1cvs57 * src/mainwindow.c diff --git a/PATCHSETS b/PATCHSETS index 14268f2ea..2bf830840 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -1658,3 +1658,4 @@ ( cvs diff -u -r 1.207.2.107 -r 1.207.2.108 src/folderview.c; cvs diff -u -r 1.60.2.34 -r 1.60.2.35 src/prefs_actions.c; cvs diff -u -r 1.59.2.34 -r 1.59.2.35 src/prefs_filtering.c; cvs diff -u -r 1.43.2.39 -r 1.43.2.40 src/prefs_matcher.c; cvs diff -u -r 1.12.2.25 -r 1.12.2.26 src/prefs_template.c; ) > 2.3.1cvs55.patchset ( cvs diff -u -r 1.83.2.73 -r 1.83.2.74 src/mimeview.c; cvs diff -u -r 1.20.2.9 -r 1.20.2.10 src/mimeview.h; cvs diff -u -r 1.96.2.119 -r 1.96.2.120 src/textview.c; ) > 2.3.1cvs56.patchset ( cvs diff -u -r 1.274.2.122 -r 1.274.2.123 src/mainwindow.c; cvs diff -u -r 1.101.2.27 -r 1.101.2.28 src/news.c; ) > 2.3.1cvs57.patchset +( cvs diff -u -r 1.83.2.74 -r 1.83.2.75 src/mimeview.c; cvs diff -u -r 1.96.2.120 -r 1.96.2.121 src/textview.c; cvs diff -u -r 1.36.2.70 -r 1.36.2.71 src/common/utils.c; ) > 2.3.1cvs58.patchset diff --git a/configure.ac b/configure.ac index ca3bb65b4..998f57be2 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=3 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=57 +EXTRA_VERSION=58 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/common/utils.c b/src/common/utils.c index e1ade7b13..33e160f8a 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -4738,6 +4738,8 @@ gchar *mailcap_get_command_for_type(const gchar *type) { gchar *result = NULL; gchar *path = NULL; + if (type == NULL) + return NULL; path = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".mailcap", NULL); result = mailcap_get_command_in_file(path, type); g_free(path); diff --git a/src/mimeview.c b/src/mimeview.c index c9ad62eb5..b3fa79926 100644 --- a/src/mimeview.c +++ b/src/mimeview.c @@ -2213,9 +2213,13 @@ void mimeview_handle_cmd(MimeView *mimeview, const gchar *cmd, gpointer data) mimeview_open_with(mimeview); else if (!strcmp(cmd, "sc://open")) mimeview_launch(mimeview); - else if (!strcmp(cmd, "sc://open_attachment") && data != NULL) { + else if (!strcmp(cmd, "sc://select_attachment") && data != NULL) { icon_list_toggle_by_mime_info(mimeview, (MimeInfo *)data); icon_selected(mimeview, -1, (MimeInfo *)data); + } else if (!strcmp(cmd, "sc://open_attachment") && data != NULL) { + icon_list_toggle_by_mime_info(mimeview, (MimeInfo *)data); + icon_selected(mimeview, -1, (MimeInfo *)data); + mimeview_launch(mimeview); } } diff --git a/src/textview.c b/src/textview.c index 8d5c80289..648f15e4a 100644 --- a/src/textview.c +++ b/src/textview.c @@ -633,7 +633,7 @@ static void textview_add_part(TextView *textview, MimeInfo *mimeinfo) || (mimeinfo->disposition == DISPOSITIONTYPE_INLINE && mimeinfo->type != MIMETYPE_TEXT)) { //gtk_text_buffer_insert(buffer, &iter, buf, -1); - TEXT_INSERT_LINK(buf, "sc://open_attachment", mimeinfo); + TEXT_INSERT_LINK(buf, "sc://select_attachment", mimeinfo); if (mimeinfo->type == MIMETYPE_IMAGE && prefs_common.inline_img ) { GdkPixbuf *pixbuf; @@ -2093,11 +2093,14 @@ static gboolean textview_uri_button_pressed(GtkTextTag *tag, GObject *obj, if ((event->type == GDK_BUTTON_PRESS && bevent->button == 1) || bevent->button == 2 || bevent->button == 3) { if (uri->filename && !g_ascii_strncasecmp(uri->filename, "sc://", 5)) { - if (bevent->button == 1) { - MimeView *mimeview = - (textview->messageview)? - textview->messageview->mimeview:NULL; + MimeView *mimeview = + (textview->messageview)? + textview->messageview->mimeview:NULL; + if (mimeview && bevent->button == 1) { mimeview_handle_cmd(mimeview, uri->filename, uri->data); + } else if (mimeview && bevent->button == 2 && + !g_ascii_strcasecmp(uri->filename, "sc://select_attachment")) { + mimeview_handle_cmd(mimeview, "sc://open_attachment", uri->data); } return TRUE; } else if (!g_ascii_strncasecmp(uri->uri, "mailto:", 7)) { -- 2.25.1