@@ -311,6 +311,54 @@ gimp_config_path_expand (const gchar *path,
311
311
return gimp_config_path_expand_only (path , error );
312
312
}
313
313
314
+ /**
315
+ * gimp_config_path_expand_to_files:
316
+ * @path: a NUL-terminated string in UTF-8 encoding
317
+ * @error: return location for errors
318
+ *
319
+ * Paths as stored in the gimprc have to be treated special. The
320
+ * string may contain special identifiers such as for example
321
+ * ${gimp_dir} that have to be substituted before use. Also the user's
322
+ * filesystem may be in a different encoding than UTF-8 (which is what
323
+ * is used for the gimprc).
324
+ *
325
+ * This function runs @path through gimp_config_path_expand() and
326
+ * gimp_path_parse(), then turns the filenames returned by gimp_path_parse()
327
+ * into GFile using g_file_new_for_path().
328
+ *
329
+ * Return value: a #GList of newly allocated #GFile objects.
330
+ *
331
+ * Since: GIMP 2.10
332
+ **/
333
+ GList *
334
+ gimp_config_path_expand_to_files (const gchar * path ,
335
+ GError * * error )
336
+ {
337
+ GList * files ;
338
+ GList * list ;
339
+ gchar * expanded ;
340
+
341
+ g_return_val_if_fail (path != NULL , NULL );
342
+ g_return_val_if_fail (error == NULL || * error == NULL , NULL );
343
+
344
+ expanded = gimp_config_path_expand (path , TRUE, error );
345
+
346
+ if (! expanded )
347
+ return NULL ;
348
+
349
+ files = gimp_path_parse (expanded , 256 , FALSE, NULL );
350
+
351
+ for (list = files ; list ; list = g_list_next (list ))
352
+ {
353
+ gchar * dir = list -> data ;
354
+
355
+ list -> data = g_file_new_for_path (dir );
356
+ g_free (dir );
357
+ }
358
+
359
+ return files ;
360
+ }
361
+
314
362
315
363
#define SUBSTS_ALLOC 4
316
364
0 commit comments