diff --git a/libgimpbase/gimpbase.def b/libgimpbase/gimpbase.def index efc4f58d1a..1d3932194e 100644 --- a/libgimpbase/gimpbase.def +++ b/libgimpbase/gimpbase.def @@ -112,6 +112,7 @@ EXPORTS gimp_pdb_proc_type_get_type gimp_pdb_status_type_get_type gimp_personal_rc_file + gimp_personal_rc_gfile gimp_pixels_to_units gimp_pixpipe_params_build gimp_pixpipe_params_init diff --git a/libgimpbase/gimpenv.c b/libgimpbase/gimpenv.c index b8a9580247..9c0c040bcf 100644 --- a/libgimpbase/gimpenv.c +++ b/libgimpbase/gimpenv.c @@ -32,7 +32,7 @@ #include #endif -#include +#include #include #undef GIMP_DISABLE_DEPRECATED @@ -612,10 +612,10 @@ gimp_plug_in_directory (void) * * Returns the name of a file in the user-specific GIMP settings directory. * - * The returned string is allocated dynamically and *SHOULD* be freed - * with g_free() after use. The returned string is in the encoding - * used for filenames by GLib, which isn't necessarily - * UTF-8. (On Windows it always is UTF-8.) + * The returned string is newly allocated and should be freed with + * g_free() after use. The returned string is in the encoding used for + * filenames by GLib, which isn't necessarily UTF-8. (On Windows it + * always is UTF-8.) * * Returns: The name of a file in the user-specific GIMP settings directory. **/ @@ -625,6 +625,33 @@ gimp_personal_rc_file (const gchar *basename) return g_build_filename (gimp_directory (), basename, NULL); } +/** + * gimp_personal_rc_gfile: + * @basename: The basename of a rc_file. + * + * Returns a #GFile in the user-specific GIMP settings directory. + * + * The returned #GFile is newly allocated and should be freed with + * g_object_unref() after use. + * + * See gimp_personal_rc_file(). + * + * Since: GIMP 2.10 + * + * Returns: A #GFile in the user-specific GIMP settings directory. + **/ +GFile * +gimp_personal_rc_gfile (const gchar *basename) +{ + gchar *path = gimp_personal_rc_file (basename); + GFile *file; + + file = g_file_new_for_path (path); + g_free (path); + + return file; +} + /** * gimp_gtkrc: * diff --git a/libgimpbase/gimpenv.h b/libgimpbase/gimpenv.h index 747c560b98..12770bc319 100644 --- a/libgimpbase/gimpenv.h +++ b/libgimpbase/gimpenv.h @@ -61,6 +61,7 @@ const gchar * gimp_user_directory (GimpUserDirectory type) G_GNUC_ const gchar * gimp_gtkrc (void) G_GNUC_CONST; gchar * gimp_personal_rc_file (const gchar *basename) G_GNUC_MALLOC; +GFile * gimp_personal_rc_gfile (const gchar *basename); GList * gimp_path_parse (const gchar *path, gint max_paths,