Commit 6de4af4a authored by Michael Natterer's avatar Michael Natterer 😴

pdb: change paths and URIs in the "plug_in" group to GFiles

parent 2fa9b8f0
Pipeline #114162 passed with stages
in 12 minutes and 54 seconds
......@@ -433,7 +433,7 @@ register_image_color_profile_procs (GimpPDB *pdb)
"gimp-image-set-color-profile-from-file");
gimp_procedure_set_static_help (procedure,
"Sets the image's color profile from an ICC file",
"This procedure sets the image's color profile from a file containing an ICC profile, or unsets it if NULL is passed as 'uri'. This procedure does no color conversion. However, it will change the pixel format of all layers to contain the babl space matching the profile. You must call this procedure before adding layers to the image.",
"This procedure sets the image's color profile from a file containing an ICC profile, or unsets it if NULL is passed as 'file'. This procedure does no color conversion. However, it will change the pixel format of all layers to contain the babl space matching the profile. You must call this procedure before adding layers to the image.",
NULL);
gimp_procedure_set_static_attribution (procedure,
"Michael Natterer <mitch@gimp.org>",
......
......@@ -102,10 +102,10 @@ plugin_domain_register_invoker (GimpProcedure *procedure,
{
gboolean success = TRUE;
const gchar *domain_name;
const gchar *domain_path;
GFile *domain_file;
domain_name = g_value_get_string (gimp_value_array_index (args, 0));
domain_path = g_value_get_string (gimp_value_array_index (args, 1));
domain_file = g_value_get_object (gimp_value_array_index (args, 1));
if (success)
{
......@@ -113,8 +113,12 @@ plugin_domain_register_invoker (GimpProcedure *procedure,
if (plug_in && plug_in->call_mode == GIMP_PLUG_IN_CALL_QUERY)
{
gchar *domain_path = domain_file ? g_file_get_path (domain_file) : NULL;
gimp_plug_in_def_set_locale_domain (plug_in->plug_in_def,
domain_name, domain_path);
g_free (domain_path);
}
else
success = FALSE;
......@@ -134,10 +138,10 @@ plugin_help_register_invoker (GimpProcedure *procedure,
{
gboolean success = TRUE;
const gchar *domain_name;
const gchar *domain_uri;
GFile *domain_file;
domain_name = g_value_get_string (gimp_value_array_index (args, 0));
domain_uri = g_value_get_string (gimp_value_array_index (args, 1));
domain_file = g_value_get_object (gimp_value_array_index (args, 1));
if (success)
{
......@@ -145,8 +149,12 @@ plugin_help_register_invoker (GimpProcedure *procedure,
if (plug_in && plug_in->call_mode == GIMP_PLUG_IN_CALL_QUERY)
{
gchar *domain_uri = domain_file ? g_file_get_uri (domain_file) : NULL;
gimp_plug_in_def_set_help_domain (plug_in->plug_in_def,
domain_name, domain_uri);
g_free (domain_uri);
}
else
success = FALSE;
......@@ -342,12 +350,11 @@ register_plug_in_procs (GimpPDB *pdb)
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("domain-path",
"domain path",
"The absolute path to the compiled message catalog (may be NULL)",
FALSE, FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE));
g_param_spec_object ("domain-file",
"domain file",
"The path to the locally installed compiled message catalog (may be NULL)",
G_TYPE_FILE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
......@@ -373,12 +380,11 @@ register_plug_in_procs (GimpPDB *pdb)
NULL,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("domain-uri",
"domain uri",
"The root URI of the plug-in's help pages",
FALSE, FALSE, FALSE,
NULL,
GIMP_PARAM_READWRITE));
g_param_spec_object ("domain-file",
"domain file",
"The root URI of the plug-in's help pages",
G_TYPE_FILE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
......
......@@ -446,13 +446,13 @@ gimp_plug_in_procedure_validate_args (GimpPlugInProcedure *proc,
GimpValueArray *args,
GError **error)
{
#if 0
GimpProcedure *procedure = GIMP_PROCEDURE (proc);
GValue *uri_value = NULL;
if (! proc->file_proc)
return TRUE;
#if 0
/* make sure that the passed strings are actually URIs, not just a
* file path (bug 758685)
*/
......
......@@ -183,7 +183,7 @@ _gimp_image_set_color_profile (GimpImage *image,
* Sets the image's color profile from an ICC file
*
* This procedure sets the image's color profile from a file containing
* an ICC profile, or unsets it if NULL is passed as 'uri'. This
* an ICC profile, or unsets it if NULL is passed as 'file'. This
* procedure does no color conversion. However, it will change the
* pixel format of all layers to contain the babl space matching the
* profile. You must call this procedure before adding layers to the
......
......@@ -921,25 +921,14 @@ gimp_plug_in_register (GimpPlugIn *plug_in,
if (plug_in->priv->translation_domain_name)
{
gchar *path = NULL;
if (plug_in->priv->translation_domain_path)
path = g_file_get_path (plug_in->priv->translation_domain_path);
_gimp_plugin_domain_register (plug_in->priv->translation_domain_name,
path);
g_free (path);
plug_in->priv->translation_domain_path);
}
if (plug_in->priv->help_domain_name)
{
gchar *uri = g_file_get_uri (plug_in->priv->help_domain_uri);
_gimp_plugin_help_register (plug_in->priv->help_domain_name,
uri);
g_free (uri);
plug_in->priv->help_domain_uri);
}
for (list = plug_in->priv->menu_branches; list; list = g_list_next (list))
......
......@@ -28,7 +28,7 @@
/**
* _gimp_plugin_domain_register:
* @domain_name: The name of the textdomain (must be unique).
* @domain_path: The absolute path to the compiled message catalog (may be NULL).
* @domain_file: The path to the locally installed compiled message catalog (may be NULL).
*
* Registers a textdomain for localisation.
*
......@@ -45,7 +45,7 @@
**/
gboolean
_gimp_plugin_domain_register (const gchar *domain_name,
const gchar *domain_path)
GFile *domain_file)
{
GimpValueArray *args;
GimpValueArray *return_vals;
......@@ -53,7 +53,7 @@ _gimp_plugin_domain_register (const gchar *domain_name,
args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, domain_name,
G_TYPE_STRING, domain_path,
G_TYPE_FILE, domain_file,
G_TYPE_NONE);
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
......@@ -71,7 +71,7 @@ _gimp_plugin_domain_register (const gchar *domain_name,
/**
* _gimp_plugin_help_register:
* @domain_name: The XML namespace of the plug-in's help pages.
* @domain_uri: The root URI of the plug-in's help pages.
* @domain_file: The root URI of the plug-in's help pages.
*
* Register a help path for a plug-in.
*
......@@ -85,7 +85,7 @@ _gimp_plugin_domain_register (const gchar *domain_name,
**/
gboolean
_gimp_plugin_help_register (const gchar *domain_name,
const gchar *domain_uri)
GFile *domain_file)
{
GimpValueArray *args;
GimpValueArray *return_vals;
......@@ -93,7 +93,7 @@ _gimp_plugin_help_register (const gchar *domain_name,
args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, domain_name,
G_TYPE_STRING, domain_uri,
G_TYPE_FILE, domain_file,
G_TYPE_NONE);
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
......
......@@ -33,9 +33,9 @@ G_BEGIN_DECLS
G_GNUC_INTERNAL gboolean _gimp_plugin_domain_register (const gchar *domain_name,
const gchar *domain_path);
GFile *domain_file);
G_GNUC_INTERNAL gboolean _gimp_plugin_help_register (const gchar *domain_name,
const gchar *domain_uri);
GFile *domain_file);
G_GNUC_INTERNAL gboolean _gimp_plugin_menu_branch_register (const gchar *menu_path,
const gchar *menu_name);
G_GNUC_INTERNAL gboolean _gimp_plugin_set_pdb_error_handler (GimpPDBErrorHandler handler);
......
......@@ -169,7 +169,7 @@ sub image_set_color_profile_from_file {
$help = <<'HELP';
This procedure sets the image's color profile from a file containing
an ICC profile, or unsets it if NULL is passed as 'uri'. This
an ICC profile, or unsets it if NULL is passed as 'file'. This
procedure does no color conversion. However, it will change the pixel
format of all layers to contain the babl space matching the
profile. You must call this procedure before adding layers to the
......
......@@ -87,9 +87,8 @@ HELP
@inargs = (
{ name => 'domain_name', type => 'string',
desc => 'The name of the textdomain (must be unique)' },
{ name => 'domain_path', type => 'string', no_validate => 1,
desc => 'The absolute path to the compiled message catalog (may be
NULL)' }
{ name => 'domain_file', type => 'file',
desc => 'The path to the locally installed compiled message catalog (may be NULL)' }
);
%invoke = (
......@@ -99,8 +98,12 @@ HELP
if (plug_in && plug_in->call_mode == GIMP_PLUG_IN_CALL_QUERY)
{
gchar *domain_path = domain_file ? g_file_get_path (domain_file) : NULL;
gimp_plug_in_def_set_locale_domain (plug_in->plug_in_def,
domain_name, domain_path);
g_free (domain_path);
}
else
success = FALSE;
......@@ -128,7 +131,7 @@ HELP
@inargs = (
{ name => 'domain_name', type => 'string',
desc => "The XML namespace of the plug-in's help pages" },
{ name => 'domain_uri', type => 'string',
{ name => 'domain_file', type => 'file',
desc => "The root URI of the plug-in's help pages" }
);
......@@ -139,8 +142,12 @@ HELP
if (plug_in && plug_in->call_mode == GIMP_PLUG_IN_CALL_QUERY)
{
gchar *domain_uri = domain_file ? g_file_get_uri (domain_file) : NULL;
gimp_plug_in_def_set_help_domain (plug_in->plug_in_def,
domain_name, domain_uri);
g_free (domain_uri);
}
else
success = FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment