Removed mc_main_error_quark() function

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2011-02-10 15:32:38 +02:00
parent 4005b7924e
commit 746653fda2
5 changed files with 10 additions and 24 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -141,7 +141,7 @@
#include <assert.h>
#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

View File

@ -26,7 +26,7 @@
#include <errno.h> /* 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;
}

View File

@ -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)
{