* setup.c: New variable global_profile_name to hold full name of
mc.lib. (load_setup): Calculate global_profile_name. (done_setup): Free global_profile_name. (load_key_defs): Use global_profile_name. * treestore.c (should_skip_directory): Likewise.
Этот коммит содержится в:
родитель
0ab6c80efd
Коммит
d7f635e142
@ -1,12 +1,19 @@
|
|||||||
2002-08-16 Pavel Roskin <proski@gnu.org>
|
2002-08-16 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* setup.c: New variable global_profile_name to hold full name of
|
||||||
|
mc.lib.
|
||||||
|
(load_setup): Calculate global_profile_name.
|
||||||
|
(done_setup): Free global_profile_name.
|
||||||
|
(load_key_defs): Use global_profile_name.
|
||||||
|
* treestore.c (should_skip_directory): Likewise.
|
||||||
|
|
||||||
* man2hlp.c: Implement persistent fread and fwrite to make sure
|
* man2hlp.c: Implement persistent fread and fwrite to make sure
|
||||||
that all output is read and written.
|
that all output is read and written.
|
||||||
|
|
||||||
2002-08-16 Andrew V. Samoilov <sav@bcs.zp.ua>
|
2002-08-16 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||||
|
|
||||||
* help.c (show): Cast *paint_start to unsigned char to display
|
* help.c (show): Cast *paint_start to unsigned char to display
|
||||||
Cyryllic with ncurses.
|
Cyrillic with ncurses.
|
||||||
[HAS_ACS_AS_PCCHARS] (acs2pc_table): Make const.
|
[HAS_ACS_AS_PCCHARS] (acs2pc_table): Make const.
|
||||||
|
|
||||||
* user.c (expand_format): Cast the argument to functions
|
* user.c (expand_format): Cast the argument to functions
|
||||||
|
18
src/setup.c
18
src/setup.c
@ -61,7 +61,8 @@ extern char *find_ignore_dirs;
|
|||||||
|
|
||||||
extern int num_history_items_recorded;
|
extern int num_history_items_recorded;
|
||||||
|
|
||||||
char *profile_name;
|
char *profile_name; /* .mc/ini */
|
||||||
|
char *global_profile_name; /* mc.lib */
|
||||||
|
|
||||||
char setup_color_string [4096];
|
char setup_color_string [4096];
|
||||||
char term_color_string [4096];
|
char term_color_string [4096];
|
||||||
@ -499,6 +500,11 @@ load_setup (void)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
profile = setup_init ();
|
profile = setup_init ();
|
||||||
|
|
||||||
|
/* mc.lib is common for all users, but has priority lower than
|
||||||
|
~/.mc/ini. FIXME: it's only used for keys and treestore now */
|
||||||
|
global_profile_name = concat_dir_and_file (mc_home, "mc.lib");
|
||||||
|
|
||||||
/* Load integer boolean options */
|
/* Load integer boolean options */
|
||||||
for (i = 0; options [i].opt_name; i++)
|
for (i = 0; options [i].opt_name; i++)
|
||||||
*options [i].opt_addr =
|
*options [i].opt_addr =
|
||||||
@ -586,6 +592,7 @@ load_anon_passwd ()
|
|||||||
void done_setup (void)
|
void done_setup (void)
|
||||||
{
|
{
|
||||||
g_free (profile_name);
|
g_free (profile_name);
|
||||||
|
g_free (global_profile_name);
|
||||||
done_hotlist ();
|
done_hotlist ();
|
||||||
done_panelize ();
|
done_panelize ();
|
||||||
/* directory_history_free (); */
|
/* directory_history_free (); */
|
||||||
@ -624,18 +631,15 @@ load_keys_from_section (char *terminal, char *profile_name)
|
|||||||
|
|
||||||
void load_key_defs (void)
|
void load_key_defs (void)
|
||||||
{
|
{
|
||||||
char *libfile = concat_dir_and_file (mc_home, "mc.lib");
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load keys from mc.lib before ~/.mc/ini, so that the user
|
* Load keys from mc.lib before ~/.mc/ini, so that the user
|
||||||
* definitions override global settings.
|
* definitions override global settings.
|
||||||
*/
|
*/
|
||||||
load_keys_from_section ("general", libfile);
|
load_keys_from_section ("general", global_profile_name);
|
||||||
load_keys_from_section (getenv ("TERM"), libfile);
|
load_keys_from_section (getenv ("TERM"), global_profile_name);
|
||||||
load_keys_from_section ("general", profile_name);
|
load_keys_from_section ("general", profile_name);
|
||||||
load_keys_from_section (getenv ("TERM"), profile_name);
|
load_keys_from_section (getenv ("TERM"), profile_name);
|
||||||
|
|
||||||
/* We don't want a huge database loaded in core */
|
/* We don't want a huge database loaded in core */
|
||||||
free_profile_name (libfile);
|
free_profile_name (global_profile_name);
|
||||||
g_free (libfile);
|
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ void save_panel_types (void);
|
|||||||
char *load_anon_passwd (void);
|
char *load_anon_passwd (void);
|
||||||
|
|
||||||
extern char *profile_name;
|
extern char *profile_name;
|
||||||
|
extern char *global_profile_name;
|
||||||
|
|
||||||
extern char setup_color_string [];
|
extern char setup_color_string [];
|
||||||
extern char term_color_string [];
|
extern char term_color_string [];
|
||||||
|
@ -770,7 +770,7 @@ should_skip_directory(char *dir)
|
|||||||
loaded = 1;
|
loaded = 1;
|
||||||
setup_init();
|
setup_init();
|
||||||
process_special_dirs(&special_dirs, profile_name);
|
process_special_dirs(&special_dirs, profile_name);
|
||||||
process_special_dirs(&special_dirs, CONFDIR "mc.global");
|
process_special_dirs(&special_dirs, global_profile_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (l = special_dirs; l; l = l->next) {
|
for (l = special_dirs; l; l = l->next) {
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user