[PATCH v2 3/5] Add indexing for the mimetype term

Jani Nikula jani at nikula.org
Thu Jan 15 09:16:17 PST 2015


Please add a commit message.

On Wed, 14 Jan 2015, Todd <todd at electricoding.com> wrote:
> ---
>  lib/database.cc | 1 +
>  lib/index.cc    | 6 ++++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/lib/database.cc b/lib/database.cc
> index 2de60f8..7c7a267 100644
> --- a/lib/database.cc
> +++ b/lib/database.cc
> @@ -254,6 +254,7 @@ static prefix_t PROBABILISTIC_PREFIX[]= {
>      { "from",			"XFROM" },
>      { "to",			"XTO" },
>      { "attachment",		"XATTACHMENT" },
> +    { "mimetype",		"XMIMETYPE"},
>      { "subject",		"XSUBJECT"},
>  };
>  
> diff --git a/lib/index.cc b/lib/index.cc
> index 1a2e63d..2e27558 100644
> --- a/lib/index.cc
> +++ b/lib/index.cc
> @@ -318,6 +318,12 @@ _index_mime_part (notmuch_message_t *message,
>  	return;
>      }
>  
> +

Superfluous newline.

> +    GMimeContentType*  content_type = g_mime_object_get_content_type(part);

Please replace "*  " with " *".

> +    if (content_type) {
> +	_notmuch_message_gen_terms (message, "mimetype", g_mime_content_type_to_string(content_type));
> +    }

Check g_mime_content_type_to_string return value, and g_free the result
afterwards.

BR,
Jani.

> +
>      if (GMIME_IS_MULTIPART (part)) {
>  	GMimeMultipart *multipart = GMIME_MULTIPART (part);
>  	int i;
> -- 
> 1.9.1
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list