From 4cfb2a02778bac16e785bbea1fd6c665e34bd955 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Wed, 10 Nov 2010 16:26:14 -0800 Subject: [PATCH] Avoid abbreviation, preferring notmuch_config_get_maildir_synchronize_flags Since the name of the configuration parameter here is: maildir.synchronize_flags the convention is that the functions to get and set this parameter should match it in name. Hence: notmuch_config_get_maildir_synchronize_flags etc. (as opposed to notmuch_config_get_maildir_sync). --- notmuch-client.h | 6 +++--- notmuch-config.c | 26 +++++++++++++------------- notmuch-new.c | 8 ++++---- notmuch-restore.c | 2 +- notmuch-setup.c | 6 +++--- notmuch-tag.c | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/notmuch-client.h b/notmuch-client.h index a9a9e429..005385d8 100644 --- a/notmuch-client.h +++ b/notmuch-client.h @@ -198,11 +198,11 @@ notmuch_config_set_new_tags (notmuch_config_t *config, size_t length); notmuch_bool_t -notmuch_config_get_maildir_sync (notmuch_config_t *config); +notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config); void -notmuch_config_set_maildir_sync (notmuch_config_t *config, - notmuch_bool_t maildir_sync); +notmuch_config_set_maildir_synchronize_flags (notmuch_config_t *config, + notmuch_bool_t synchronize_flags); notmuch_bool_t debugger_is_active (void); diff --git a/notmuch-config.c b/notmuch-config.c index 483d5c63..9ad56467 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -80,7 +80,7 @@ struct _notmuch_config { size_t user_other_email_length; const char **new_tags; size_t new_tags_length; - notmuch_bool_t maildir_sync; + notmuch_bool_t maildir_synchronize_flags; }; #define MAILDIR_SYNC_UNDEF ((notmuch_bool_t)-1) @@ -233,7 +233,7 @@ notmuch_config_open (void *ctx, config->user_other_email_length = 0; config->new_tags = NULL; config->new_tags_length = 0; - config->maildir_sync = MAILDIR_SYNC_UNDEF; + config->maildir_synchronize_flags = MAILDIR_SYNC_UNDEF; if (! g_key_file_load_from_file (config->key_file, config->filename, @@ -327,8 +327,8 @@ notmuch_config_open (void *ctx, notmuch_config_set_new_tags (config, tags, 2); } - if (notmuch_config_get_maildir_sync (config) == MAILDIR_SYNC_UNDEF) { - notmuch_config_set_maildir_sync (config, FALSE); + if (notmuch_config_get_maildir_synchronize_flags (config) == MAILDIR_SYNC_UNDEF) { + notmuch_config_set_maildir_synchronize_flags (config, FALSE); } /* Whenever we know of configuration sections that don't appear in @@ -729,26 +729,26 @@ notmuch_config_command (void *ctx, int argc, char *argv[]) } notmuch_bool_t -notmuch_config_get_maildir_sync (notmuch_config_t *config) +notmuch_config_get_maildir_synchronize_flags (notmuch_config_t *config) { GError *err = NULL; - if (config->maildir_sync == MAILDIR_SYNC_UNDEF) { - config->maildir_sync = + if (config->maildir_synchronize_flags == MAILDIR_SYNC_UNDEF) { + config->maildir_synchronize_flags = g_key_file_get_boolean (config->key_file, "maildir", "synchronize_flags", &err); if (err) { - config->maildir_sync = MAILDIR_SYNC_UNDEF; + config->maildir_synchronize_flags = MAILDIR_SYNC_UNDEF; g_error_free (err); } } - return config->maildir_sync; + return config->maildir_synchronize_flags; } void -notmuch_config_set_maildir_sync (notmuch_config_t *config, - notmuch_bool_t maildir_sync) +notmuch_config_set_maildir_synchronize_flags (notmuch_config_t *config, + notmuch_bool_t synchronize_flags) { g_key_file_set_boolean (config->key_file, - "maildir", "synchronize_flags", maildir_sync); - config->maildir_sync = maildir_sync; + "maildir", "synchronize_flags", synchronize_flags); + config->maildir_synchronize_flags = synchronize_flags; } diff --git a/notmuch-new.c b/notmuch-new.c index 273916e6..23e7afc5 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -45,7 +45,7 @@ typedef struct { _filename_list_t *removed_files; _filename_list_t *removed_directories; - notmuch_bool_t maildir_sync; + notmuch_bool_t synchronize_flags; } add_files_state_t; static volatile sig_atomic_t do_add_files_print_progress = 0; @@ -411,12 +411,12 @@ add_files_recursive (notmuch_database_t *notmuch, state->added_messages++; for (tag=state->new_tags; *tag != NULL; tag++) notmuch_message_add_tag (message, *tag); - if (state->maildir_sync == TRUE) + if (state->synchronize_flags == TRUE) notmuch_message_maildir_to_tags (message, next); break; /* Non-fatal issues (go on to next file) */ case NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: - if (state->maildir_sync == TRUE) + if (state->synchronize_flags == TRUE) notmuch_message_maildir_to_tags (message, next); break; case NOTMUCH_STATUS_FILE_NOT_EMAIL: @@ -741,7 +741,7 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) return 1; add_files_state.new_tags = notmuch_config_get_new_tags (config, &add_files_state.new_tags_length); - add_files_state.maildir_sync = notmuch_config_get_maildir_sync (config); + add_files_state.synchronize_flags = notmuch_config_get_maildir_synchronize_flags (config); db_path = notmuch_config_get_database_path (config); dot_notmuch_path = talloc_asprintf (ctx, "%s/%s", db_path, ".notmuch"); diff --git a/notmuch-restore.c b/notmuch-restore.c index b5c5c48d..98660b32 100644 --- a/notmuch-restore.c +++ b/notmuch-restore.c @@ -42,7 +42,7 @@ notmuch_restore_command (unused (void *ctx), int argc, char *argv[]) return 1; notmuch_database_set_maildir_sync (notmuch, - notmuch_config_get_maildir_sync (config)); + notmuch_config_get_maildir_synchronize_flags (config)); if (argc) { input = fopen (argv[0], "r"); if (input == NULL) { diff --git a/notmuch-setup.c b/notmuch-setup.c index 36ce71fb..9f37e4a6 100644 --- a/notmuch-setup.c +++ b/notmuch-setup.c @@ -196,13 +196,13 @@ notmuch_setup_command (unused (void *ctx), } prompt ("Synchronize maildir flags with notmuch tags? %s: ", - notmuch_config_get_maildir_sync (config) == TRUE ? "[yes]/no" : "[no]/yes"); + notmuch_config_get_maildir_synchronize_flags (config) == TRUE ? "[yes]/no" : "[no]/yes"); if (strlen (response) > 0) { if (strcasecmp (response, "yes") == 0|| strcasecmp (response, "y") == 0) - notmuch_config_set_maildir_sync (config, TRUE); + notmuch_config_set_maildir_synchronize_flags (config, TRUE); else - notmuch_config_set_maildir_sync (config, FALSE); + notmuch_config_set_maildir_synchronize_flags (config, FALSE); } if (! notmuch_config_save (config)) { diff --git a/notmuch-tag.c b/notmuch-tag.c index 3a489a97..53f08f43 100644 --- a/notmuch-tag.c +++ b/notmuch-tag.c @@ -101,7 +101,7 @@ notmuch_tag_command (void *ctx, unused (int argc), unused (char *argv[])) if (notmuch == NULL) return 1; notmuch_database_set_maildir_sync (notmuch, - notmuch_config_get_maildir_sync (config)); + notmuch_config_get_maildir_synchronize_flags (config)); query = notmuch_query_create (notmuch, query_string); if (query == NULL) { -- 2.43.0