filenumerator: Add g_file_enumerator_iterate()

This is *significantly* more pleasant to use from C (while handling
errors and memory cleanup).

While we're here, change some ugly, leaky code in
tests/desktop-app-info.c to use it, in addition to a test case
in tests/file.c.

https://bugzilla.gnome.org/show_bug.cgi?id=661554
This commit is contained in:
Colin Walters
2015-02-12 18:20:14 -05:00
parent 9d6d30475b
commit 52cd62d946
5 changed files with 218 additions and 36 deletions

View File

@@ -139,6 +139,14 @@ GLIB_AVAILABLE_IN_2_36
GFile * g_file_enumerator_get_child (GFileEnumerator *enumerator,
GFileInfo *info);
GLIB_AVAILABLE_IN_2_44
gboolean g_file_enumerator_iterate (GFileEnumerator *direnum,
GFileInfo **out_info,
GFile **out_child,
GCancellable *cancellable,
GError **error);
G_END_DECLS
#endif /* __G_FILE_ENUMERATOR_H__ */