mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 12:32:40 +03:00
(mc_config_get_string_list): clarify usage.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
725997c8d0
commit
acf34eb98e
@ -132,12 +132,9 @@ mc_fhl_parse_get_extensions (mc_fhl_t * fhl, const gchar * group_name)
|
||||
{
|
||||
mc_fhl_filter_t *mc_filter;
|
||||
gchar **exts, **exts_orig;
|
||||
gsize exts_size;
|
||||
GString *buf;
|
||||
|
||||
exts_orig = exts =
|
||||
mc_config_get_string_list (fhl->config, group_name, "extensions", &exts_size);
|
||||
|
||||
exts_orig = mc_config_get_string_list (fhl->config, group_name, "extensions", NULL);
|
||||
if (exts_orig == NULL || exts_orig[0] == NULL)
|
||||
{
|
||||
g_strfreev (exts_orig);
|
||||
@ -145,6 +142,7 @@ mc_fhl_parse_get_extensions (mc_fhl_t * fhl, const gchar * group_name)
|
||||
}
|
||||
|
||||
buf = g_string_sized_new (64);
|
||||
|
||||
for (exts = exts_orig; *exts != NULL; exts++)
|
||||
{
|
||||
char *esc_ext;
|
||||
|
@ -62,7 +62,8 @@ gboolean mc_config_get_bool (mc_config_t *, const gchar *, const gchar *, gboole
|
||||
int mc_config_get_int (mc_config_t *, const gchar *, const gchar *, int);
|
||||
|
||||
|
||||
gchar **mc_config_get_string_list (mc_config_t *, const gchar *, const gchar *, gsize *);
|
||||
gchar **mc_config_get_string_list (mc_config_t * mc_config, const gchar * group,
|
||||
const gchar * param, gsize * length);
|
||||
|
||||
gboolean *mc_config_get_bool_list (mc_config_t *, const gchar *, const gchar *, gsize *);
|
||||
|
||||
|
@ -1921,7 +1921,6 @@ edit_load_macro_cmd (WEdit * edit)
|
||||
mc_config_t *macros_config = NULL;
|
||||
gchar **profile_keys, **keys;
|
||||
gchar **values, **curr_values;
|
||||
gsize values_len;
|
||||
const char *section_name = "editor";
|
||||
gchar *macros_fname;
|
||||
|
||||
@ -1944,8 +1943,7 @@ edit_load_macro_cmd (WEdit * edit)
|
||||
macros_t macro;
|
||||
|
||||
macros = g_array_new (TRUE, FALSE, sizeof (macro_action_t));
|
||||
values =
|
||||
mc_config_get_string_list (macros_config, section_name, *profile_keys, &values_len);
|
||||
values = mc_config_get_string_list (macros_config, section_name, *profile_keys, NULL);
|
||||
hotkey = lookup_key (*profile_keys, NULL);
|
||||
|
||||
for (curr_values = values; *curr_values != NULL && *curr_values[0] != '\0'; curr_values++)
|
||||
|
@ -539,23 +539,24 @@ remove_entry (tree_entry * entry)
|
||||
static void
|
||||
process_special_dirs (GList ** special_dirs, const char *file)
|
||||
{
|
||||
gchar **buffers, **start_buff;
|
||||
gchar **start_buff;
|
||||
mc_config_t *cfg;
|
||||
gsize buffers_len;
|
||||
|
||||
cfg = mc_config_init (file, TRUE);
|
||||
if (cfg == NULL)
|
||||
return;
|
||||
|
||||
start_buff = buffers = mc_config_get_string_list (cfg, "Special dirs", "list", &buffers_len);
|
||||
if (buffers != NULL)
|
||||
start_buff = mc_config_get_string_list (cfg, "Special dirs", "list", NULL);
|
||||
if (start_buff != NULL)
|
||||
{
|
||||
while (*buffers != NULL)
|
||||
gchar **buffers;
|
||||
|
||||
for (buffers = start_buff; *buffers != NULL; buffers++)
|
||||
{
|
||||
*special_dirs = g_list_prepend (*special_dirs, *buffers);
|
||||
*buffers = NULL;
|
||||
buffers++;
|
||||
}
|
||||
|
||||
g_strfreev (start_buff);
|
||||
}
|
||||
mc_config_deinit (cfg);
|
||||
|
37
src/setup.c
37
src/setup.c
@ -617,10 +617,8 @@ load_keys_from_section (const char *terminal, mc_config_t * cfg)
|
||||
{
|
||||
char *section_name;
|
||||
gchar **profile_keys, **keys;
|
||||
gchar **values, **curr_values;
|
||||
char *valcopy, *value;
|
||||
long key_code;
|
||||
gsize values_len;
|
||||
|
||||
if (terminal == NULL)
|
||||
return;
|
||||
@ -639,22 +637,24 @@ load_keys_from_section (const char *terminal, mc_config_t * cfg)
|
||||
continue;
|
||||
}
|
||||
|
||||
curr_values = values =
|
||||
mc_config_get_string_list (cfg, section_name, *profile_keys, &values_len);
|
||||
|
||||
key_code = lookup_key (*profile_keys, NULL);
|
||||
|
||||
if (key_code != 0)
|
||||
{
|
||||
if (curr_values != NULL)
|
||||
gchar **values;
|
||||
|
||||
values = mc_config_get_string_list (cfg, section_name, *profile_keys, NULL);
|
||||
if (values != NULL)
|
||||
{
|
||||
while (*curr_values != NULL)
|
||||
gchar **curr_values;
|
||||
|
||||
for (curr_values = values; *curr_values != NULL; curr_values++)
|
||||
{
|
||||
valcopy = convert_controls (*curr_values);
|
||||
define_sequence (key_code, valcopy, MCKEY_NOACTION);
|
||||
g_free (valcopy);
|
||||
curr_values++;
|
||||
}
|
||||
|
||||
g_strfreev (values);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -665,8 +665,6 @@ load_keys_from_section (const char *terminal, mc_config_t * cfg)
|
||||
g_free (value);
|
||||
}
|
||||
}
|
||||
|
||||
g_strfreev (values);
|
||||
}
|
||||
g_strfreev (keys);
|
||||
g_free (section_name);
|
||||
@ -686,22 +684,21 @@ load_keymap_from_section (const char *section_name, GArray * keymap, mc_config_t
|
||||
|
||||
for (profile_keys = keys; *profile_keys != NULL; profile_keys++)
|
||||
{
|
||||
gchar **values, **curr_values;
|
||||
gsize len;
|
||||
gchar **values;
|
||||
|
||||
curr_values = values = mc_config_get_string_list (cfg, section_name, *profile_keys, &len);
|
||||
|
||||
if (curr_values != NULL)
|
||||
values = mc_config_get_string_list (cfg, section_name, *profile_keys, NULL);
|
||||
if (values != NULL)
|
||||
{
|
||||
int action;
|
||||
|
||||
action = keybind_lookup_action (*profile_keys);
|
||||
if (action > 0)
|
||||
while (*curr_values != NULL)
|
||||
{
|
||||
{
|
||||
gchar **curr_values;
|
||||
|
||||
for (curr_values = values; *curr_values != NULL; curr_values++)
|
||||
keybind_cmd_bind (keymap, *curr_values, action);
|
||||
curr_values++;
|
||||
}
|
||||
}
|
||||
|
||||
g_strfreev (values);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user