mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 17:33:25 +00:00
libgimp: remove underscores from the procedure conifig load/save functions
They are needed by GimpProcedureDialog wich is in libgimp. Keep them in the private header anyway for now.
This commit is contained in:
parent
b6b77feae2
commit
e1a9b9242e
5 changed files with 75 additions and 38 deletions
|
@ -687,6 +687,12 @@ EXPORTS
|
||||||
gimp_procedure_config_get_procedure
|
gimp_procedure_config_get_procedure
|
||||||
gimp_procedure_config_get_type
|
gimp_procedure_config_get_type
|
||||||
gimp_procedure_config_get_values
|
gimp_procedure_config_get_values
|
||||||
|
gimp_procedure_config_load_default
|
||||||
|
gimp_procedure_config_load_last
|
||||||
|
gimp_procedure_config_load_parasite
|
||||||
|
gimp_procedure_config_save_default
|
||||||
|
gimp_procedure_config_save_last
|
||||||
|
gimp_procedure_config_save_parasite
|
||||||
gimp_procedure_config_set_values
|
gimp_procedure_config_set_values
|
||||||
gimp_procedure_create_config
|
gimp_procedure_create_config
|
||||||
gimp_procedure_extension_ready
|
gimp_procedure_extension_ready
|
||||||
|
|
|
@ -1587,7 +1587,7 @@ gimp_procedure_run (GimpProcedure *procedure,
|
||||||
|
|
||||||
/* if saved defaults exist, they override GParamSpec */
|
/* if saved defaults exist, they override GParamSpec */
|
||||||
config = gimp_procedure_create_config (procedure);
|
config = gimp_procedure_create_config (procedure);
|
||||||
if (_gimp_procedure_config_load_default (config, NULL))
|
if (gimp_procedure_config_load_default (config, NULL))
|
||||||
config_class = G_OBJECT_GET_CLASS (config);
|
config_class = G_OBJECT_GET_CLASS (config);
|
||||||
else
|
else
|
||||||
g_clear_object (&config);
|
g_clear_object (&config);
|
||||||
|
|
|
@ -23,21 +23,22 @@
|
||||||
#define __GIMP_PROCEDURE_CONFIG_PRIVATE_H__
|
#define __GIMP_PROCEDURE_CONFIG_PRIVATE_H__
|
||||||
|
|
||||||
|
|
||||||
gboolean _gimp_procedure_config_load_default (GimpProcedureConfig *config,
|
gboolean gimp_procedure_config_load_default (GimpProcedureConfig *config,
|
||||||
GError **error);
|
GError **error);
|
||||||
gboolean _gimp_procedure_config_save_default (GimpProcedureConfig *config,
|
gboolean gimp_procedure_config_save_default (GimpProcedureConfig *config,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
gboolean _gimp_procedure_config_load_last (GimpProcedureConfig *config,
|
gboolean gimp_procedure_config_load_last (GimpProcedureConfig *config,
|
||||||
GError **error);
|
GError **error);
|
||||||
gboolean _gimp_procedure_config_save_last (GimpProcedureConfig *config,
|
gboolean gimp_procedure_config_save_last (GimpProcedureConfig *config,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
gboolean _gimp_procedure_config_load_parasite (GimpProcedureConfig *config,
|
gboolean gimp_procedure_config_load_parasite (GimpProcedureConfig *config,
|
||||||
GimpImage *image,
|
GimpImage *image,
|
||||||
GError **error);
|
GError **error);
|
||||||
gboolean _gimp_procedure_config_save_parasite (GimpProcedureConfig *config,
|
gboolean gimp_procedure_config_save_parasite (GimpProcedureConfig *config,
|
||||||
GimpImage *image);
|
GimpImage *image,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_PROCEDURE_CONFIG_PRIVATE_H__ */
|
#endif /* __GIMP_PROCEDURE_CONFIG_PRIVATE_H__ */
|
||||||
|
|
|
@ -342,8 +342,8 @@ gimp_procedure_config_begin_run (GimpProcedureConfig *config,
|
||||||
case GIMP_RUN_WITH_LAST_VALS:
|
case GIMP_RUN_WITH_LAST_VALS:
|
||||||
if (image)
|
if (image)
|
||||||
{
|
{
|
||||||
loaded = _gimp_procedure_config_load_parasite (config, image,
|
loaded = gimp_procedure_config_load_parasite (config, image,
|
||||||
&error);
|
&error);
|
||||||
if (! loaded && error)
|
if (! loaded && error)
|
||||||
{
|
{
|
||||||
g_printerr ("Loading last used values from parasite failed: %s\n",
|
g_printerr ("Loading last used values from parasite failed: %s\n",
|
||||||
|
@ -353,7 +353,7 @@ gimp_procedure_config_begin_run (GimpProcedureConfig *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! loaded &&
|
if (! loaded &&
|
||||||
! _gimp_procedure_config_load_last (config, &error) && error)
|
! gimp_procedure_config_load_last (config, &error) && error)
|
||||||
{
|
{
|
||||||
g_printerr ("Loading last used values from disk failed: %s\n",
|
g_printerr ("Loading last used values from disk failed: %s\n",
|
||||||
error->message);
|
error->message);
|
||||||
|
@ -406,9 +406,10 @@ gimp_procedure_config_end_run (GimpProcedureConfig *config,
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (config->priv->image)
|
if (config->priv->image)
|
||||||
_gimp_procedure_config_save_parasite (config, config->priv->image);
|
gimp_procedure_config_save_parasite (config, config->priv->image,
|
||||||
|
NULL);
|
||||||
|
|
||||||
if (! _gimp_procedure_config_save_last (config, &error))
|
if (! gimp_procedure_config_save_last (config, &error))
|
||||||
{
|
{
|
||||||
g_printerr ("Saving last used values to disk failed: %s\n",
|
g_printerr ("Saving last used values to disk failed: %s\n",
|
||||||
error->message);
|
error->message);
|
||||||
|
@ -438,12 +439,17 @@ gimp_procedure_config_get_file (GimpProcedureConfig *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_gimp_procedure_config_load_default (GimpProcedureConfig *config,
|
gimp_procedure_config_load_default (GimpProcedureConfig *config,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GFile *file = gimp_procedure_config_get_file (config, ".default");
|
GFile *file;
|
||||||
gboolean success;
|
gboolean success;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GIMP_IS_PROCEDURE_CONFIG (config), FALSE);
|
||||||
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
|
file = gimp_procedure_config_get_file (config, ".default");
|
||||||
|
|
||||||
success = gimp_config_deserialize_file (GIMP_CONFIG (config),
|
success = gimp_config_deserialize_file (GIMP_CONFIG (config),
|
||||||
file,
|
file,
|
||||||
NULL, error);
|
NULL, error);
|
||||||
|
@ -459,12 +465,17 @@ _gimp_procedure_config_load_default (GimpProcedureConfig *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_gimp_procedure_config_save_default (GimpProcedureConfig *config,
|
gimp_procedure_config_save_default (GimpProcedureConfig *config,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GFile *file = gimp_procedure_config_get_file (config, ".default");
|
GFile *file;
|
||||||
gboolean success;
|
gboolean success;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GIMP_IS_PROCEDURE_CONFIG (config), FALSE);
|
||||||
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
|
file = gimp_procedure_config_get_file (config, ".default");
|
||||||
|
|
||||||
success = gimp_config_serialize_to_file (GIMP_CONFIG (config),
|
success = gimp_config_serialize_to_file (GIMP_CONFIG (config),
|
||||||
file,
|
file,
|
||||||
"settings",
|
"settings",
|
||||||
|
@ -477,12 +488,17 @@ _gimp_procedure_config_save_default (GimpProcedureConfig *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_gimp_procedure_config_load_last (GimpProcedureConfig *config,
|
gimp_procedure_config_load_last (GimpProcedureConfig *config,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GFile *file = gimp_procedure_config_get_file (config, ".last");
|
GFile *file;
|
||||||
gboolean success;
|
gboolean success;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GIMP_IS_PROCEDURE_CONFIG (config), FALSE);
|
||||||
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
|
file = gimp_procedure_config_get_file (config, ".last");
|
||||||
|
|
||||||
success = gimp_config_deserialize_file (GIMP_CONFIG (config),
|
success = gimp_config_deserialize_file (GIMP_CONFIG (config),
|
||||||
file,
|
file,
|
||||||
NULL, error);
|
NULL, error);
|
||||||
|
@ -498,12 +514,17 @@ _gimp_procedure_config_load_last (GimpProcedureConfig *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_gimp_procedure_config_save_last (GimpProcedureConfig *config,
|
gimp_procedure_config_save_last (GimpProcedureConfig *config,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
GFile *file = gimp_procedure_config_get_file (config, ".last");
|
GFile *file;
|
||||||
gboolean success;
|
gboolean success;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GIMP_IS_PROCEDURE_CONFIG (config), FALSE);
|
||||||
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
|
file = gimp_procedure_config_get_file (config, ".last");
|
||||||
|
|
||||||
success = gimp_config_serialize_to_file (GIMP_CONFIG (config),
|
success = gimp_config_serialize_to_file (GIMP_CONFIG (config),
|
||||||
file,
|
file,
|
||||||
"settings",
|
"settings",
|
||||||
|
@ -523,14 +544,18 @@ gimp_procedure_config_parasite_name (GimpProcedureConfig *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_gimp_procedure_config_load_parasite (GimpProcedureConfig *config,
|
gimp_procedure_config_load_parasite (GimpProcedureConfig *config,
|
||||||
GimpImage *image,
|
GimpImage *image,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gchar *name;
|
gchar *name;
|
||||||
GimpParasite *parasite;
|
GimpParasite *parasite;
|
||||||
gboolean success;
|
gboolean success;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GIMP_IS_PROCEDURE_CONFIG (config), FALSE);
|
||||||
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
name = gimp_procedure_config_parasite_name (config, "-last");
|
name = gimp_procedure_config_parasite_name (config, "-last");
|
||||||
parasite = gimp_image_get_parasite (image, name);
|
parasite = gimp_image_get_parasite (image, name);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
|
@ -547,12 +572,17 @@ _gimp_procedure_config_load_parasite (GimpProcedureConfig *config,
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
_gimp_procedure_config_save_parasite (GimpProcedureConfig *config,
|
gimp_procedure_config_save_parasite (GimpProcedureConfig *config,
|
||||||
GimpImage *image)
|
GimpImage *image,
|
||||||
|
GError **error)
|
||||||
{
|
{
|
||||||
gchar *name;
|
gchar *name;
|
||||||
GimpParasite *parasite;
|
GimpParasite *parasite;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GIMP_IS_PROCEDURE_CONFIG (config), FALSE);
|
||||||
|
g_return_val_if_fail (GIMP_IS_IMAGE (image), FALSE);
|
||||||
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
name = gimp_procedure_config_parasite_name (config, "-last");
|
name = gimp_procedure_config_parasite_name (config, "-last");
|
||||||
parasite = gimp_config_serialize_to_parasite (GIMP_CONFIG (config),
|
parasite = gimp_config_serialize_to_parasite (GIMP_CONFIG (config),
|
||||||
name,
|
name,
|
||||||
|
|
|
@ -348,7 +348,7 @@ gimp_procedure_dialog_load_defaults (GtkWidget *button,
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (! _gimp_procedure_config_load_default (dialog->priv->config, &error))
|
if (! gimp_procedure_config_load_default (dialog->priv->config, &error))
|
||||||
{
|
{
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
|
@ -369,7 +369,7 @@ gimp_procedure_dialog_save_defaults (GtkWidget *button,
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (! _gimp_procedure_config_save_default (dialog->priv->config, &error))
|
if (! gimp_procedure_config_save_default (dialog->priv->config, &error))
|
||||||
{
|
{
|
||||||
g_printerr ("Saving default values to disk failed: %s\n",
|
g_printerr ("Saving default values to disk failed: %s\n",
|
||||||
error->message);
|
error->message);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue