Commit 14af676b authored by Michael Natterer's avatar Michael Natterer 😴

pdb, libgimp: change "filename" to "file" in gimp_pdb_dump()

parent 6468fa06
Pipeline #114148 passed with stages
in 16 minutes and 16 seconds
......@@ -101,17 +101,16 @@ pdb_dump_invoker (GimpProcedure *procedure,
GError **error)
{
gboolean success = TRUE;
const gchar *filename;
GFile *file;
filename = g_value_get_string (gimp_value_array_index (args, 0));
file = g_value_get_object (gimp_value_array_index (args, 0));
if (success)
{
GFile *file = g_file_new_for_path (filename);
success = gimp_pdb_dump (gimp->pdb, file, error);
g_object_unref (file);
if (file)
success = gimp_pdb_dump (gimp->pdb, file, error);
else
success = FALSE;
}
return gimp_procedure_get_return_values (procedure, success,
......@@ -1212,12 +1211,11 @@ register_pdb_procs (GimpPDB *pdb)
"Spencer Kimball & Josh MacDonald & Peter Mattis",
"1995-1996");
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("filename",
"filename",
"The dump filename",
TRUE, FALSE, TRUE,
NULL,
GIMP_PARAM_READWRITE));
g_param_spec_object ("file",
"file",
"The dump filename",
G_TYPE_FILE,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
......
......@@ -374,17 +374,10 @@ gboolean
gimp_pdb_dump_to_file (GimpPDB *pdb,
GFile *file)
{
gchar *path;
gboolean success;
g_return_val_if_fail (GIMP_IS_PDB (pdb), FALSE);
g_return_val_if_fail (G_IS_FILE (pdb), FALSE);
path = g_file_get_path (file);
success = _gimp_pdb_dump (path);
g_free (path);
return success;
return _gimp_pdb_dump (file);
}
/**
......
......@@ -61,7 +61,7 @@ _gimp_pdb_temp_name (void)
/**
* _gimp_pdb_dump:
* @filename: The dump filename.
* @file: The dump filename.
*
* Dumps the current contents of the procedural database
*
......@@ -72,14 +72,14 @@ _gimp_pdb_temp_name (void)
* Returns: TRUE on success.
**/
gboolean
_gimp_pdb_dump (const gchar *filename)
_gimp_pdb_dump (GFile *file)
{
GimpValueArray *args;
GimpValueArray *return_vals;
gboolean success = TRUE;
args = gimp_value_array_new_from_types (NULL,
G_TYPE_STRING, filename,
G_TYPE_FILE, file,
G_TYPE_NONE);
return_vals = gimp_pdb_run_procedure_array (gimp_get_pdb (),
......
......@@ -33,7 +33,7 @@ G_BEGIN_DECLS
G_GNUC_INTERNAL gchar* _gimp_pdb_temp_name (void);
G_GNUC_INTERNAL gboolean _gimp_pdb_dump (const gchar *filename);
G_GNUC_INTERNAL gboolean _gimp_pdb_dump (GFile *file);
G_GNUC_INTERNAL gboolean _gimp_pdb_query (const gchar *name,
const gchar *blurb,
const gchar *help,
......
......@@ -60,19 +60,17 @@ HELP
$lib_private = 1;
@inargs = (
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
non_empty => 1,
{ name => 'file', type => 'file',
desc => 'The dump filename' }
);
%invoke = (
code => <<'CODE'
{
GFile *file = g_file_new_for_path (filename);
success = gimp_pdb_dump (gimp->pdb, file, error);
g_object_unref (file);
if (file)
success = gimp_pdb_dump (gimp->pdb, file, error);
else
success = FALSE;
}
CODE
);
......
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