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 7D00F431FD6 for ; Thu, 15 Jan 2015 09:16:10 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 1.738 X-Spam-Level: * X-Spam-Status: No, score=1.738 tagged_above=-999 required=5 tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_LOW=-0.7] 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 tyOWUoktZpWF for ; Thu, 15 Jan 2015 09:16:07 -0800 (PST) Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1910B431FBC for ; Thu, 15 Jan 2015 09:16:07 -0800 (PST) Received: by mail-wi0-f176.google.com with SMTP id z2so10879169wiv.3 for ; Thu, 15 Jan 2015 09:16:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-type; bh=8oSH/4shRj56nAIqB4r7Mwz07uD1DCMO20eEPGkXvfo=; b=CRi5PhJHqkHyi1sGe4rtyBIERABM+ej/bqOeJWWPSYkDXp9Xvw77667jI8ky0LKh6x h4CZ6Ydjd+h0K5SnFxw9MDr6zY1O0PwaaSs/D4BkCWRQ1ywMxE/cUkytcWR9rwdmAWP7 x60hiUDhUyxA05ononSNBVUrTz96woVvV+lkbW4Sm/yO1ZGUIQa2w7fhY/jrsOd36WeJ uj3HM3fV1dSe/bbgZvrX/BUQLqnfp1AKa27E6h8OEWvg0B8XdtpwneQWryYuT4wUrdLL 6o3Q90Mx/AVx+evkYUYQNWoc6Kw6PUVev17NyOWbtEN4ADbXnYtx5RwkYcAnIj/mnksW IFfQ== X-Gm-Message-State: ALoCoQn2cYYFTK1uHhi9VLGRC4nAFMJUxhyLnY4LJpVnQgfXyYViPZS+Zct5h9Jtok9kEAdJSO6r X-Received: by 10.180.103.6 with SMTP id fs6mr28725130wib.11.1421342165836; Thu, 15 Jan 2015 09:16:05 -0800 (PST) Received: from localhost (mobile-internet-bcee14-89.dhcp.inet.fi. [188.238.20.89]) by mx.google.com with ESMTPSA id pl1sm8230607wic.16.2015.01.15.09.16.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jan 2015 09:16:05 -0800 (PST) From: Jani Nikula To: Todd , notmuch@notmuchmail.org Subject: Re: [PATCH v2 3/5] Add indexing for the mimetype term In-Reply-To: <1421193628-2699-4-git-send-email-todd@electricoding.com> References: <1421193628-2699-1-git-send-email-todd@electricoding.com> <1421193628-2699-4-git-send-email-todd@electricoding.com> User-Agent: Notmuch/0.19+19~g9060a1f (http://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Thu, 15 Jan 2015 19:16:17 +0200 Message-ID: <877fwo9d7i.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain 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: Thu, 15 Jan 2015 17:16:10 -0000 Please add a commit message. On Wed, 14 Jan 2015, Todd 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@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch