diff --git a/lib/event/event.c b/lib/event/event.c index f91967e72..305ed0117 100644 --- a/lib/event/event.c +++ b/lib/event/event.c @@ -53,7 +53,7 @@ mc_event_init (GError ** mcerror) if (mc_event_grouplist != NULL) { g_propagate_error (mcerror, - g_error_new (mc_main_error_quark (), 1, + g_error_new (MC_ERROR, 1, _("Event system already initialized"))); return FALSE; } @@ -65,7 +65,7 @@ mc_event_init (GError ** mcerror) if (mc_event_grouplist == NULL) { g_propagate_error (mcerror, - g_error_new (mc_main_error_quark (), 2, + g_error_new (MC_ERROR, 2, _("Failed to initialize event system"))); return FALSE; } @@ -81,7 +81,7 @@ mc_event_deinit (GError ** mcerror) if (mc_event_grouplist == NULL) { g_propagate_error (mcerror, - g_error_new (mc_main_error_quark (), 1, + g_error_new (MC_ERROR, 1, _("Event system not initialized"))); return FALSE; } diff --git a/lib/event/manage.c b/lib/event/manage.c index f5e9c3f8e..9e9ba628f 100644 --- a/lib/event/manage.c +++ b/lib/event/manage.c @@ -73,7 +73,7 @@ mc_event_add (const gchar * event_group_name, const gchar * event_name, || event_callback == NULL) { g_propagate_error (mcerror, - g_error_new (mc_main_error_quark (), 1, + g_error_new (MC_ERROR, 1, _("Check input data! Some of parameters are NULL!"))); return FALSE; } @@ -171,7 +171,7 @@ mc_event_get_event_group_by_name (const gchar * event_group_name, gboolean creat if (event_group == NULL) { g_propagate_error (mcerror, - g_error_new (mc_main_error_quark (), 1, + g_error_new (MC_ERROR, 1, _("Unable to create group '%s' for events!"), event_group_name)); return NULL; @@ -196,7 +196,7 @@ mc_event_get_event_by_name (GTree * event_group, const gchar * event_name, gbool if (callbacks == NULL) { g_propagate_error (mcerror, - g_error_new (mc_main_error_quark (), 1, + g_error_new (MC_ERROR, 1, _("Unable to create event '%s'!"), event_name)); return NULL; } diff --git a/lib/global.h b/lib/global.h index aafe28715..f86f0eadf 100644 --- a/lib/global.h +++ b/lib/global.h @@ -141,7 +141,7 @@ #include #endif -#define MC_ERROR mc_main_error_quark () +#define MC_ERROR g_quark_from_static_string (PACKAGE) /*** enums ***************************************************************************************/ @@ -268,7 +268,6 @@ extern mc_global_t mc_global; /*** declarations of public functions ************************************************************/ void refresh_screen (void *); -GQuark mc_main_error_quark (void); /*** inline functions ****************************************************************************/ #endif diff --git a/lib/mcconfig/common.c b/lib/mcconfig/common.c index 893a2ab02..64f4d978c 100644 --- a/lib/mcconfig/common.c +++ b/lib/mcconfig/common.c @@ -26,7 +26,7 @@ #include /* extern int errno */ #include "lib/global.h" -#include "lib/vfs/vfs.h" /* mc_stat */ +#include "lib/vfs/vfs.h" /* mc_stat */ #include "lib/util.h" #include "lib/mcconfig.h" @@ -65,9 +65,7 @@ mc_config_new_or_override_file (mc_config_t * mc_config, const gchar * ini_path, fd = mc_open (ini_path, O_WRONLY | O_TRUNC | O_SYNC, 0); if (fd == -1) { - g_propagate_error (error, - g_error_new (mc_main_error_quark (), 0, "%s", - unix_error_string (errno))); + g_propagate_error (error, g_error_new (MC_ERROR, 0, "%s", unix_error_string (errno))); g_free (data); return FALSE; } @@ -81,9 +79,7 @@ mc_config_new_or_override_file (mc_config_t * mc_config, const gchar * ini_path, if (cur_written == -1) { mc_util_restore_from_backup_if_possible (ini_path, "~"); - g_propagate_error (error, - g_error_new (mc_main_error_quark (), 0, "%s", - unix_error_string (errno))); + g_propagate_error (error, g_error_new (MC_ERROR, 0, "%s", unix_error_string (errno))); return FALSE; } diff --git a/src/main.c b/src/main.c index aa74562f8..a69607e28 100644 --- a/src/main.c +++ b/src/main.c @@ -268,15 +268,6 @@ init_sigchld (void) /*** public functions ****************************************************************************/ /* --------------------------------------------------------------------------------------------- */ -/** Define this function for glib-style error handling */ -GQuark -mc_main_error_quark (void) -{ - return g_quark_from_static_string (PACKAGE); -} - -/* --------------------------------------------------------------------------------------------- */ - int do_cd (const char *new_dir, enum cd_enum exact) {