mirror of https://github.com/MidnightCommander/mc
Ticket #3430: introduce -Wundef check to catch macro typos.
Use always defined MC_HOMEDIR_XDG macro. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
1a5015aa87
commit
8a2f9e253d
|
@ -373,9 +373,9 @@ AC_ARG_WITH([homedir],
|
|||
|
||||
|
||||
if test x$with_homedir = xXDG; then
|
||||
AC_DEFINE(MC_HOMEDIR_XDG, 1,
|
||||
[Define to enable XDG standard support])
|
||||
AC_DEFINE(MC_HOMEDIR_XDG, 1, [Define to enable XDG standard support])
|
||||
else
|
||||
AC_DEFINE(MC_HOMEDIR_XDG, 0, [Define to disble XDG standard support])
|
||||
AC_DEFINE_UNQUOTED([MC_USERCONF_DIR], ["$with_homedir"], [Where configs will be placed relative to $HOME])
|
||||
fi
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ static const struct
|
|||
/* *INDENT-ON* */
|
||||
};
|
||||
|
||||
#ifdef MC_HOMEDIR_XDG
|
||||
#if MC_HOMEDIR_XDG
|
||||
static const struct
|
||||
{
|
||||
char **old_basedir;
|
||||
|
@ -286,7 +286,7 @@ void
|
|||
mc_config_init_config_paths (GError ** mcerror)
|
||||
{
|
||||
char *dir;
|
||||
#ifndef MC_HOMEDIR_XDG
|
||||
#if MC_HOMEDIR_XDG == 0
|
||||
char *defined_userconf_dir;
|
||||
#endif
|
||||
|
||||
|
@ -298,7 +298,7 @@ mc_config_init_config_paths (GError ** mcerror)
|
|||
/* init mc_home and homedir if not yet */
|
||||
(void) mc_config_get_home_dir ();
|
||||
|
||||
#ifdef MC_HOMEDIR_XDG
|
||||
#if MC_HOMEDIR_XDG
|
||||
if (mc_home != NULL)
|
||||
{
|
||||
dir = g_build_filename (mc_home, ".config", (char *) NULL);
|
||||
|
@ -374,7 +374,7 @@ mc_config_deinit_config_paths (void)
|
|||
return;
|
||||
|
||||
g_free (mc_config_str);
|
||||
#ifdef MC_HOMEDIR_XDG
|
||||
#if MC_HOMEDIR_XDG
|
||||
g_free (mc_cache_str);
|
||||
g_free (mc_data_str);
|
||||
#endif /* MC_HOMEDIR_XDG */
|
||||
|
@ -452,7 +452,7 @@ mc_config_migrate_from_old_place (GError ** mcerror, char **msg)
|
|||
old_dir = mc_config_get_deprecated_path ();
|
||||
|
||||
g_free (mc_config_init_one_config_path (mc_config_str, EDIT_DIR, mcerror));
|
||||
#ifdef MC_HOMEDIR_XDG
|
||||
#if MC_HOMEDIR_XDG
|
||||
g_free (mc_config_init_one_config_path (mc_cache_str, EDIT_DIR, mcerror));
|
||||
g_free (mc_config_init_one_config_path (mc_data_str, EDIT_DIR, mcerror));
|
||||
#endif /* MC_HOMEDIR_XDG */
|
||||
|
@ -481,7 +481,7 @@ mc_config_migrate_from_old_place (GError ** mcerror, char **msg)
|
|||
g_free (old_name);
|
||||
}
|
||||
|
||||
#ifdef MC_HOMEDIR_XDG
|
||||
#if MC_HOMEDIR_XDG
|
||||
*msg = g_strdup_printf (_("Your old settings were migrated from %s\n"
|
||||
"to Freedesktop recommended dirs.\n"
|
||||
"To get more info, please visit\n"
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
#define HOME_DIR "/home/testuser"
|
||||
|
||||
#ifdef MC_HOMEDIR_XDG
|
||||
#if MC_HOMEDIR_XDG
|
||||
#define CONF_MAIN HOME_DIR PATH_SEP_STR ".config"
|
||||
#define CONF_DATA HOME_DIR PATH_SEP_STR ".local" PATH_SEP_STR "share"
|
||||
#define CONF_CACHE HOME_DIR PATH_SEP_STR ".cache"
|
||||
|
@ -54,7 +54,7 @@ static void
|
|||
setup (void)
|
||||
{
|
||||
g_setenv ("HOME", HOME_DIR, TRUE);
|
||||
#ifdef MC_HOMEDIR_XDG
|
||||
#if MC_HOMEDIR_XDG
|
||||
g_setenv ("XDG_CONFIG_HOME", CONF_MAIN, TRUE);
|
||||
g_setenv ("XDG_DATA_HOME", CONF_DATA, TRUE);
|
||||
g_setenv ("XDG_CACHE_HOME", CONF_CACHE, TRUE);
|
||||
|
|
Loading…
Reference in New Issue