diff --git a/src/bin/e_config.c b/src/bin/e_config.c index f1ba09a28..1c24df5d0 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -1,25 +1,25 @@ #include "e.h" #if ((E17_PROFILE >= LOWRES_PDA) && (E17_PROFILE <= HIRES_PDA)) -#define DEF_MENUCLICK 1.25 +#define DEF_MENUCLICK 1.25 #else -#define DEF_MENUCLICK 0.25 +#define DEF_MENUCLICK 0.25 #endif #define RANDR_SERIALIZED_SETUP_11 ((int)((1 << 16) | 1)) #define RANDR_SERIALIZED_SETUP_12 ((int)((1 << 16) | 2)) #define RANDR_SERIALIZED_SETUP_13 ((int)((1 << 16) | 3)) -EAPI E_Config *e_config = NULL; +EAPI E_Config * e_config = NULL; static int _e_config_revisions = 9; /* local subsystem functions */ -static void _e_config_save_cb(void *data); -static void _e_config_free(E_Config *cfg); +static void _e_config_save_cb(void *data); +static void _e_config_free(E_Config *cfg); static Eina_Bool _e_config_cb_timer(void *data); -static int _e_config_eet_close_handle(Eet_File *ef, char *file); -static void _e_config_acpi_bindings_add(void); +static int _e_config_eet_close_handle(Eet_File *ef, char *file); +static void _e_config_acpi_bindings_add(void); /* local subsystem globals */ static int _e_config_save_block = 0; @@ -61,7 +61,6 @@ static E_Config_DD *_e_config_randr_serialized_crtc_edd = NULL; static E_Config_DD *_e_config_xkb_layout_edd = NULL; static E_Config_DD *_e_config_xkb_option_edd = NULL; - EAPI int E_EVENT_CONFIG_ICON_THEME = 0; EAPI int E_EVENT_CONFIG_MODE_CHANGED = 0; EAPI int E_EVENT_CONFIG_LOADED = 0; @@ -125,25 +124,25 @@ e_config_init(void) if (_e_config_profile) { - /* if environment var set - use this profile name */ - _e_config_profile = strdup(_e_config_profile); + /* if environment var set - use this profile name */ + _e_config_profile = strdup(_e_config_profile); } else { - Eet_File *ef; - char buf[PATH_MAX]; + Eet_File *ef; + char buf[PATH_MAX]; - /* try user profile config */ - e_user_dir_concat_static(buf, "config/profile.cfg"); - ef = eet_open(buf, EET_FILE_MODE_READ); + /* try user profile config */ + e_user_dir_concat_static(buf, "config/profile.cfg"); + ef = eet_open(buf, EET_FILE_MODE_READ); if (ef) { _e_config_profile = _e_config_profile_name_get(ef); eet_close(ef); ef = NULL; } - if (!_e_config_profile) - { + if (!_e_config_profile) + { int i; for (i = 1; i <= _e_config_revisions; i++) @@ -164,7 +163,7 @@ e_config_init(void) e_prefix_data_concat_static(buf, "data/config/profile.cfg"); ef = eet_open(buf, EET_FILE_MODE_READ); } - } + } if (ef) { _e_config_profile = _e_config_profile_name_get(ef); @@ -172,24 +171,24 @@ e_config_init(void) ef = NULL; } if (!_e_config_profile) - { - /* no profile config - try other means */ - char *lnk = NULL; + { + /* no profile config - try other means */ + char *lnk = NULL; - /* check symlink - if default is a symlink to another dir */ - e_prefix_data_concat_static(buf, "data/config/default"); - lnk = ecore_file_readlink(buf); - /* if so use just the filename as the profile - must be a local link */ - if (lnk) - { - _e_config_profile = strdup(ecore_file_file_get(lnk)); - free(lnk); - } - else - _e_config_profile = strdup("default"); - } - if (!getenv("E_CONF_PROFILE")) - e_util_env_set("E_CONF_PROFILE", _e_config_profile); + /* check symlink - if default is a symlink to another dir */ + e_prefix_data_concat_static(buf, "data/config/default"); + lnk = ecore_file_readlink(buf); + /* if so use just the filename as the profile - must be a local link */ + if (lnk) + { + _e_config_profile = strdup(ecore_file_file_get(lnk)); + free(lnk); + } + else + _e_config_profile = strdup("default"); + } + if (!getenv("E_CONF_PROFILE")) + e_util_env_set("E_CONF_PROFILE", _e_config_profile); } _e_config_gadcon_client_edd = E_CONFIG_DD_NEW("E_Config_Gadcon_Client", E_Config_Gadcon_Client); @@ -303,7 +302,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, priority, INT); _e_config_font_default_edd = E_CONFIG_DD_NEW("E_Font_Default", - E_Font_Default); + E_Font_Default); #undef T #undef D #define T E_Font_Default @@ -313,7 +312,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, size, INT); _e_config_font_fallback_edd = E_CONFIG_DD_NEW("E_Font_Fallback", - E_Font_Fallback); + E_Font_Fallback); #undef T #undef D #define T E_Font_Fallback @@ -321,7 +320,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, name, STR); _e_config_bindings_mouse_edd = E_CONFIG_DD_NEW("E_Config_Binding_Mouse", - E_Config_Binding_Mouse); + E_Config_Binding_Mouse); #undef T #undef D #define T E_Config_Binding_Mouse @@ -334,7 +333,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, any_mod, UCHAR); _e_config_bindings_key_edd = E_CONFIG_DD_NEW("E_Config_Binding_Key", - E_Config_Binding_Key); + E_Config_Binding_Key); #undef T #undef D #define T E_Config_Binding_Key @@ -347,7 +346,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, any_mod, UCHAR); _e_config_bindings_edge_edd = E_CONFIG_DD_NEW("E_Config_Binding_Edge", - E_Config_Binding_Edge); + E_Config_Binding_Edge); #undef T #undef D #define T E_Config_Binding_Edge @@ -361,7 +360,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, delay, FLOAT); _e_config_bindings_signal_edd = E_CONFIG_DD_NEW("E_Config_Binding_Signal", - E_Config_Binding_Signal); + E_Config_Binding_Signal); #undef T #undef D #define T E_Config_Binding_Signal @@ -375,7 +374,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, params, STR); _e_config_bindings_wheel_edd = E_CONFIG_DD_NEW("E_Config_Binding_Wheel", - E_Config_Binding_Wheel); + E_Config_Binding_Wheel); #undef T #undef D #define T E_Config_Binding_Wheel @@ -389,7 +388,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, params, STR); _e_config_bindings_acpi_edd = E_CONFIG_DD_NEW("E_Config_Binding_Acpi", - E_Config_Binding_Acpi); + E_Config_Binding_Acpi); #undef T #undef D #define T E_Config_Binding_Acpi @@ -484,7 +483,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, a3, INT); _e_config_mime_icon_edd = E_CONFIG_DD_NEW("E_Config_Mime_Icon", - E_Config_Mime_Icon); + E_Config_Mime_Icon); #undef T #undef D #define T E_Config_Mime_Icon @@ -541,7 +540,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, orientation, INT); E_CONFIG_VAL(D, T, refresh_rate, SHORT); - _e_config_randr_serialized_output_policy_edd = E_CONFIG_DD_NEW("E_Randr_Serialized_Output_Policy", E_Randr_Serialized_Output_Policy); + _e_config_randr_serialized_output_policy_edd = E_CONFIG_DD_NEW("E_Randr_Serialized_Output_Policy", E_Randr_Serialized_Output_Policy); #undef T #undef D #define T E_Randr_Serialized_Output_Policy @@ -549,7 +548,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, name, STR); E_CONFIG_VAL(D, T, policy, INT); - _e_config_randr_serialized_output_edd = E_CONFIG_DD_NEW("E_Randr_Serialized_Output", E_Randr_Serialized_Output); + _e_config_randr_serialized_output_edd = E_CONFIG_DD_NEW("E_Randr_Serialized_Output", E_Randr_Serialized_Output); #undef T #undef D #define T E_Randr_Serialized_Output @@ -557,7 +556,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, name, STR); E_CONFIG_VAL(D, T, backlight_level, DOUBLE); - _e_config_randr_mode_info_edd = E_CONFIG_DD_NEW("Ecore_X_Randr_Mode_Info", Ecore_X_Randr_Mode_Info); + _e_config_randr_mode_info_edd = E_CONFIG_DD_NEW("Ecore_X_Randr_Mode_Info", Ecore_X_Randr_Mode_Info); #undef T #undef D #define T Ecore_X_Randr_Mode_Info @@ -577,7 +576,7 @@ e_config_init(void) E_CONFIG_VAL(D, T, nameLength, INT); E_CONFIG_VAL(D, T, modeFlags, LL); - _e_config_randr_serialized_crtc_edd = E_CONFIG_DD_NEW("E_Randr_Serialized_Crtc", E_Randr_Serialized_Crtc); + _e_config_randr_serialized_crtc_edd = E_CONFIG_DD_NEW("E_Randr_Serialized_Crtc", E_Randr_Serialized_Crtc); #undef T #undef D #define T E_Randr_Serialized_Crtc @@ -974,54 +973,54 @@ e_config_load(void) int reload = 0; /* major version change - that means wipe and restart */ - if ((e_config->config_version >> 16) < E_CONFIG_FILE_EPOCH) - { - /* your config is too old - need new defaults */ - _e_config_free(e_config); + if ((e_config->config_version >> 16) < E_CONFIG_FILE_EPOCH) + { + /* your config is too old - need new defaults */ + _e_config_free(e_config); e_config = NULL; reload = 1; - ecore_timer_add(1.0, _e_config_cb_timer, - _("Settings data needed upgrading. Your old settings have
" - "been wiped and a new set of defaults initialized. This
" - "will happen regularly during development, so don't report a
" - "bug. This simply means Enlightenment needs new settings
" - "data by default for usable functionality that your old
" - "settings simply lack. This new set of defaults will fix
" - "that by adding it in. You can re-configure things now to your
" - "liking. Sorry for the hiccup in your settings.
")); - } + ecore_timer_add(1.0, _e_config_cb_timer, + _("Settings data needed upgrading. Your old settings have
" + "been wiped and a new set of defaults initialized. This
" + "will happen regularly during development, so don't report a
" + "bug. This simply means Enlightenment needs new settings
" + "data by default for usable functionality that your old
" + "settings simply lack. This new set of defaults will fix
" + "that by adding it in. You can re-configure things now to your
" + "liking. Sorry for the hiccup in your settings.
")); + } /* config is too new? odd! suspect corruption? */ - else if (e_config->config_version > E_CONFIG_FILE_VERSION) - { - /* your config is too new - what the fuck??? */ - _e_config_free(e_config); + else if (e_config->config_version > E_CONFIG_FILE_VERSION) + { + /* your config is too new - what the fuck??? */ + _e_config_free(e_config); e_config = NULL; reload = 1; - ecore_timer_add(1.0, _e_config_cb_timer, - _("Your settings are NEWER than Enlightenment. This is very
" - "strange. This should not happen unless you downgraded
" - "Enlightenment or copied the settings from a place where
" - "a newer version of Enlightenment was running. This is bad and
" - "as a precaution your settings have been now restored to
" - "defaults. Sorry for the inconvenience.
")); - } + ecore_timer_add(1.0, _e_config_cb_timer, + _("Your settings are NEWER than Enlightenment. This is very
" + "strange. This should not happen unless you downgraded
" + "Enlightenment or copied the settings from a place where
" + "a newer version of Enlightenment was running. This is bad and
" + "as a precaution your settings have been now restored to
" + "defaults. Sorry for the inconvenience.
")); + } /* oldest minor version supported */ else if ((e_config->config_version & 0xffff) < 0x0124) { /* your config is so old - we don't even bother supporting an * upgrade path - brand new config for you! */ - _e_config_free(e_config); + _e_config_free(e_config); e_config = NULL; reload = 1; - ecore_timer_add(1.0, _e_config_cb_timer, - _("Settings data needed upgrading. Your old settings have
" - "been wiped and a new set of defaults initialized. This
" - "will happen regularly during development, so don't report a
" - "bug. This simply means Enlightenment needs new settings
" - "data by default for usable functionality that your old
" - "settings simply lack. This new set of defaults will fix
" - "that by adding it in. You can re-configure things now to your
" - "liking. Sorry for the hiccup in your settings.
")); + ecore_timer_add(1.0, _e_config_cb_timer, + _("Settings data needed upgrading. Your old settings have
" + "been wiped and a new set of defaults initialized. This
" + "will happen regularly during development, so don't report a
" + "bug. This simply means Enlightenment needs new settings
" + "data by default for usable functionality that your old
" + "settings simply lack. This new set of defaults will fix
" + "that by adding it in. You can re-configure things now to your
" + "liking. Sorry for the hiccup in your settings.
")); } if (reload) { @@ -1069,308 +1068,308 @@ e_config_load(void) if ((a) && (a->func.go)) a->func.go(NULL, NULL); } } -#define IFCFG(v) if ((e_config->config_version & 0xffff) < (v)) { +#define IFCFG(v) if ((e_config->config_version & 0xffff) < (v)) { #define IFCFGELSE } else { -#define IFCFGEND } -#define COPYVAL(x) do {e_config->x = tcfg->x;} while (0) -#define COPYPTR(x) do {e_config->x = tcfg->x; tcfg->x = NULL;} while (0) +#define IFCFGEND } +#define COPYVAL(x) do {e_config->x = tcfg->x; } while (0) +#define COPYPTR(x) do {e_config->x = tcfg->x; tcfg->x = NULL; } while (0) #define COPYSTR(x) COPYPTR(x) - if (tcfg) - { - /* some sort of upgrade is needed */ - IFCFG(0x0124); - COPYVAL(thumbscroll_enable); - COPYVAL(thumbscroll_threshhold); - COPYVAL(thumbscroll_momentum_threshhold); - COPYVAL(thumbscroll_friction); - IFCFGEND; + if (tcfg) + { + /* some sort of upgrade is needed */ + IFCFG(0x0124); + COPYVAL(thumbscroll_enable); + COPYVAL(thumbscroll_threshhold); + COPYVAL(thumbscroll_momentum_threshhold); + COPYVAL(thumbscroll_friction); + IFCFGEND; - IFCFG(0x0125); - COPYVAL(mouse_hand); - IFCFGEND; + IFCFG(0x0125); + COPYVAL(mouse_hand); + IFCFGEND; - IFCFG(0x0126); - COPYVAL(border_keyboard.timeout); - COPYVAL(border_keyboard.move.dx); - COPYVAL(border_keyboard.move.dy); - COPYVAL(border_keyboard.resize.dx); - COPYVAL(border_keyboard.resize.dy); - IFCFGEND; + IFCFG(0x0126); + COPYVAL(border_keyboard.timeout); + COPYVAL(border_keyboard.move.dx); + COPYVAL(border_keyboard.move.dy); + COPYVAL(border_keyboard.resize.dx); + COPYVAL(border_keyboard.resize.dy); + IFCFGEND; - IFCFG(0x0127); - COPYVAL(scale.min); - COPYVAL(scale.max); - COPYVAL(scale.factor); - COPYVAL(scale.base_dpi); - COPYVAL(scale.use_dpi); - COPYVAL(scale.use_custom); - IFCFGEND; + IFCFG(0x0127); + COPYVAL(scale.min); + COPYVAL(scale.max); + COPYVAL(scale.factor); + COPYVAL(scale.base_dpi); + COPYVAL(scale.use_dpi); + COPYVAL(scale.use_custom); + IFCFGEND; - IFCFG(0x0128); - COPYVAL(show_cursor); - COPYVAL(idle_cursor); - IFCFGEND; + IFCFG(0x0128); + COPYVAL(show_cursor); + COPYVAL(idle_cursor); + IFCFGEND; - IFCFG(0x0129); - COPYSTR(default_system_menu); - IFCFGEND; + IFCFG(0x0129); + COPYSTR(default_system_menu); + IFCFGEND; - IFCFG(0x012a); - COPYVAL(desklock_start_locked); - IFCFGEND; + IFCFG(0x012a); + COPYVAL(desklock_start_locked); + IFCFGEND; - IFCFG(0x012b); - COPYVAL(cfgdlg_normal_wins); - IFCFGEND; + IFCFG(0x012b); + COPYVAL(cfgdlg_normal_wins); + IFCFGEND; - IFCFG(0x012c); - COPYVAL(syscon.main.icon_size); - COPYVAL(syscon.secondary.icon_size); - COPYVAL(syscon.extra.icon_size); - COPYVAL(syscon.timeout); - COPYVAL(syscon.do_input); - COPYPTR(syscon.actions); - IFCFGEND; + IFCFG(0x012c); + COPYVAL(syscon.main.icon_size); + COPYVAL(syscon.secondary.icon_size); + COPYVAL(syscon.extra.icon_size); + COPYVAL(syscon.timeout); + COPYVAL(syscon.do_input); + COPYPTR(syscon.actions); + IFCFGEND; - IFCFG(0x012d); - COPYVAL(priority); - IFCFGEND; + IFCFG(0x012d); + COPYVAL(priority); + IFCFGEND; - IFCFG(0x012e); - COPYVAL(fullscreen_flip); - IFCFGEND; + IFCFG(0x012e); + COPYVAL(fullscreen_flip); + IFCFGEND; - IFCFG(0x012f); - COPYVAL(icon_theme_overrides); - IFCFGEND; + IFCFG(0x012f); + COPYVAL(icon_theme_overrides); + IFCFGEND; - IFCFG(0x0130); - COPYVAL(mode.presentation); - COPYVAL(mode.offline); - IFCFGEND; + IFCFG(0x0130); + COPYVAL(mode.presentation); + COPYVAL(mode.offline); + IFCFGEND; - IFCFG(0x0131); - COPYVAL(desklock_post_screensaver_time); - IFCFGEND; + IFCFG(0x0131); + COPYVAL(desklock_post_screensaver_time); + IFCFGEND; - IFCFG(0x0132); - COPYVAL(desklock_ask_presentation); - COPYVAL(desklock_ask_presentation_timeout); - COPYVAL(screensaver_ask_presentation); - COPYVAL(screensaver_ask_presentation_timeout); - IFCFGEND; + IFCFG(0x0132); + COPYVAL(desklock_ask_presentation); + COPYVAL(desklock_ask_presentation_timeout); + COPYVAL(screensaver_ask_presentation); + COPYVAL(screensaver_ask_presentation_timeout); + IFCFGEND; - IFCFG(0x0134); - COPYVAL(exec.expire_timeout); - COPYVAL(exec.show_run_dialog); - COPYVAL(exec.show_exit_dialog); - IFCFGEND; + IFCFG(0x0134); + COPYVAL(exec.expire_timeout); + COPYVAL(exec.show_run_dialog); + COPYVAL(exec.show_exit_dialog); + IFCFGEND; - IFCFG(0x0136); - _e_config_acpi_bindings_add(); - IFCFGEND; + IFCFG(0x0136); + _e_config_acpi_bindings_add(); + IFCFGEND; - IFCFG(0x0137); - COPYVAL(desklock_on_suspend); - IFCFGEND; + IFCFG(0x0137); + COPYVAL(desklock_on_suspend); + IFCFGEND; - IFCFG(0x0138); - COPYVAL(geometry_auto_resize_limit); - COPYVAL(geometry_auto_move); - IFCFGEND; + IFCFG(0x0138); + COPYVAL(geometry_auto_resize_limit); + COPYVAL(geometry_auto_move); + IFCFGEND; - IFCFG(0x0142); - COPYVAL(backlight.normal); - COPYVAL(backlight.dim); - COPYVAL(backlight.transition); - COPYVAL(backlight.idle_dim); - COPYVAL(backlight.timer); - IFCFGEND; + IFCFG(0x0142); + COPYVAL(backlight.normal); + COPYVAL(backlight.dim); + COPYVAL(backlight.transition); + COPYVAL(backlight.idle_dim); + COPYVAL(backlight.timer); + IFCFGEND; - IFCFG(0x0145); - COPYVAL(xsettings.enabled); - COPYVAL(xsettings.match_e17_theme); - COPYVAL(xsettings.match_e17_icon_theme); - IFCFGEND; + IFCFG(0x0145); + COPYVAL(xsettings.enabled); + COPYVAL(xsettings.match_e17_theme); + COPYVAL(xsettings.match_e17_icon_theme); + IFCFGEND; - IFCFG(0x0147); - COPYVAL(update.check); - COPYVAL(update.later); - IFCFGEND; + IFCFG(0x0147); + COPYVAL(update.check); + COPYVAL(update.later); + IFCFGEND; - IFCFG(0x0149); - COPYVAL(powersave.none); - COPYVAL(powersave.low); - COPYVAL(powersave.medium); - COPYVAL(powersave.high); - COPYVAL(powersave.extreme); - COPYVAL(powersave.min); - COPYVAL(powersave.max); - IFCFGEND; + IFCFG(0x0149); + COPYVAL(powersave.none); + COPYVAL(powersave.low); + COPYVAL(powersave.medium); + COPYVAL(powersave.high); + COPYVAL(powersave.extreme); + COPYVAL(powersave.min); + COPYVAL(powersave.max); + IFCFGEND; - e_config->config_version = E_CONFIG_FILE_VERSION; - _e_config_free(tcfg); - } + e_config->config_version = E_CONFIG_FILE_VERSION; + _e_config_free(tcfg); + } - /* limit values so they are sane */ - E_CONFIG_LIMIT(e_config->menus_scroll_speed, 1.0, 20000.0); - E_CONFIG_LIMIT(e_config->show_splash, 0, 1); - E_CONFIG_LIMIT(e_config->menus_fast_mouse_move_threshhold, 1.0, 2000.0); - E_CONFIG_LIMIT(e_config->menus_click_drag_timeout, 0.0, 10.0); - E_CONFIG_LIMIT(e_config->border_shade_animate, 0, 1); - E_CONFIG_LIMIT(e_config->border_shade_transition, 0, 8); - E_CONFIG_LIMIT(e_config->border_shade_speed, 1.0, 20000.0); - E_CONFIG_LIMIT(e_config->framerate, 1.0, 200.0); - E_CONFIG_LIMIT(e_config->priority, 0, 19); - E_CONFIG_LIMIT(e_config->image_cache, 0, 256 * 1024); - E_CONFIG_LIMIT(e_config->font_cache, 0, 32 * 1024); - E_CONFIG_LIMIT(e_config->edje_cache, 0, 256); - E_CONFIG_LIMIT(e_config->edje_collection_cache, 0, 512); - E_CONFIG_LIMIT(e_config->cache_flush_poll_interval, 8, 32768); - E_CONFIG_LIMIT(e_config->zone_desks_x_count, 1, 64); - E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64); - E_CONFIG_LIMIT(e_config->show_desktop_icons, 0, 1); - E_CONFIG_LIMIT(e_config->edge_flip_dragging, 0, 1); - E_CONFIG_LIMIT(e_config->window_placement_policy, E_WINDOW_PLACEMENT_SMART, E_WINDOW_PLACEMENT_MANUAL); - E_CONFIG_LIMIT(e_config->focus_policy, 0, 2); - E_CONFIG_LIMIT(e_config->focus_setting, 0, 3); - E_CONFIG_LIMIT(e_config->pass_click_on, 0, 1); - E_CONFIG_LIMIT(e_config->always_click_to_raise, 0, 1); - E_CONFIG_LIMIT(e_config->always_click_to_focus, 0, 1); - E_CONFIG_LIMIT(e_config->use_auto_raise, 0, 1); - E_CONFIG_LIMIT(e_config->auto_raise_delay, 0.0, 5.0); - E_CONFIG_LIMIT(e_config->use_resist, 0, 1); - E_CONFIG_LIMIT(e_config->drag_resist, 0, 100); - E_CONFIG_LIMIT(e_config->desk_resist, 0, 100); - E_CONFIG_LIMIT(e_config->window_resist, 0, 100); - E_CONFIG_LIMIT(e_config->gadget_resist, 0, 100); - E_CONFIG_LIMIT(e_config->geometry_auto_move, 0, 1); - E_CONFIG_LIMIT(e_config->geometry_auto_resize_limit, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_warp_while_selecting, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_warp_at_end, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_warp_speed, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_scroll_animate, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_scroll_speed, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_list_show_iconified, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_show_other_desk_iconified, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_show_other_screen_iconified, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_show_other_desk_windows, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_show_other_screen_windows, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_uncover_while_selecting, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_list_jump_desk_while_selecting, 0, 1); - E_CONFIG_LIMIT(e_config->winlist_pos_align_x, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_pos_align_y, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_pos_size_w, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_pos_size_h, 0.0, 1.0); - E_CONFIG_LIMIT(e_config->winlist_pos_min_w, 0, 4000); - E_CONFIG_LIMIT(e_config->winlist_pos_min_h, 0, 4000); - E_CONFIG_LIMIT(e_config->winlist_pos_max_w, 8, 4000); - E_CONFIG_LIMIT(e_config->winlist_pos_max_h, 8, 4000); - E_CONFIG_LIMIT(e_config->maximize_policy, E_MAXIMIZE_FULLSCREEN, E_MAXIMIZE_DIRECTION); - E_CONFIG_LIMIT(e_config->allow_manip, 0, 1); - E_CONFIG_LIMIT(e_config->border_fix_on_shelf_toggle, 0, 1); - E_CONFIG_LIMIT(e_config->allow_above_fullscreen, 0, 1); - E_CONFIG_LIMIT(e_config->kill_if_close_not_possible, 0, 1); - E_CONFIG_LIMIT(e_config->kill_process, 0, 1); - E_CONFIG_LIMIT(e_config->kill_timer_wait, 0.0, 120.0); - E_CONFIG_LIMIT(e_config->ping_clients, 0, 1); - E_CONFIG_LIMIT(e_config->move_info_follows, 0, 1); - E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1); - E_CONFIG_LIMIT(e_config->move_info_visible, 0, 1); - E_CONFIG_LIMIT(e_config->resize_info_visible, 0, 1); - E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1); - E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1); - E_CONFIG_LIMIT(e_config->pointer_slide, 0, 1); - E_CONFIG_LIMIT(e_config->show_cursor, 0, 1); - E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1); - E_CONFIG_LIMIT(e_config->cursor_size, 0, 1024); - E_CONFIG_LIMIT(e_config->menu_autoscroll_margin, 0, 50); - E_CONFIG_LIMIT(e_config->menu_autoscroll_cursor_margin, 0, 50); - E_CONFIG_LIMIT(e_config->menu_eap_name_show, 0, 1); - E_CONFIG_LIMIT(e_config->menu_eap_generic_show, 0, 1); - E_CONFIG_LIMIT(e_config->menu_eap_comment_show, 0, 1); - E_CONFIG_LIMIT(e_config->use_app_icon, 0, 1); - E_CONFIG_LIMIT(e_config->cnfmdlg_disabled, 0, 1); - E_CONFIG_LIMIT(e_config->cfgdlg_auto_apply, 0, 1); - E_CONFIG_LIMIT(e_config->cfgdlg_default_mode, 0, 1); - E_CONFIG_LIMIT(e_config->font_hinting, 0, 2); - E_CONFIG_LIMIT(e_config->desklock_login_box_zone, -2, 1000); - E_CONFIG_LIMIT(e_config->desklock_autolock_screensaver, 0, 1); - E_CONFIG_LIMIT(e_config->desklock_post_screensaver_time, 0.0, 300.0); - E_CONFIG_LIMIT(e_config->desklock_autolock_idle, 0, 1); - E_CONFIG_LIMIT(e_config->desklock_autolock_idle_timeout, 1.0, 5400.0); - E_CONFIG_LIMIT(e_config->desklock_use_custom_desklock, 0, 1); - E_CONFIG_LIMIT(e_config->desklock_ask_presentation, 0, 1); - E_CONFIG_LIMIT(e_config->desklock_ask_presentation_timeout, 1.0, 300.0); - E_CONFIG_LIMIT(e_config->border_raise_on_mouse_action, 0, 1); - E_CONFIG_LIMIT(e_config->border_raise_on_focus, 0, 1); - E_CONFIG_LIMIT(e_config->desk_flip_wrap, 0, 1); - E_CONFIG_LIMIT(e_config->fullscreen_flip, 0, 1); - E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1); - E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 3); - E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1); + /* limit values so they are sane */ + E_CONFIG_LIMIT(e_config->menus_scroll_speed, 1.0, 20000.0); + E_CONFIG_LIMIT(e_config->show_splash, 0, 1); + E_CONFIG_LIMIT(e_config->menus_fast_mouse_move_threshhold, 1.0, 2000.0); + E_CONFIG_LIMIT(e_config->menus_click_drag_timeout, 0.0, 10.0); + E_CONFIG_LIMIT(e_config->border_shade_animate, 0, 1); + E_CONFIG_LIMIT(e_config->border_shade_transition, 0, 8); + E_CONFIG_LIMIT(e_config->border_shade_speed, 1.0, 20000.0); + E_CONFIG_LIMIT(e_config->framerate, 1.0, 200.0); + E_CONFIG_LIMIT(e_config->priority, 0, 19); + E_CONFIG_LIMIT(e_config->image_cache, 0, 256 * 1024); + E_CONFIG_LIMIT(e_config->font_cache, 0, 32 * 1024); + E_CONFIG_LIMIT(e_config->edje_cache, 0, 256); + E_CONFIG_LIMIT(e_config->edje_collection_cache, 0, 512); + E_CONFIG_LIMIT(e_config->cache_flush_poll_interval, 8, 32768); + E_CONFIG_LIMIT(e_config->zone_desks_x_count, 1, 64); + E_CONFIG_LIMIT(e_config->zone_desks_y_count, 1, 64); + E_CONFIG_LIMIT(e_config->show_desktop_icons, 0, 1); + E_CONFIG_LIMIT(e_config->edge_flip_dragging, 0, 1); + E_CONFIG_LIMIT(e_config->window_placement_policy, E_WINDOW_PLACEMENT_SMART, E_WINDOW_PLACEMENT_MANUAL); + E_CONFIG_LIMIT(e_config->focus_policy, 0, 2); + E_CONFIG_LIMIT(e_config->focus_setting, 0, 3); + E_CONFIG_LIMIT(e_config->pass_click_on, 0, 1); + E_CONFIG_LIMIT(e_config->always_click_to_raise, 0, 1); + E_CONFIG_LIMIT(e_config->always_click_to_focus, 0, 1); + E_CONFIG_LIMIT(e_config->use_auto_raise, 0, 1); + E_CONFIG_LIMIT(e_config->auto_raise_delay, 0.0, 5.0); + E_CONFIG_LIMIT(e_config->use_resist, 0, 1); + E_CONFIG_LIMIT(e_config->drag_resist, 0, 100); + E_CONFIG_LIMIT(e_config->desk_resist, 0, 100); + E_CONFIG_LIMIT(e_config->window_resist, 0, 100); + E_CONFIG_LIMIT(e_config->gadget_resist, 0, 100); + E_CONFIG_LIMIT(e_config->geometry_auto_move, 0, 1); + E_CONFIG_LIMIT(e_config->geometry_auto_resize_limit, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_warp_while_selecting, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_warp_at_end, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_warp_speed, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_scroll_animate, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_scroll_speed, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_list_show_iconified, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_desk_iconified, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_screen_iconified, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_desk_windows, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_show_other_screen_windows, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_uncover_while_selecting, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_list_jump_desk_while_selecting, 0, 1); + E_CONFIG_LIMIT(e_config->winlist_pos_align_x, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_align_y, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_size_w, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_size_h, 0.0, 1.0); + E_CONFIG_LIMIT(e_config->winlist_pos_min_w, 0, 4000); + E_CONFIG_LIMIT(e_config->winlist_pos_min_h, 0, 4000); + E_CONFIG_LIMIT(e_config->winlist_pos_max_w, 8, 4000); + E_CONFIG_LIMIT(e_config->winlist_pos_max_h, 8, 4000); + E_CONFIG_LIMIT(e_config->maximize_policy, E_MAXIMIZE_FULLSCREEN, E_MAXIMIZE_DIRECTION); + E_CONFIG_LIMIT(e_config->allow_manip, 0, 1); + E_CONFIG_LIMIT(e_config->border_fix_on_shelf_toggle, 0, 1); + E_CONFIG_LIMIT(e_config->allow_above_fullscreen, 0, 1); + E_CONFIG_LIMIT(e_config->kill_if_close_not_possible, 0, 1); + E_CONFIG_LIMIT(e_config->kill_process, 0, 1); + E_CONFIG_LIMIT(e_config->kill_timer_wait, 0.0, 120.0); + E_CONFIG_LIMIT(e_config->ping_clients, 0, 1); + E_CONFIG_LIMIT(e_config->move_info_follows, 0, 1); + E_CONFIG_LIMIT(e_config->resize_info_follows, 0, 1); + E_CONFIG_LIMIT(e_config->move_info_visible, 0, 1); + E_CONFIG_LIMIT(e_config->resize_info_visible, 0, 1); + E_CONFIG_LIMIT(e_config->focus_last_focused_per_desktop, 0, 1); + E_CONFIG_LIMIT(e_config->focus_revert_on_hide_or_close, 0, 1); + E_CONFIG_LIMIT(e_config->pointer_slide, 0, 1); + E_CONFIG_LIMIT(e_config->show_cursor, 0, 1); + E_CONFIG_LIMIT(e_config->use_e_cursor, 0, 1); + E_CONFIG_LIMIT(e_config->cursor_size, 0, 1024); + E_CONFIG_LIMIT(e_config->menu_autoscroll_margin, 0, 50); + E_CONFIG_LIMIT(e_config->menu_autoscroll_cursor_margin, 0, 50); + E_CONFIG_LIMIT(e_config->menu_eap_name_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_eap_generic_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_eap_comment_show, 0, 1); + E_CONFIG_LIMIT(e_config->use_app_icon, 0, 1); + E_CONFIG_LIMIT(e_config->cnfmdlg_disabled, 0, 1); + E_CONFIG_LIMIT(e_config->cfgdlg_auto_apply, 0, 1); + E_CONFIG_LIMIT(e_config->cfgdlg_default_mode, 0, 1); + E_CONFIG_LIMIT(e_config->font_hinting, 0, 2); + E_CONFIG_LIMIT(e_config->desklock_login_box_zone, -2, 1000); + E_CONFIG_LIMIT(e_config->desklock_autolock_screensaver, 0, 1); + E_CONFIG_LIMIT(e_config->desklock_post_screensaver_time, 0.0, 300.0); + E_CONFIG_LIMIT(e_config->desklock_autolock_idle, 0, 1); + E_CONFIG_LIMIT(e_config->desklock_autolock_idle_timeout, 1.0, 5400.0); + E_CONFIG_LIMIT(e_config->desklock_use_custom_desklock, 0, 1); + E_CONFIG_LIMIT(e_config->desklock_ask_presentation, 0, 1); + E_CONFIG_LIMIT(e_config->desklock_ask_presentation_timeout, 1.0, 300.0); + E_CONFIG_LIMIT(e_config->border_raise_on_mouse_action, 0, 1); + E_CONFIG_LIMIT(e_config->border_raise_on_focus, 0, 1); + E_CONFIG_LIMIT(e_config->desk_flip_wrap, 0, 1); + E_CONFIG_LIMIT(e_config->fullscreen_flip, 0, 1); + E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1); + E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 3); + E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1); - E_CONFIG_LIMIT(e_config->dpms_enable, 0, 1); - E_CONFIG_LIMIT(e_config->dpms_standby_enable, 0, 1); - E_CONFIG_LIMIT(e_config->dpms_suspend_enable, 0, 1); - E_CONFIG_LIMIT(e_config->dpms_off_enable, 0, 1); - E_CONFIG_LIMIT(e_config->dpms_standby_timeout, 0, 5400); - E_CONFIG_LIMIT(e_config->dpms_suspend_timeout, 0, 5400); - E_CONFIG_LIMIT(e_config->dpms_off_timeout, 0, 5400); + E_CONFIG_LIMIT(e_config->dpms_enable, 0, 1); + E_CONFIG_LIMIT(e_config->dpms_standby_enable, 0, 1); + E_CONFIG_LIMIT(e_config->dpms_suspend_enable, 0, 1); + E_CONFIG_LIMIT(e_config->dpms_off_enable, 0, 1); + E_CONFIG_LIMIT(e_config->dpms_standby_timeout, 0, 5400); + E_CONFIG_LIMIT(e_config->dpms_suspend_timeout, 0, 5400); + E_CONFIG_LIMIT(e_config->dpms_off_timeout, 0, 5400); - E_CONFIG_LIMIT(e_config->screensaver_timeout, 0, 5400); - E_CONFIG_LIMIT(e_config->screensaver_interval, 0, 5400); - E_CONFIG_LIMIT(e_config->screensaver_blanking, 0, 2); - E_CONFIG_LIMIT(e_config->screensaver_expose, 0, 2); - E_CONFIG_LIMIT(e_config->screensaver_ask_presentation, 0, 1); - E_CONFIG_LIMIT(e_config->screensaver_ask_presentation_timeout, 1.0, 300.0); + E_CONFIG_LIMIT(e_config->screensaver_timeout, 0, 5400); + E_CONFIG_LIMIT(e_config->screensaver_interval, 0, 5400); + E_CONFIG_LIMIT(e_config->screensaver_blanking, 0, 2); + E_CONFIG_LIMIT(e_config->screensaver_expose, 0, 2); + E_CONFIG_LIMIT(e_config->screensaver_ask_presentation, 0, 1); + E_CONFIG_LIMIT(e_config->screensaver_ask_presentation_timeout, 1.0, 300.0); - E_CONFIG_LIMIT(e_config->clientlist_group_by, 0, 2); - E_CONFIG_LIMIT(e_config->clientlist_include_all_zones, 0, 1); - E_CONFIG_LIMIT(e_config->clientlist_separate_with, 0, 2); - E_CONFIG_LIMIT(e_config->clientlist_sort_by, 0, 3); - E_CONFIG_LIMIT(e_config->clientlist_separate_iconified_apps, 0, 2); - E_CONFIG_LIMIT(e_config->clientlist_warp_to_iconified_desktop, 0, 1); - E_CONFIG_LIMIT(e_config->mouse_hand, 0, 1); - E_CONFIG_LIMIT(e_config->clientlist_limit_caption_len, 0, 1); - E_CONFIG_LIMIT(e_config->clientlist_max_caption_len, 2, E_CLIENTLIST_MAX_CAPTION_LEN); + E_CONFIG_LIMIT(e_config->clientlist_group_by, 0, 2); + E_CONFIG_LIMIT(e_config->clientlist_include_all_zones, 0, 1); + E_CONFIG_LIMIT(e_config->clientlist_separate_with, 0, 2); + E_CONFIG_LIMIT(e_config->clientlist_sort_by, 0, 3); + E_CONFIG_LIMIT(e_config->clientlist_separate_iconified_apps, 0, 2); + E_CONFIG_LIMIT(e_config->clientlist_warp_to_iconified_desktop, 0, 1); + E_CONFIG_LIMIT(e_config->mouse_hand, 0, 1); + E_CONFIG_LIMIT(e_config->clientlist_limit_caption_len, 0, 1); + E_CONFIG_LIMIT(e_config->clientlist_max_caption_len, 2, E_CLIENTLIST_MAX_CAPTION_LEN); - E_CONFIG_LIMIT(e_config->mouse_accel_numerator, 1, 10); - E_CONFIG_LIMIT(e_config->mouse_accel_denominator, 1, 10); - E_CONFIG_LIMIT(e_config->mouse_accel_threshold, 1, 10); + E_CONFIG_LIMIT(e_config->mouse_accel_numerator, 1, 10); + E_CONFIG_LIMIT(e_config->mouse_accel_denominator, 1, 10); + E_CONFIG_LIMIT(e_config->mouse_accel_threshold, 1, 10); - E_CONFIG_LIMIT(e_config->menu_favorites_show, 0, 1); - E_CONFIG_LIMIT(e_config->menu_apps_show, 0, 1); - E_CONFIG_LIMIT(e_config->menu_gadcon_client_toplevel, 0, 1); + E_CONFIG_LIMIT(e_config->menu_favorites_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_apps_show, 0, 1); + E_CONFIG_LIMIT(e_config->menu_gadcon_client_toplevel, 0, 1); - E_CONFIG_LIMIT(e_config->ping_clients_interval, 16, 1024); + E_CONFIG_LIMIT(e_config->ping_clients_interval, 16, 1024); - E_CONFIG_LIMIT(e_config->mode.presentation, 0, 1); - E_CONFIG_LIMIT(e_config->mode.offline, 0, 1); + E_CONFIG_LIMIT(e_config->mode.presentation, 0, 1); + E_CONFIG_LIMIT(e_config->mode.offline, 0, 1); - E_CONFIG_LIMIT(e_config->exec.expire_timeout, 0.1, 1000); - E_CONFIG_LIMIT(e_config->exec.show_run_dialog, 0, 1); - E_CONFIG_LIMIT(e_config->exec.show_exit_dialog, 0, 1); + E_CONFIG_LIMIT(e_config->exec.expire_timeout, 0.1, 1000); + E_CONFIG_LIMIT(e_config->exec.show_run_dialog, 0, 1); + E_CONFIG_LIMIT(e_config->exec.show_exit_dialog, 0, 1); - E_CONFIG_LIMIT(e_config->null_container_win, 0, 1); + E_CONFIG_LIMIT(e_config->null_container_win, 0, 1); - E_CONFIG_LIMIT(e_config->powersave.none, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.low, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.medium, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.high, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.extreme, 0.01, 5400.00); - E_CONFIG_LIMIT(e_config->powersave.min, E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); - E_CONFIG_LIMIT(e_config->powersave.max, E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); + E_CONFIG_LIMIT(e_config->powersave.none, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.low, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.medium, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.high, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.extreme, 0.01, 5400.00); + E_CONFIG_LIMIT(e_config->powersave.min, E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); + E_CONFIG_LIMIT(e_config->powersave.max, E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME); - /* FIXME: disabled auto apply because it causes problems */ - e_config->cfgdlg_auto_apply = 0; - /* FIXME: desklock personalized password id disabled for security reasons */ - e_config->desklock_auth_method = 0; - if (e_config->desklock_personal_passwd) - eina_stringshare_del(e_config->desklock_personal_passwd); - e_config->desklock_personal_passwd = NULL; + /* FIXME: disabled auto apply because it causes problems */ + e_config->cfgdlg_auto_apply = 0; + /* FIXME: desklock personalized password id disabled for security reasons */ + e_config->desklock_auth_method = 0; + if (e_config->desklock_personal_passwd) + eina_stringshare_del(e_config->desklock_personal_passwd); + e_config->desklock_personal_passwd = NULL; - ecore_event_add(E_EVENT_CONFIG_LOADED, NULL, NULL, NULL); + ecore_event_add(E_EVENT_CONFIG_LOADED, NULL, NULL, NULL); } EAPI int @@ -1378,8 +1377,8 @@ e_config_save(void) { if (_e_config_save_defer) { - e_powersave_deferred_action_del(_e_config_save_defer); - _e_config_save_defer = NULL; + e_powersave_deferred_action_del(_e_config_save_defer); + _e_config_save_defer = NULL; } _e_config_save_cb(NULL); return e_config_domain_save("e", _e_config_edd, e_config); @@ -1390,9 +1389,9 @@ e_config_save_flush(void) { if (_e_config_save_defer) { - e_powersave_deferred_action_del(_e_config_save_defer); - _e_config_save_defer = NULL; - _e_config_save_cb(NULL); + e_powersave_deferred_action_del(_e_config_save_defer); + _e_config_save_defer = NULL; + _e_config_save_cb(NULL); } } @@ -1402,7 +1401,7 @@ e_config_save_queue(void) if (_e_config_save_defer) e_powersave_deferred_action_del(_e_config_save_defer); _e_config_save_defer = e_powersave_deferred_action_add(_e_config_save_cb, - NULL); + NULL); } EAPI const char * @@ -1431,7 +1430,8 @@ e_config_profile_dir_get(const char *prof) return NULL; } -static int _cb_sort_files(char *f1, char *f2) +static int +_cb_sort_files(char *f1, char *f2) { return strcmp(f1, f2); } @@ -1457,21 +1457,21 @@ e_config_profile_list(void) len = sizeof(buf) - len; if (files) { - char *file; + char *file; - files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files); - EINA_LIST_FREE(files, file) - { - if (eina_strlcpy(p, file, len) >= len) - { - free(file); - continue; - } - if (ecore_file_is_dir(buf)) - flist = eina_list_append(flist, file); - else - free(file); - } + files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files); + EINA_LIST_FREE(files, file) + { + if (eina_strlcpy(p, file, len) >= len) + { + free(file); + continue; + } + if (ecore_file_is_dir(buf)) + flist = eina_list_append(flist, file); + else + free(file); + } } len = e_prefix_data_concat_static(buf, "data/config"); if (len >= sizeof(buf)) @@ -1486,28 +1486,28 @@ e_config_profile_list(void) len = sizeof(buf) - len; if (files) { - char *file; - files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files); - EINA_LIST_FREE(files, file) - { - if (eina_strlcpy(p, file, len) >= len) - { - free(file); - continue; - } - if (ecore_file_is_dir(buf)) - { - const Eina_List *l; - const char *tmp; - EINA_LIST_FOREACH(flist, l, tmp) - if (!strcmp(file, tmp)) break; + char *file; + files = eina_list_sort(files, 0, (Eina_Compare_Cb)_cb_sort_files); + EINA_LIST_FREE(files, file) + { + if (eina_strlcpy(p, file, len) >= len) + { + free(file); + continue; + } + if (ecore_file_is_dir(buf)) + { + const Eina_List *l; + const char *tmp; + EINA_LIST_FOREACH(flist, l, tmp) + if (!strcmp(file, tmp)) break; - if (!l) flist = eina_list_append(flist, file); - else free(file); - } - else - free(file); - } + if (!l) flist = eina_list_append(flist, file); + else free(file); + } + else + free(file); + } } return flist; } @@ -1533,7 +1533,7 @@ e_config_profile_del(const char *prof) EAPI void e_config_save_block_set(int block) { - _e_config_save_block = block; + _e_config_save_block = block; } EAPI int @@ -1551,12 +1551,12 @@ e_config_domain_load(const char *domain, E_Config_DD *edd) int i; e_user_dir_snprintf(buf, sizeof(buf), "config/%s/%s.cfg", - _e_config_profile, domain); + _e_config_profile, domain); ef = eet_open(buf, EET_FILE_MODE_READ); if (ef) { - data = eet_data_read(ef, edd, "config"); - eet_close(ef); + data = eet_data_read(ef, edd, "config"); + eet_close(ef); if (data) return data; } @@ -1583,12 +1583,12 @@ e_config_domain_system_load(const char *domain, E_Config_DD *edd) void *data = NULL; e_prefix_data_snprintf(buf, sizeof(buf), "data/config/%s/%s.cfg", - _e_config_profile, domain); + _e_config_profile, domain); ef = eet_open(buf, EET_FILE_MODE_READ); if (ef) { - data = eet_data_read(ef, edd, "config"); - eet_close(ef); + data = eet_data_read(ef, edd, "config"); + eet_close(ef); return data; } @@ -1646,11 +1646,11 @@ e_config_profile_save(void) ef = eet_open(buf2, EET_FILE_MODE_WRITE); if (ef) { - ok = eet_write(ef, "config", _e_config_profile, - strlen(_e_config_profile), 0); - if (_e_config_eet_close_handle(ef, buf2)) - { - Eina_Bool ret = EINA_TRUE; + ok = eet_write(ef, "config", _e_config_profile, + strlen(_e_config_profile), 0); + if (_e_config_eet_close_handle(ef, buf2)) + { + Eina_Bool ret = EINA_TRUE; if (_e_config_revisions > 0) { @@ -1682,9 +1682,9 @@ e_config_profile_save(void) } } ret = ecore_file_mv(buf2, buf); - if (!ret) _e_config_mv_error(buf2, buf); - } - ecore_file_unlink(buf2); + if (!ret) _e_config_mv_error(buf2, buf); + } + ecore_file_unlink(buf2); } return ok; } @@ -1722,9 +1722,9 @@ e_config_domain_save(const char *domain, E_Config_DD *edd, const void *data) ef = eet_open(buf2, EET_FILE_MODE_WRITE); if (ef) { - ok = eet_data_write(ef, edd, "config", data, 1); - if (_e_config_eet_close_handle(ef, buf2)) - { + ok = eet_data_write(ef, edd, "config", data, 1); + if (_e_config_eet_close_handle(ef, buf2)) + { if (_e_config_revisions > 0) { int i; @@ -1744,11 +1744,11 @@ e_config_domain_save(const char *domain, E_Config_DD *edd, const void *data) e_user_dir_snprintf(bdst, sizeof(bdst), "config/%s/%s.1.cfg", _e_config_profile, domain); ecore_file_mv(bsrc, bdst); } - ret = ecore_file_mv(buf2, buf); - if (!ret) - ERR("*** Error saving config. ***"); - } - ecore_file_unlink(buf2); + ret = ecore_file_mv(buf2, buf); + if (!ret) + ERR("*** Error saving config. ***"); + } + ecore_file_unlink(buf2); } return ok; } @@ -1761,15 +1761,15 @@ e_config_binding_mouse_match(E_Config_Binding_Mouse *eb_in) EINA_LIST_FOREACH(e_config->mouse_bindings, l, eb) { - if ((eb->context == eb_in->context) && - (eb->button == eb_in->button) && - (eb->modifiers == eb_in->modifiers) && - (eb->any_mod == eb_in->any_mod) && - (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || - ((!eb->action) && (!eb_in->action))) && - (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || - ((!eb->params) && (!eb_in->params)))) - return eb; + if ((eb->context == eb_in->context) && + (eb->button == eb_in->button) && + (eb->modifiers == eb_in->modifiers) && + (eb->any_mod == eb_in->any_mod) && + (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) + return eb; } return NULL; } @@ -1782,16 +1782,16 @@ e_config_binding_key_match(E_Config_Binding_Key *eb_in) EINA_LIST_FOREACH(e_config->mouse_bindings, l, eb) { - if ((eb->context == eb_in->context) && - (eb->modifiers == eb_in->modifiers) && - (eb->any_mod == eb_in->any_mod) && - (((eb->key) && (eb_in->key) && (!strcmp(eb->key, eb_in->key))) || - ((!eb->key) && (!eb_in->key))) && - (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || - ((!eb->action) && (!eb_in->action))) && - (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || - ((!eb->params) && (!eb_in->params)))) - return eb; + if ((eb->context == eb_in->context) && + (eb->modifiers == eb_in->modifiers) && + (eb->any_mod == eb_in->any_mod) && + (((eb->key) && (eb_in->key) && (!strcmp(eb->key, eb_in->key))) || + ((!eb->key) && (!eb_in->key))) && + (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) + return eb; } return NULL; } @@ -1804,16 +1804,16 @@ e_config_binding_edge_match(E_Config_Binding_Edge *eb_in) EINA_LIST_FOREACH(e_config->edge_bindings, l, eb) { - if ((eb->context == eb_in->context) && - (eb->modifiers == eb_in->modifiers) && - (eb->any_mod == eb_in->any_mod) && - (eb->edge == eb_in->edge) && - (eb->delay == eb_in->delay) && - (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || - ((!eb->action) && (!eb_in->action))) && - (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || - ((!eb->params) && (!eb_in->params)))) - return eb; + if ((eb->context == eb_in->context) && + (eb->modifiers == eb_in->modifiers) && + (eb->any_mod == eb_in->any_mod) && + (eb->edge == eb_in->edge) && + (eb->delay == eb_in->delay) && + (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) + return eb; } return NULL; } @@ -1826,18 +1826,18 @@ e_config_binding_signal_match(E_Config_Binding_Signal *eb_in) EINA_LIST_FOREACH(e_config->signal_bindings, l, eb) { - if ((eb->context == eb_in->context) && - (eb->modifiers == eb_in->modifiers) && - (eb->any_mod == eb_in->any_mod) && - (((eb->signal) && (eb_in->signal) && (!strcmp(eb->signal, eb_in->signal))) || - ((!eb->signal) && (!eb_in->signal))) && - (((eb->source) && (eb_in->source) && (!strcmp(eb->source, eb_in->source))) || - ((!eb->source) && (!eb_in->source))) && - (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || - ((!eb->action) && (!eb_in->action))) && - (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || - ((!eb->params) && (!eb_in->params)))) - return eb; + if ((eb->context == eb_in->context) && + (eb->modifiers == eb_in->modifiers) && + (eb->any_mod == eb_in->any_mod) && + (((eb->signal) && (eb_in->signal) && (!strcmp(eb->signal, eb_in->signal))) || + ((!eb->signal) && (!eb_in->signal))) && + (((eb->source) && (eb_in->source) && (!strcmp(eb->source, eb_in->source))) || + ((!eb->source) && (!eb_in->source))) && + (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) + return eb; } return NULL; } @@ -1850,16 +1850,16 @@ e_config_binding_wheel_match(E_Config_Binding_Wheel *eb_in) EINA_LIST_FOREACH(e_config->wheel_bindings, l, eb) { - if ((eb->context == eb_in->context) && - (eb->direction == eb_in->direction) && - (eb->z == eb_in->z) && - (eb->modifiers == eb_in->modifiers) && - (eb->any_mod == eb_in->any_mod) && - (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || - ((!eb->action) && (!eb_in->action))) && - (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || - ((!eb->params) && (!eb_in->params)))) - return eb; + if ((eb->context == eb_in->context) && + (eb->direction == eb_in->direction) && + (eb->z == eb_in->z) && + (eb->modifiers == eb_in->modifiers) && + (eb->any_mod == eb_in->any_mod) && + (((eb->action) && (eb_in->action) && (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) + return eb; } return NULL; } @@ -1872,16 +1872,16 @@ e_config_binding_acpi_match(E_Config_Binding_Acpi *eb_in) EINA_LIST_FOREACH(e_config->acpi_bindings, l, eb) { - if ((eb->context == eb_in->context) && - (eb->type == eb_in->type) && - (eb->status == eb_in->status) && - (((eb->action) && (eb_in->action) && - (!strcmp(eb->action, eb_in->action))) || - ((!eb->action) && (!eb_in->action))) && - (((eb->params) && (eb_in->params) && - (!strcmp(eb->params, eb_in->params))) || - ((!eb->params) && (!eb_in->params)))) - return eb; + if ((eb->context == eb_in->context) && + (eb->type == eb_in->type) && + (eb->status == eb_in->status) && + (((eb->action) && (eb_in->action) && + (!strcmp(eb->action, eb_in->action))) || + ((!eb->action) && (!eb_in->action))) && + (((eb->params) && (eb_in->params) && + (!strcmp(eb->params, eb_in->params))) || + ((!eb->params) && (!eb_in->params)))) + return eb; } return NULL; } @@ -2087,9 +2087,9 @@ _e_config_free(E_Config *ecf) if (sca->icon) eina_stringshare_del(sca->icon); E_FREE(sca); } - if(ecf->randr_serialized_setup) + if (ecf->randr_serialized_setup) { - e_randr_serialized_setup_free(ecf->randr_serialized_setup); + e_randr_serialized_setup_free(ecf->randr_serialized_setup); } EINA_LIST_FREE(ecf->env_vars, evr) { @@ -2107,14 +2107,14 @@ _e_config_free(E_Config *ecf) E_FREE(ecf); } - static Eina_Bool +static Eina_Bool _e_config_cb_timer(void *data) { e_util_dialog_show(_("Settings Upgraded"), "%s", (char *)data); return 0; } - static int +static int _e_config_eet_close_handle(Eet_File *ef, char *file) { Eet_Error err; @@ -2124,85 +2124,104 @@ _e_config_eet_close_handle(Eet_File *ef, char *file) switch (err) { case EET_ERROR_NONE: - /* all good - no error */ - break; - case EET_ERROR_BAD_OBJECT: - erstr = _("The EET file handle is bad."); - break; - case EET_ERROR_EMPTY: - erstr = _("The file data is empty."); - break; - case EET_ERROR_NOT_WRITABLE: - erstr = _("The file is not writable. Perhaps the disk is read-only
or you lost permissions to your files."); - break; - case EET_ERROR_OUT_OF_MEMORY: - erstr = _("Memory ran out while preparing the write.
Please free up memory."); - break; - case EET_ERROR_WRITE_ERROR: - erstr = _("This is a generic error."); + /* all good - no error */ break; + + case EET_ERROR_BAD_OBJECT: + erstr = _("The EET file handle is bad."); + break; + + case EET_ERROR_EMPTY: + erstr = _("The file data is empty."); + break; + + case EET_ERROR_NOT_WRITABLE: + erstr = _("The file is not writable. Perhaps the disk is read-only
or you lost permissions to your files."); + break; + + case EET_ERROR_OUT_OF_MEMORY: + erstr = _("Memory ran out while preparing the write.
Please free up memory."); + break; + + case EET_ERROR_WRITE_ERROR: + erstr = _("This is a generic error."); + break; + case EET_ERROR_WRITE_ERROR_FILE_TOO_BIG: - erstr = _("The settings file is too large.
It should be very small (a few hundred KB at most)."); - break; + erstr = _("The settings file is too large.
It should be very small (a few hundred KB at most)."); + break; + case EET_ERROR_WRITE_ERROR_IO_ERROR: - erstr = _("You have I/O errors on the disk.
Maybe it needs replacing?"); - break; + erstr = _("You have I/O errors on the disk.
Maybe it needs replacing?"); + break; + case EET_ERROR_WRITE_ERROR_OUT_OF_SPACE: - erstr = _("You ran out of space while writing the file"); - break; + erstr = _("You ran out of space while writing the file"); + break; + case EET_ERROR_WRITE_ERROR_FILE_CLOSED: - erstr = _("The file was closed on it while writing."); - break; + erstr = _("The file was closed on it while writing."); + break; + case EET_ERROR_MMAP_FAILED: - erstr = _("Memory-mapping (mmap) of the file failed."); - break; + erstr = _("Memory-mapping (mmap) of the file failed."); + break; + case EET_ERROR_X509_ENCODING_FAILED: - erstr = _("X509 Encoding failed."); - break; + erstr = _("X509 Encoding failed."); + break; + case EET_ERROR_SIGNATURE_FAILED: - erstr = _("Signature failed."); - break; + erstr = _("Signature failed."); + break; + case EET_ERROR_INVALID_SIGNATURE: erstr = _("The signature was invalid."); - break; + break; + case EET_ERROR_NOT_SIGNED: - erstr = _("Not signed."); - break; + erstr = _("Not signed."); + break; + case EET_ERROR_NOT_IMPLEMENTED: - erstr = _("Feature not implemented."); - break; + erstr = _("Feature not implemented."); + break; + case EET_ERROR_PRNG_NOT_SEEDED: - erstr = _("PRNG was not seeded."); - break; + erstr = _("PRNG was not seeded."); + break; + case EET_ERROR_ENCRYPT_FAILED: - erstr = _("Encryption failed."); - break; + erstr = _("Encryption failed."); + break; + case EET_ERROR_DECRYPT_FAILED: - erstr = _("Decryption failed."); - break; + erstr = _("Decryption failed."); + break; + default: /* if we get here eet added errors we don't know */ - erstr = _("The error is unknown to Enlightenment."); - break; + erstr = _("The error is unknown to Enlightenment."); + break; } if (erstr) { - /* delete any partially-written file */ - ecore_file_unlink(file); + /* delete any partially-written file */ + ecore_file_unlink(file); /* only show dialog for first error - further ones are likely */ /* more of the same error */ - if (!_e_config_error_dialog) - { + if (!_e_config_error_dialog) + { E_Dialog *dia; - dia = e_dialog_new(e_container_current_get(e_manager_current_get()), + dia = e_dialog_new(e_container_current_get(e_manager_current_get()), "E", "_sys_error_logout_slow"); - if (dia) - { - char buf[8192]; + if (dia) + { + char buf[8192]; - e_dialog_title_set(dia, _("Enlightenment Settings Write Problems")); - e_dialog_icon_set(dia, "dialog-error", 64); - snprintf(buf, sizeof(buf), + e_dialog_title_set(dia, _("Enlightenment Settings Write Problems")); + e_dialog_icon_set(dia, "dialog-error", 64); + snprintf(buf, sizeof(buf), _("Enlightenment has had an error while writing
" "its config file.
" "%s
" @@ -2212,17 +2231,17 @@ _e_config_eet_close_handle(Eet_File *ef, char *file) "
" "This file has been deleted to avoid corrupt data.
"), erstr, file); - e_dialog_text_set(dia, buf); - e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL); - e_dialog_button_focus_num(dia, 0); - e_win_centered_set(dia->win, 1); - e_object_del_attach_func_set(E_OBJECT(dia), + e_dialog_text_set(dia, buf); + e_dialog_button_add(dia, _("OK"), NULL, NULL, NULL); + e_dialog_button_focus_num(dia, 0); + e_win_centered_set(dia->win, 1); + e_object_del_attach_func_set(E_OBJECT(dia), _e_config_error_dialog_cb_delete); - e_dialog_show(dia); - _e_config_error_dialog = dia; - } - } - return 0; + e_dialog_show(dia); + _e_config_error_dialog = dia; + } + } + return 0; } return 1; } @@ -2272,3 +2291,4 @@ _e_config_acpi_bindings_add(void) binding->params = eina_stringshare_add("now"); e_config->acpi_bindings = eina_list_append(e_config->acpi_bindings, binding); } +