[gimp/wip/nielsdg/string-array-to-strv] plug-ins: fixing "file-glob" with the new GStrv return value.



commit 081a68e54f067e7f112f08b4b12fd5a4c4c22dfd
Author: Jehan <jehan girinstud io>
Date:   Sat Feb 12 00:25:08 2022 +0100

    plug-ins: fixing "file-glob" with the new GStrv return value.
    
    Tested with:
    
    > c = Gimp.get_pdb().lookup_procedure('file-glob').create_config()
    > c.set_property('pattern', '/home/jehan/*.png')
    > r = Gimp.get_pdb().run_procedure_config('file-glob', c)
    > r.index(1)

 plug-ins/common/file-glob.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
---
diff --git a/plug-ins/common/file-glob.c b/plug-ins/common/file-glob.c
index 5559ae2db3..b79437e89b 100644
--- a/plug-ins/common/file-glob.c
+++ b/plug-ins/common/file-glob.c
@@ -89,7 +89,7 @@ glob_query_procedures (GimpPlugIn *plug_in)
 
 static GimpProcedure *
 glob_create_procedure (GimpPlugIn  *plug_in,
-                           const gchar *name)
+                       const gchar *name)
 {
   GimpProcedure *procedure = NULL;
 
@@ -128,12 +128,6 @@ glob_create_procedure (GimpPlugIn  *plug_in,
                              FALSE,
                              G_PARAM_READWRITE);
 
-      GIMP_PROC_VAL_INT (procedure, "num-files",
-                         "Num files",
-                         "Number of returned filenames",
-                         0, G_MAXINT, 0,
-                         G_PARAM_READWRITE);
-
       GIMP_PROC_VAL_STRV (procedure, "files",
                           "Files",
                           "The list of matching filenames",
@@ -168,7 +162,7 @@ glob_run (GimpProcedure        *procedure,
                                                   GIMP_PDB_SUCCESS,
                                                   NULL);
 
-  GIMP_VALUES_TAKE_STRV (return_vals, 0, matches);
+  GIMP_VALUES_TAKE_STRV (return_vals, 1, matches);
 
   return return_vals;
 }
@@ -187,7 +181,7 @@ glob_match (const gchar   *pattern,
   g_return_val_if_fail (pattern != NULL, FALSE);
   g_return_val_if_fail (matches != NULL, FALSE);
 
-  *matches     = NULL;
+  *matches = NULL;
 
   /*  This is not a complete glob() implementation but rather a very
    *  simplistic approach. However it works for the most common use
@@ -258,7 +252,7 @@ glob_match (const gchar   *pattern,
   /* NULL-terminator */
   g_ptr_array_add (array, NULL);
 
-  *matches     = (gchar **) g_ptr_array_free (array, FALSE);
+  *matches = (gchar **) g_ptr_array_free (array, FALSE);
 
   return TRUE;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]