mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 09:53:25 +00:00
pdb, libgimp: change "filename" to "file" in gimp_pdb_dump()
This commit is contained in:
parent
6468fa06c7
commit
14af676b51
5 changed files with 21 additions and 32 deletions
|
@ -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);
|
||||
|
||||
if (file)
|
||||
success = gimp_pdb_dump (gimp->pdb, file, error);
|
||||
|
||||
g_object_unref (file);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
return gimp_procedure_get_return_values (procedure, success,
|
||||
|
@ -1212,11 +1211,10 @@ register_pdb_procs (GimpPDB *pdb)
|
|||
"Spencer Kimball & Josh MacDonald & Peter Mattis",
|
||||
"1995-1996");
|
||||
gimp_procedure_add_argument (procedure,
|
||||
gimp_param_spec_string ("filename",
|
||||
"filename",
|
||||
g_param_spec_object ("file",
|
||||
"file",
|
||||
"The dump filename",
|
||||
TRUE, FALSE, TRUE,
|
||||
NULL,
|
||||
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);
|
||||
|
||||
if (file)
|
||||
success = gimp_pdb_dump (gimp->pdb, file, error);
|
||||
|
||||
g_object_unref (file);
|
||||
else
|
||||
success = FALSE;
|
||||
}
|
||||
CODE
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue