From 6bd01e1b340f6a209dde64471bc9d7137511dada Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 11 Nov 2009 17:33:31 -0800 Subject: notmuch: Move welcome messages from "notmuch" to "notmuch setup". It's quite possible for someone to read the documentation and run "notmuch setup" rather than just "notmuch". In that case, we don't want to be any less welcoming. --- notmuch-config.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'notmuch-config.c') diff --git a/notmuch-config.c b/notmuch-config.c index f7313bfa..248149c8 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -145,10 +145,15 @@ get_username_from_passwd_file (void *ctx) * in editing the file directly. */ notmuch_config_t * -notmuch_config_open (void *ctx, const char *filename) +notmuch_config_open (void *ctx, + const char *filename, + notmuch_bool_t *is_new_ret) { GError *error = NULL; - int config_file_is_new = 0; + int is_new = 0; + + if (is_new_ret) + *is_new_ret = 0; notmuch_config_t *config = talloc (ctx, notmuch_config_t); if (config == NULL) { @@ -188,7 +193,7 @@ notmuch_config_open (void *ctx, const char *filename) return NULL; } - config_file_is_new = 1; + is_new = 1; } if (notmuch_config_get_database_path (config) == NULL) { @@ -236,7 +241,7 @@ notmuch_config_open (void *ctx, const char *filename) /* When we create a new configuration file here, we add some * comments to help the user understand what can be done. */ - if (config_file_is_new) { + if (is_new) { g_key_file_set_comment (config->key_file, NULL, NULL, toplevel_config_comment, NULL); g_key_file_set_comment (config->key_file, "database", NULL, @@ -245,6 +250,9 @@ notmuch_config_open (void *ctx, const char *filename) user_config_comment, NULL); } + if (is_new_ret) + *is_new_ret = is_new; + return config; } -- cgit v1.2.3