1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 60471431FBF
\r
6 for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 13:46:40 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id XnVhwrq2fJUc for <notmuch@notmuchmail.org>;
\r
17 Tue, 29 Jan 2013 13:46:39 -0800 (PST)
\r
18 Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com
\r
19 [209.85.217.174]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id F08A1431FB6
\r
22 for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 13:46:37 -0800 (PST)
\r
23 Received: by mail-lb0-f174.google.com with SMTP id l12so1340065lbo.33
\r
24 for <notmuch@notmuchmail.org>; Tue, 29 Jan 2013 13:46:36 -0800 (PST)
\r
25 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=google.com; s=20120113;
\r
27 h=x-received:from:to:subject:date:message-id:x-mailer:in-reply-to
\r
28 :references:in-reply-to:references:x-gm-message-state;
\r
29 bh=YLFzUaV58WrnYvtnhghc74bKBrMJQsRu4APYP5eJz8Y=;
\r
30 b=d0fxxYmNVtO3cO14/UtxL/x1A5lkgaDyegaOAqs+C5sYOHPKUwqaW2ezC8Zkwr5Bjk
\r
31 Rz1Elxf6Rj2IvgXglqg9G67xktOsT8kyVZl28b4AmtwDi3TUF50erFgY/h7sHwSPUyKb
\r
32 43XHpXoOBBA+oBmEUZprp4LKoHJ3ZctGvvobDFgRCg1E15uOcpqq6IY1VqgIGC5TU7p9
\r
33 IJsiMnCtx1QVcgcc6Vo2Vi1mYsEYagI4aNUo6DCeufozhJoyCE0hiJWnEHvcCN2iXGMz
\r
34 zya+NXjBsMl5MpzeSpcP1l9WA4/CqKRB3pjyDWSHRXFqxwVJIHDJ4mmNPg2udymV3dYE
\r
36 X-Received: by 10.152.123.34 with SMTP id lx2mr2445055lab.52.1359495996396;
\r
37 Tue, 29 Jan 2013 13:46:36 -0800 (PST)
\r
38 Received: from localhost (dsl-hkibrasgw4-50df51-27.dhcp.inet.fi.
\r
40 by mx.google.com with ESMTPS id j9sm5591267lbd.13.2013.01.29.13.46.33
\r
41 (version=TLSv1.2 cipher=RC4-SHA bits=128/128);
\r
42 Tue, 29 Jan 2013 13:46:35 -0800 (PST)
\r
43 From: Jani Nikula <jani@nikula.org>
\r
44 To: notmuch@notmuchmail.org
\r
45 Subject: [PATCH 1/6] cli: keep track of whether the config is newly created
\r
46 Date: Tue, 29 Jan 2013 23:46:19 +0200
\r
48 <2f89028f7986f67792478f1728ca1f1fdd382d3c.1359495450.git.jani@nikula.org>
\r
49 X-Mailer: git-send-email 1.7.10.4
\r
50 In-Reply-To: <cover.1359495450.git.jani@nikula.org>
\r
51 References: <cover.1359495450.git.jani@nikula.org>
\r
52 In-Reply-To: <cover.1359495450.git.jani@nikula.org>
\r
53 References: <cover.1359495450.git.jani@nikula.org>
\r
55 ALoCoQmU+inKmIRNoiBgIbnCDe6JsO9rJ9xgO+DRgDwVrGrPpJ0lDS5RVdizsZZF/Twf0+/mdwUR
\r
56 X-BeenThere: notmuch@notmuchmail.org
\r
57 X-Mailman-Version: 2.1.13
\r
59 List-Id: "Use and development of the notmuch mail system."
\r
60 <notmuch.notmuchmail.org>
\r
61 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
63 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
64 List-Post: <mailto:notmuch@notmuchmail.org>
\r
65 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
66 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
67 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
68 X-List-Received-Date: Tue, 29 Jan 2013 21:46:40 -0000
\r
70 Add notmuch_config_is_new() accessor function to check this.
\r
72 notmuch-client.h | 3 +++
\r
73 notmuch-config.c | 11 +++++++++++
\r
74 2 files changed, 14 insertions(+)
\r
76 diff --git a/notmuch-client.h b/notmuch-client.h
\r
77 index 5f28836..07367e0 100644
\r
78 --- a/notmuch-client.h
\r
79 +++ b/notmuch-client.h
\r
80 @@ -256,6 +256,9 @@ notmuch_config_close (notmuch_config_t *config);
\r
82 notmuch_config_save (notmuch_config_t *config);
\r
85 +notmuch_config_is_new (notmuch_config_t *config);
\r
88 notmuch_config_get_database_path (notmuch_config_t *config);
\r
90 diff --git a/notmuch-config.c b/notmuch-config.c
\r
91 index b5c2066..e733e92 100644
\r
92 --- a/notmuch-config.c
\r
93 +++ b/notmuch-config.c
\r
94 @@ -104,6 +104,7 @@ static const char search_config_comment[] =
\r
95 struct _notmuch_config {
\r
98 + notmuch_bool_t is_new;
\r
100 char *database_path;
\r
102 @@ -266,6 +267,7 @@ notmuch_config_open (void *ctx,
\r
104 config->key_file = g_key_file_new ();
\r
106 + config->is_new = FALSE;
\r
107 config->database_path = NULL;
\r
108 config->user_name = NULL;
\r
109 config->user_primary_email = NULL;
\r
110 @@ -435,6 +437,8 @@ notmuch_config_open (void *ctx,
\r
112 *is_new_ret = is_new;
\r
114 + config->is_new = is_new;
\r
119 @@ -482,6 +486,13 @@ notmuch_config_save (notmuch_config_t *config)
\r
124 +notmuch_config_is_new (notmuch_config_t *config)
\r
126 + return config->is_new;
\r
130 static const char **
\r
131 _config_get_list (notmuch_config_t *config,
\r
132 const char *section, const char *key,
\r