From e366d6a1f072663be672e697f7d1accfc21252b4 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 29 Apr 2017 10:15:09 +0200 Subject: list folders and files too --- examples/sample-afl.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'examples') diff --git a/examples/sample-afl.c b/examples/sample-afl.c index 2e7c12958..8224b4db5 100644 --- a/examples/sample-afl.c +++ b/examples/sample-afl.c @@ -24,6 +24,7 @@ int main(int argc, char **argv) { CameraWidget *rootwidget; char buf[200]; CameraText summary; + CameraList *list; gp_log_add_func(GP_LOG_DEBUG, errordumper, NULL); @@ -48,6 +49,24 @@ int main(int argc, char **argv) { } /* AFL PART STARTS HERE */ + + gp_list_new (&list); + ret = gp_camera_folder_list_files (camera, "/", list, context); + if (ret < GP_OK) { + printf ("Could not list files.\n"); + goto out; + } + gp_list_sort (list); + + gp_list_reset (list); + ret = gp_camera_folder_list_folders (camera, "/", list, context); + if (ret < GP_OK) { + printf ("Could not list files.\n"); + goto out; + } + gp_list_sort (list); + gp_list_free (list); + ret = gp_camera_get_summary (camera, &summary, context); if (ret < GP_OK) { printf ("Could not get summary.\n"); -- cgit v1.2.1