mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
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).
This commit is contained in:
parent
0b6349d705
commit
4cfb2a0277
6 changed files with 25 additions and 25 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue