2006-07-04 [colin] 2.3.1cvs58
authorColin Leroy <colin@colino.net>
Tue, 4 Jul 2006 16:53:47 +0000 (16:53 +0000)
committerColin Leroy <colin@colino.net>
Tue, 4 Jul 2006 16:53:47 +0000 (16:53 +0000)
* 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
PATCHSETS
configure.ac
src/common/utils.c
src/mimeview.c
src/textview.c

index a9d5d549cbbc5a4a4c39ff8959a0d38ff349acbd..19b6695103282ce82781f7b1de9aad1f7d3f4e69 100644 (file)
--- 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
 2006-07-04 [colin]     2.3.1cvs57
 
        * src/mainwindow.c
index 14268f2eae2c84305bd46d82eb9d239f4fca6fc9..2bf830840c19e4b32adbac36797dd19747cfff91 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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.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
index ca3bb65b48841e0c8ef022ca8afce4d1ffc6466c..998f57be2b1d1035fd135dd2d860fd32f18be226 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=57
+EXTRA_VERSION=58
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index e1ade7b1344c47029795e86a835ef6f46cadf093..33e160f8acc774f79866848e892a034fa1fda58f 100644 (file)
@@ -4738,6 +4738,8 @@ gchar *mailcap_get_command_for_type(const gchar *type)
 {
        gchar *result = NULL;
        gchar *path = NULL;
 {
        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);
        path = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S, ".mailcap", NULL);
        result = mailcap_get_command_in_file(path, type);
        g_free(path);
index c9ad62eb5980dc4280dd0eaf94bed6593a550a9b..b3fa79926720ec573212fcd82e3ff9416a2e3a7a 100644 (file)
@@ -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);
                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);
                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);
        }
 }
 
        }
 }
 
index 8d5c8028941c6ddbc805151e00533dd6127e9e05..648f15e4a1cff6d46885a87ee37a4a3c3c2b0f6a 100644 (file)
@@ -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);
        || (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;
                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 ((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);
                                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)) {
                        }
                        return TRUE;
                } else if (!g_ascii_strncasecmp(uri->uri, "mailto:", 7)) {