[PATCH] Use stock GMimeSession by default
[notmuch-archives.git] / 35 / f4da3c1309459843dc38564666033abc76d40a
1 Return-Path: <dkg@fifthhorseman.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 59E74431FD0\r
6         for <notmuch@notmuchmail.org>; Fri,  3 Jun 2011 16:58:01 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 9IpzhPfY-OXo for <notmuch@notmuchmail.org>;\r
16         Fri,  3 Jun 2011 16:58:00 -0700 (PDT)\r
17 Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
18         by olra.theworths.org (Postfix) with ESMTP id A8AA8431FB6\r
19         for <notmuch@notmuchmail.org>; Fri,  3 Jun 2011 16:58:00 -0700 (PDT)\r
20 Received: from pip.fifthhorseman.net (dsl254-070-154.nyc1.dsl.speakeasy.net\r
21         [216.254.70.154])\r
22         by che.mayfirst.org (Postfix) with ESMTPSA id 2456BF975;\r
23         Fri,  3 Jun 2011 19:57:59 -0400 (EDT)\r
24 Received: by pip.fifthhorseman.net (Postfix, from userid 1000)\r
25         id 1B69B11878; Fri,  3 Jun 2011 19:57:59 -0400 (EDT)\r
26 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [PATCH] Use stock GMimeSession by default\r
29 Date: Fri,  3 Jun 2011 19:57:46 -0400\r
30 Message-Id: <1307145466-10702-2-git-send-email-dkg@fifthhorseman.net>\r
31 X-Mailer: git-send-email 1.7.4.4\r
32 In-Reply-To: <1307145466-10702-1-git-send-email-dkg@fifthhorseman.net>\r
33 References: <4DE9704D.40601@fifthhorseman.net>\r
34         <1307145466-10702-1-git-send-email-dkg@fifthhorseman.net>\r
35 Cc: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
36 X-BeenThere: notmuch@notmuchmail.org\r
37 X-Mailman-Version: 2.1.13\r
38 Precedence: list\r
39 List-Id: "Use and development of the notmuch mail system."\r
40         <notmuch.notmuchmail.org>\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
44 List-Post: <mailto:notmuch@notmuchmail.org>\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
48 X-List-Received-Date: Fri, 03 Jun 2011 23:58:01 -0000\r
49 \r
50 Our use of GMimeSession was unneeded boilerplate, and we weren't doing\r
51 anything with it.  This simplifies and clarifies that assumption.\r
52 \r
53 If we want to do anything fancier later, the examples in the gmime\r
54 source are a reasonable source to work from in defining a new\r
55 GMimeSession derivative.\r
56 \r
57 Since GMimeSession is going away in GMime 2.6, though, i don't\r
58 recommend using it.\r
59 ---\r
60  Makefile.local          |    1 -\r
61  notmuch-client.h        |    3 --\r
62  notmuch-gmime-session.c |   49 -----------------------------------------------\r
63  notmuch-reply.c         |    2 +-\r
64  notmuch-show.c          |    2 +-\r
65  5 files changed, 2 insertions(+), 55 deletions(-)\r
66  delete mode 100644 notmuch-gmime-session.c\r
67 \r
68 diff --git a/Makefile.local b/Makefile.local\r
69 index f726f1f..8a8832d 100644\r
70 --- a/Makefile.local\r
71 +++ b/Makefile.local\r
72 @@ -246,7 +246,6 @@ notmuch_client_srcs =               \\r
73         notmuch-show.c          \\r
74         notmuch-tag.c           \\r
75         notmuch-time.c          \\r
76 -       notmuch-gmime-session.c \\r
77         query-string.c          \\r
78         show-message.c          \\r
79         json.c                  \\r
80 diff --git a/notmuch-client.h b/notmuch-client.h\r
81 index 8a27260..63be337 100644\r
82 --- a/notmuch-client.h\r
83 +++ b/notmuch-client.h\r
84 @@ -237,7 +237,4 @@ notmuch_config_set_maildir_synchronize_flags (notmuch_config_t *config,\r
85  notmuch_bool_t\r
86  debugger_is_active (void);\r
87  \r
88 -GType\r
89 -notmuch_gmime_session_get_type (void);\r
90 -\r
91  #endif\r
92 diff --git a/notmuch-gmime-session.c b/notmuch-gmime-session.c\r
93 deleted file mode 100644\r
94 index d83d9b3..0000000\r
95 --- a/notmuch-gmime-session.c\r
96 +++ /dev/null\r
97 @@ -1,49 +0,0 @@\r
98 -#include "notmuch-client.h"\r
99 -\r
100 -/* CRUFTY BOILERPLATE for GMimeSession (dkg thinks this will go away once GMime 2.6 comes out) */\r
101 -typedef struct _NotmuchGmimeSession NotmuchGmimeSession;\r
102 -typedef struct _NotmuchGmimeSessionClass NotmuchGmimeSessionClass;\r
103 -\r
104 -struct _NotmuchGmimeSession {\r
105 -    GMimeSession parent_object;\r
106 -};\r
107 -\r
108 -struct _NotmuchGmimeSessionClass {\r
109 -    GMimeSessionClass parent_class;\r
110 -};\r
111 -\r
112 -static void notmuch_gmime_session_class_init (NotmuchGmimeSessionClass *klass);\r
113 -\r
114 -static GMimeSessionClass *parent_class = NULL;\r
115 -\r
116 -GType\r
117 -notmuch_gmime_session_get_type (void)\r
118 -{\r
119 -    static GType type = 0;\r
120 -\r
121 -    if (!type) {\r
122 -       static const GTypeInfo info = {\r
123 -           sizeof (NotmuchGmimeSessionClass),\r
124 -           NULL, /* base_class_init */\r
125 -           NULL, /* base_class_finalize */\r
126 -           (GClassInitFunc) notmuch_gmime_session_class_init,\r
127 -           NULL, /* class_finalize */\r
128 -           NULL, /* class_data */\r
129 -           sizeof (NotmuchGmimeSession),\r
130 -           0,    /* n_preallocs */\r
131 -           NULL, /* object_init */\r
132 -           NULL, /* value_table */\r
133 -       };\r
134 -       type = g_type_register_static (GMIME_TYPE_SESSION, "NotmuchGmimeSession", &info, 0);\r
135 -    }\r
136 -    return type;\r
137 -}\r
138 -\r
139 -static void\r
140 -notmuch_gmime_session_class_init (NotmuchGmimeSessionClass *klass)\r
141 -{\r
142 -    GMimeSessionClass *session_class = GMIME_SESSION_CLASS (klass);\r
143 -    parent_class = g_type_class_ref (GMIME_TYPE_SESSION);\r
144 -    session_class->request_passwd = NULL;\r
145 -}\r
146 -/* END CRUFTY BOILERPLATE */\r
147 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
148 index 5265af6..514bbc6 100644\r
149 --- a/notmuch-reply.c\r
150 +++ b/notmuch-reply.c\r
151 @@ -607,7 +607,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])\r
152             }\r
153         } else if ((STRNCMP_LITERAL (argv[i], "--decrypt") == 0)) {\r
154             if (params.cryptoctx == NULL) {\r
155 -               GMimeSession* session = g_object_new(notmuch_gmime_session_get_type(), NULL);\r
156 +               GMimeSession* session = g_object_new(g_mime_session_get_type(), NULL);\r
157                 if (NULL == (params.cryptoctx = g_mime_gpg_context_new(session, "gpg")))\r
158                     fprintf (stderr, "Failed to construct gpg context.\n");\r
159                 else\r
160 diff --git a/notmuch-show.c b/notmuch-show.c\r
161 index 9267d02..dda83a1 100644\r
162 --- a/notmuch-show.c\r
163 +++ b/notmuch-show.c\r
164 @@ -899,7 +899,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))\r
165         } else if ((STRNCMP_LITERAL (argv[i], "--verify") == 0) ||\r
166                    (STRNCMP_LITERAL (argv[i], "--decrypt") == 0)) {\r
167             if (params.cryptoctx == NULL) {\r
168 -               GMimeSession* session = g_object_new(notmuch_gmime_session_get_type(), NULL);\r
169 +               GMimeSession* session = g_object_new(g_mime_session_get_type(), NULL);\r
170                 if (NULL == (params.cryptoctx = g_mime_gpg_context_new(session, "gpg")))\r
171                     fprintf (stderr, "Failed to construct gpg context.\n");\r
172                 else\r
173 -- \r
174 1.7.4.4\r
175 \r