Bug 698278 - Preferences|Reset ignores /etc/gimp/2.0/gimprc
Make gimp_rc_load() public as gimp_rc_load_system() and gimp_rc_load_user() and call gimp_rc_load_system() from the preferences dialog's reset code.
This commit is contained in:
@ -62,7 +62,6 @@ static void gimp_rc_get_property (GObject *object,
|
|||||||
GParamSpec *pspec);
|
GParamSpec *pspec);
|
||||||
|
|
||||||
static GimpConfig * gimp_rc_duplicate (GimpConfig *object);
|
static GimpConfig * gimp_rc_duplicate (GimpConfig *object);
|
||||||
static void gimp_rc_load (GimpRc *rc);
|
|
||||||
static gboolean gimp_rc_idle_save (GimpRc *rc);
|
static gboolean gimp_rc_idle_save (GimpRc *rc);
|
||||||
static void gimp_rc_notify (GimpRc *rc,
|
static void gimp_rc_notify (GimpRc *rc,
|
||||||
GParamSpec *param,
|
GParamSpec *param,
|
||||||
@ -251,44 +250,6 @@ gimp_rc_duplicate (GimpConfig *config)
|
|||||||
return dup;
|
return dup;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gimp_rc_load (GimpRc *rc)
|
|
||||||
{
|
|
||||||
GError *error = NULL;
|
|
||||||
|
|
||||||
g_return_if_fail (GIMP_IS_RC (rc));
|
|
||||||
|
|
||||||
if (rc->verbose)
|
|
||||||
g_print ("Parsing '%s'\n",
|
|
||||||
gimp_file_get_utf8_name (rc->system_gimprc));
|
|
||||||
|
|
||||||
if (! gimp_config_deserialize_gfile (GIMP_CONFIG (rc),
|
|
||||||
rc->system_gimprc, NULL, &error))
|
|
||||||
{
|
|
||||||
if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT)
|
|
||||||
g_message ("%s", error->message);
|
|
||||||
|
|
||||||
g_clear_error (&error);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rc->verbose)
|
|
||||||
g_print ("Parsing '%s'\n",
|
|
||||||
gimp_file_get_utf8_name (rc->user_gimprc));
|
|
||||||
|
|
||||||
if (! gimp_config_deserialize_gfile (GIMP_CONFIG (rc),
|
|
||||||
rc->user_gimprc, NULL, &error))
|
|
||||||
{
|
|
||||||
if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT)
|
|
||||||
{
|
|
||||||
g_message ("%s", error->message);
|
|
||||||
|
|
||||||
gimp_config_file_backup_on_error (rc->user_gimprc, "gimprc", NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
g_clear_error (&error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gimp_rc_idle_save (GimpRc *rc)
|
gimp_rc_idle_save (GimpRc *rc)
|
||||||
{
|
{
|
||||||
@ -346,11 +307,58 @@ gimp_rc_new (GObject *gimp,
|
|||||||
"user-gimprc", user_gimprc,
|
"user-gimprc", user_gimprc,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gimp_rc_load (rc);
|
gimp_rc_load_system (rc);
|
||||||
|
gimp_rc_load_user (rc);
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_rc_load_system (GimpRc *rc)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
g_return_if_fail (GIMP_IS_RC (rc));
|
||||||
|
|
||||||
|
if (rc->verbose)
|
||||||
|
g_print ("Parsing '%s'\n",
|
||||||
|
gimp_file_get_utf8_name (rc->system_gimprc));
|
||||||
|
|
||||||
|
if (! gimp_config_deserialize_gfile (GIMP_CONFIG (rc),
|
||||||
|
rc->system_gimprc, NULL, &error))
|
||||||
|
{
|
||||||
|
if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT)
|
||||||
|
g_message ("%s", error->message);
|
||||||
|
|
||||||
|
g_clear_error (&error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gimp_rc_load_user (GimpRc *rc)
|
||||||
|
{
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
g_return_if_fail (GIMP_IS_RC (rc));
|
||||||
|
|
||||||
|
if (rc->verbose)
|
||||||
|
g_print ("Parsing '%s'\n",
|
||||||
|
gimp_file_get_utf8_name (rc->user_gimprc));
|
||||||
|
|
||||||
|
if (! gimp_config_deserialize_gfile (GIMP_CONFIG (rc),
|
||||||
|
rc->user_gimprc, NULL, &error))
|
||||||
|
{
|
||||||
|
if (error->code != GIMP_CONFIG_ERROR_OPEN_ENOENT)
|
||||||
|
{
|
||||||
|
g_message ("%s", error->message);
|
||||||
|
|
||||||
|
gimp_config_file_backup_on_error (rc->user_gimprc, "gimprc", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_clear_error (&error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_rc_set_autosave (GimpRc *rc,
|
gimp_rc_set_autosave (GimpRc *rc,
|
||||||
gboolean autosave)
|
gboolean autosave)
|
||||||
|
|||||||
@ -51,16 +51,22 @@ struct _GimpRcClass
|
|||||||
|
|
||||||
|
|
||||||
GType gimp_rc_get_type (void) G_GNUC_CONST;
|
GType gimp_rc_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GimpRc * gimp_rc_new (GObject *gimp,
|
GimpRc * gimp_rc_new (GObject *gimp,
|
||||||
GFile *system_gimprc,
|
GFile *system_gimprc,
|
||||||
GFile *user_gimprc,
|
GFile *user_gimprc,
|
||||||
gboolean verbose);
|
gboolean verbose);
|
||||||
|
|
||||||
void gimp_rc_set_autosave (GimpRc *gimprc,
|
void gimp_rc_load_system (GimpRc *rc);
|
||||||
|
void gimp_rc_load_user (GimpRc *rc);
|
||||||
|
|
||||||
|
void gimp_rc_set_autosave (GimpRc *rc,
|
||||||
gboolean autosave);
|
gboolean autosave);
|
||||||
void gimp_rc_save (GimpRc *gimprc);
|
void gimp_rc_save (GimpRc *rc);
|
||||||
|
|
||||||
gchar * gimp_rc_query (GimpRc *rc,
|
gchar * gimp_rc_query (GimpRc *rc,
|
||||||
const gchar *key);
|
const gchar *key);
|
||||||
|
|
||||||
void gimp_rc_set_unknown_token (GimpRc *rc,
|
void gimp_rc_set_unknown_token (GimpRc *rc,
|
||||||
const gchar *token,
|
const gchar *token,
|
||||||
const gchar *value);
|
const gchar *value);
|
||||||
|
|||||||
@ -294,6 +294,7 @@ prefs_response (GtkWidget *widget,
|
|||||||
config_copy = g_object_get_data (G_OBJECT (dialog), "config-copy");
|
config_copy = g_object_get_data (G_OBJECT (dialog), "config-copy");
|
||||||
|
|
||||||
gimp_config_reset (config_copy);
|
gimp_config_reset (config_copy);
|
||||||
|
gimp_rc_load_system (GIMP_RC (config_copy));
|
||||||
|
|
||||||
/* don't use the default value if there is no help browser */
|
/* don't use the default value if there is no help browser */
|
||||||
if (! gimp_help_browser_is_installed (gimp))
|
if (! gimp_help_browser_is_installed (gimp))
|
||||||
|
|||||||
Reference in New Issue
Block a user