unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: notmuch@notmuchmail.org
Cc: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Subject: [PATCH] Use stock GMimeSession by default
Date: Fri,  3 Jun 2011 19:57:46 -0400	[thread overview]
Message-ID: <1307145466-10702-2-git-send-email-dkg@fifthhorseman.net> (raw)
In-Reply-To: <1307145466-10702-1-git-send-email-dkg@fifthhorseman.net>

Our use of GMimeSession was unneeded boilerplate, and we weren't doing
anything with it.  This simplifies and clarifies that assumption.

If we want to do anything fancier later, the examples in the gmime
source are a reasonable source to work from in defining a new
GMimeSession derivative.

Since GMimeSession is going away in GMime 2.6, though, i don't
recommend using it.
---
 Makefile.local          |    1 -
 notmuch-client.h        |    3 --
 notmuch-gmime-session.c |   49 -----------------------------------------------
 notmuch-reply.c         |    2 +-
 notmuch-show.c          |    2 +-
 5 files changed, 2 insertions(+), 55 deletions(-)
 delete mode 100644 notmuch-gmime-session.c

diff --git a/Makefile.local b/Makefile.local
index f726f1f..8a8832d 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -246,7 +246,6 @@ notmuch_client_srcs =		\
 	notmuch-show.c		\
 	notmuch-tag.c		\
 	notmuch-time.c		\
-	notmuch-gmime-session.c \
 	query-string.c		\
 	show-message.c		\
 	json.c			\
diff --git a/notmuch-client.h b/notmuch-client.h
index 8a27260..63be337 100644
--- a/notmuch-client.h
+++ b/notmuch-client.h
@@ -237,7 +237,4 @@ notmuch_config_set_maildir_synchronize_flags (notmuch_config_t *config,
 notmuch_bool_t
 debugger_is_active (void);
 
-GType
-notmuch_gmime_session_get_type (void);
-
 #endif
diff --git a/notmuch-gmime-session.c b/notmuch-gmime-session.c
deleted file mode 100644
index d83d9b3..0000000
--- a/notmuch-gmime-session.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "notmuch-client.h"
-
-/* CRUFTY BOILERPLATE for GMimeSession (dkg thinks this will go away once GMime 2.6 comes out) */
-typedef struct _NotmuchGmimeSession NotmuchGmimeSession;
-typedef struct _NotmuchGmimeSessionClass NotmuchGmimeSessionClass;
-
-struct _NotmuchGmimeSession {
-    GMimeSession parent_object;
-};
-
-struct _NotmuchGmimeSessionClass {
-    GMimeSessionClass parent_class;
-};
-
-static void notmuch_gmime_session_class_init (NotmuchGmimeSessionClass *klass);
-
-static GMimeSessionClass *parent_class = NULL;
-
-GType
-notmuch_gmime_session_get_type (void)
-{
-    static GType type = 0;
-
-    if (!type) {
-	static const GTypeInfo info = {
-	    sizeof (NotmuchGmimeSessionClass),
-	    NULL, /* base_class_init */
-	    NULL, /* base_class_finalize */
-	    (GClassInitFunc) notmuch_gmime_session_class_init,
-	    NULL, /* class_finalize */
-	    NULL, /* class_data */
-	    sizeof (NotmuchGmimeSession),
-	    0,    /* n_preallocs */
-	    NULL, /* object_init */
-	    NULL, /* value_table */
-	};
-	type = g_type_register_static (GMIME_TYPE_SESSION, "NotmuchGmimeSession", &info, 0);
-    }
-    return type;
-}
-
-static void
-notmuch_gmime_session_class_init (NotmuchGmimeSessionClass *klass)
-{
-    GMimeSessionClass *session_class = GMIME_SESSION_CLASS (klass);
-    parent_class = g_type_class_ref (GMIME_TYPE_SESSION);
-    session_class->request_passwd = NULL;
-}
-/* END CRUFTY BOILERPLATE */
diff --git a/notmuch-reply.c b/notmuch-reply.c
index 5265af6..514bbc6 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -607,7 +607,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])
 	    }
 	} else if ((STRNCMP_LITERAL (argv[i], "--decrypt") == 0)) {
 	    if (params.cryptoctx == NULL) {
-		GMimeSession* session = g_object_new(notmuch_gmime_session_get_type(), NULL);
+		GMimeSession* session = g_object_new(g_mime_session_get_type(), NULL);
 		if (NULL == (params.cryptoctx = g_mime_gpg_context_new(session, "gpg")))
 		    fprintf (stderr, "Failed to construct gpg context.\n");
 		else
diff --git a/notmuch-show.c b/notmuch-show.c
index 9267d02..dda83a1 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -899,7 +899,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
 	} else if ((STRNCMP_LITERAL (argv[i], "--verify") == 0) ||
 		   (STRNCMP_LITERAL (argv[i], "--decrypt") == 0)) {
 	    if (params.cryptoctx == NULL) {
-		GMimeSession* session = g_object_new(notmuch_gmime_session_get_type(), NULL);
+		GMimeSession* session = g_object_new(g_mime_session_get_type(), NULL);
 		if (NULL == (params.cryptoctx = g_mime_gpg_context_new(session, "gpg")))
 		    fprintf (stderr, "Failed to construct gpg context.\n");
 		else
-- 
1.7.4.4

  reply	other threads:[~2011-06-03 23:58 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-26  1:01 New crypto patch series Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 01/11] Simplify reply_part function to eliminate redundant code paths Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 02/11] Integrate reply_part_content function into reply_part function Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 03/11] Use empty strings instead of NULL in format_reply structure Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 04/11] Break up format->part function into part_start and part_content functions Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 05/11] test: new test-lib function to test for equality between files Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 06/11] test: add notmuch_show_sanitize_all function that is a little more aggressive Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 07/11] test: add crypto tests for signature verification and decryption Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 08/11] Add signature verification of PGP/MIME-signed parts with --verify Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 09/11] Add decryption of PGP/MIME-encrypted parts with --decrypt Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 10/11] emacs: Add support for PGP/MIME verification/decryption Jameson Graef Rollins
2011-05-26  1:01 ` [PATCH 11/11] tag signed/encrypted during notmuch new Jameson Graef Rollins
2011-05-27 10:27 ` normalizing part numbering across PGP/MIME processing Jameson Graef Rollins
2011-05-27 10:27   ` [PATCH 1/4] Do not replace multipart/signed part with content part when doing verification Jameson Graef Rollins
2011-05-27 10:27     ` [PATCH 2/4] Render all parts of multipart/encrypted when decrypting Jameson Graef Rollins
2011-05-27 10:27       ` [PATCH 3/4] emacs: Do not attempt to render arbitrary application parts Jameson Graef Rollins
2011-05-27 10:27         ` [PATCH 4/4] emacs: Give mutlipart/{signed, encrypted} their own part handler Jameson Graef Rollins
2011-05-27 18:52           ` [PATCH] " Jameson Graef Rollins
2011-05-27 18:34   ` normalizing part numbering across PGP/MIME processing Daniel Kahn Gillmor
2011-05-28  0:53   ` Carl Worth
2011-05-28 21:31     ` Jameson Graef Rollins
2011-06-03 21:34       ` Carl Worth
2011-06-03 23:03     ` [PATCH] Always return the empty string if decryption tries to demand a password Daniel Kahn Gillmor
2011-06-03 23:15       ` Carl Worth
2011-06-03 23:37         ` Daniel Kahn Gillmor
2011-06-03 23:57           ` [PATCH] Use stock GMimeSession by default Daniel Kahn Gillmor
2011-06-03 23:57             ` Daniel Kahn Gillmor [this message]
2011-06-04  1:11               ` Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1307145466-10702-2-git-send-email-dkg@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).