aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-config.c
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2009-11-11 17:33:31 -0800
committerGravatar Carl Worth <cworth@cworth.org>2009-11-11 17:33:31 -0800
commit6bd01e1b340f6a209dde64471bc9d7137511dada (patch)
tree645bad24fe1d070e7ce3bd541d75ea225b4ab969 /notmuch-config.c
parentc884c30c30f97a857a0fae16d0d212632080361d (diff)
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.
Diffstat (limited to 'notmuch-config.c')
-rw-r--r--notmuch-config.c16
1 files changed, 12 insertions, 4 deletions
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;
}