Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 59E74431FD0 for ; Fri, 3 Jun 2011 16:58:01 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9IpzhPfY-OXo for ; Fri, 3 Jun 2011 16:58:00 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108]) by olra.theworths.org (Postfix) with ESMTP id A8AA8431FB6 for ; Fri, 3 Jun 2011 16:58:00 -0700 (PDT) Received: from pip.fifthhorseman.net (dsl254-070-154.nyc1.dsl.speakeasy.net [216.254.70.154]) by che.mayfirst.org (Postfix) with ESMTPSA id 2456BF975; Fri, 3 Jun 2011 19:57:59 -0400 (EDT) Received: by pip.fifthhorseman.net (Postfix, from userid 1000) id 1B69B11878; Fri, 3 Jun 2011 19:57:59 -0400 (EDT) From: Daniel Kahn Gillmor To: notmuch@notmuchmail.org Subject: [PATCH] Use stock GMimeSession by default Date: Fri, 3 Jun 2011 19:57:46 -0400 Message-Id: <1307145466-10702-2-git-send-email-dkg@fifthhorseman.net> X-Mailer: git-send-email 1.7.4.4 In-Reply-To: <1307145466-10702-1-git-send-email-dkg@fifthhorseman.net> References: <4DE9704D.40601@fifthhorseman.net> <1307145466-10702-1-git-send-email-dkg@fifthhorseman.net> Cc: Daniel Kahn Gillmor X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2011 23:58:01 -0000 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