summaryrefslogtreecommitdiff
path: root/src/fe-common/core/completion.c
diff options
context:
space:
mode:
authorAlexander Færøy <ahf@0x90.dk>2015-10-02 20:25:14 +0200
committerAlexander Færøy <ahf@0x90.dk>2015-10-03 19:01:16 +0200
commit685d8fe5b033ffce40b02aaf4ec3341f5cf3350c (patch)
tree2e2501a2580505e0d210814fdc1ea0cb3056613f /src/fe-common/core/completion.c
parent48375c3f900f56434441caa0161c0531fd0ce435 (diff)
downloadirssi-685d8fe5b033ffce40b02aaf4ec3341f5cf3350c.zip
Add SETTING_TYPE_ANY and replace -1 with it.
Diffstat (limited to 'src/fe-common/core/completion.c')
-rw-r--r--src/fe-common/core/completion.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c
index 312e417c..4461de92 100644
--- a/src/fe-common/core/completion.c
+++ b/src/fe-common/core/completion.c
@@ -362,8 +362,7 @@ static GList *completion_get_settings(const char *key, SettingType type)
for (tmp = sets; tmp != NULL; tmp = tmp->next) {
SETTINGS_REC *rec = tmp->data;
- if ((type == -1 || rec->type == type) &&
- g_ascii_strncasecmp(rec->key, key, len) == 0)
+ if ((type == SETTING_TYPE_ANY || rec->type == type) && g_ascii_strncasecmp(rec->key, key, len) == 0)
complist = g_list_insert_sorted(complist, g_strdup(rec->key), (GCompareFunc) g_istr_cmp);
}
g_slist_free(sets);
@@ -682,7 +681,7 @@ static void sig_complete_set(GList **list, WINDOW_REC *window,
if (*line == '\0' ||
!g_strcmp0("-clear", line) || !g_strcmp0("-default", line))
- *list = completion_get_settings(word, -1);
+ *list = completion_get_settings(word, SETTING_TYPE_ANY);
else if (*line != '\0' && *word == '\0') {
SETTINGS_REC *rec = settings_get_record(line);
if (rec != NULL) {