]> git.notmuchmail.org Git - notmuch/commitdiff
Use stock GMimeSession by default
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Fri, 3 Jun 2011 23:57:46 +0000 (19:57 -0400)
committerCarl Worth <cworth@cworth.org>
Sat, 4 Jun 2011 00:42:54 +0000 (17:42 -0700)
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
notmuch-client.h
notmuch-gmime-session.c [deleted file]
notmuch-reply.c
notmuch-show.c

index f726f1f26e15262df0e8aba55fcdc8bf899e3da3..8a8832da992722c61d8a58cb7a4d738fae2f401d 100644 (file)
@@ -246,7 +246,6 @@ notmuch_client_srcs =               \
        notmuch-show.c          \
        notmuch-tag.c           \
        notmuch-time.c          \
        notmuch-show.c          \
        notmuch-tag.c           \
        notmuch-time.c          \
-       notmuch-gmime-session.c \
        query-string.c          \
        show-message.c          \
        json.c                  \
        query-string.c          \
        show-message.c          \
        json.c                  \
index 8a2726033f6286b6f8de893c8ed63ab2c657ab63..63be33741a212ac2ed03434418373c1481faff76 100644 (file)
@@ -237,7 +237,4 @@ notmuch_config_set_maildir_synchronize_flags (notmuch_config_t *config,
 notmuch_bool_t
 debugger_is_active (void);
 
 notmuch_bool_t
 debugger_is_active (void);
 
-GType
-notmuch_gmime_session_get_type (void);
-
 #endif
 #endif
diff --git a/notmuch-gmime-session.c b/notmuch-gmime-session.c
deleted file mode 100644 (file)
index d83d9b3..0000000
+++ /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 */
index 5265af6dde0adce2c43e2944c3d221b0a00c1cce..514bbc642654b8bcf3f352e6e9514ffe4ee7fb4b 100644 (file)
@@ -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) {
            }
        } 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
                if (NULL == (params.cryptoctx = g_mime_gpg_context_new(session, "gpg")))
                    fprintf (stderr, "Failed to construct gpg context.\n");
                else
index 9267d022584b911cfdd6c47dfab2e4da9b2af008..dda83a10d337fc8f64bbe5bd42a94da2f0891bc6 100644 (file)
@@ -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) {
        } 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
                if (NULL == (params.cryptoctx = g_mime_gpg_context_new(session, "gpg")))
                    fprintf (stderr, "Failed to construct gpg context.\n");
                else