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 21F56431FAF for ; Tue, 2 Apr 2013 12:41:30 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, 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 ubg2vWlFWz-r for ; Tue, 2 Apr 2013 12:41:29 -0700 (PDT) Received: from mail-ye0-f182.google.com (mail-ye0-f182.google.com [209.85.213.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 9560E431FAE for ; Tue, 2 Apr 2013 12:41:29 -0700 (PDT) Received: by mail-ye0-f182.google.com with SMTP id r5so122602yen.27 for ; Tue, 02 Apr 2013 12:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:from:to:cc:message-id:in-reply-to:references :subject:mime-version:content-type:content-transfer-encoding; bh=ZS6d6SBYzVOtiiNffwaFq8cSRrwBjcDa/DP4drivaQQ=; b=0/ExunKd1Znnzz4no2Manjm3ldUOWgN/pVj/L+7ZTmfjjYLMvs7hMO9hAAY9f3FlfV aEHO4HBNNMK49REbV1giq2x2DGIcnyupUt1Gqc/0ZNs+bV9i3NkNKp2iDONKhlUPsrJ8 15e/3m7s2fJfThb2Zha+MQrnuZ9gb4okc/fG/79h132dkxd4IMhtsuRTScFWaC7ywXIX qAocXIkYSaLE3ROGSEzh9HHy2PHw9JBPHmvbUalRlLV2jFrrV1kx0jCLRiE5wbDChWCA NqH53ivg5miZ1toDh/9Z8ARb1Q89X53vNNrDuatbyKVqEZfAcyXDeEv8G3HbtzGnUo5v oefA== X-Received: by 10.236.86.105 with SMTP id v69mr15936005yhe.17.1364931689125; Tue, 02 Apr 2013 12:41:29 -0700 (PDT) Received: from localhost (187-163-100-70.static.axtel.net. [187.163.100.70]) by mx.google.com with ESMTPS id t27sm5003338yhm.20.2013.04.02.12.41.26 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 02 Apr 2013 12:41:28 -0700 (PDT) Date: Tue, 02 Apr 2013 13:39:45 -0600 From: Felipe Contreras To: "Kirill A. Shutemov" , Felipe Contreras Message-ID: <515b34012ebf8_146e1045e10937e4@nysa.mail> In-Reply-To: <1359388340-27136-5-git-send-email-kirill@shutemov.name> References: <1359388340-27136-1-git-send-email-kirill@shutemov.name> <1359388340-27136-5-git-send-email-kirill@shutemov.name> Subject: RE: [PATCH 4/5] Introduce g:notmuch_rb_folders_count_threads Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: notmuch@notmuchmail.org 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: Tue, 02 Apr 2013 19:41:30 -0000 Kirill A. Shutemov wrote: > From: "Kirill A. Shutemov" > > If the option set, folders list shows count of threads, not messages > folders.each do |name, search| > q = db.query(search) > $searches << search > - b << "%9d %-20s (%s)" % [q.search_messages.count, name, search] > + count = count_threads == 0 ? > + q.search_messages.count : q.search_threads.count I prefer: count = count_threads ? q.search_threads.count : q.search_messages.count But other than that looks good to me. Applied. -- Felipe Contreras