diff options
author | David Rosca <nowrep@gmail.com> | 2021-10-22 11:28:13 +0200 |
---|---|---|
committer | Marcus Meissner <meissner@suse.de> | 2021-10-22 13:27:07 +0200 |
commit | 1866f1803c71b509516e3db275bd2adce2e3a24e (patch) | |
tree | 4d1156d7e33151bbbb49c8b6fa9d0f9fb6b4a72c /libgphoto2 | |
parent | 01ae4ff88379df8c5d95a32e88a096a713a86904 (diff) | |
download | libgphoto2-1866f1803c71b509516e3db275bd2adce2e3a24e.tar.gz |
filesys: Add gp_filesystem_set_info_dirty
Use it in ptp2 PTP_EC_ObjectInfoChanged.
Diffstat (limited to 'libgphoto2')
-rw-r--r-- | libgphoto2/gphoto2-filesys.c | 31 | ||||
-rw-r--r-- | libgphoto2/libgphoto2.sym | 1 |
2 files changed, 32 insertions, 0 deletions
diff --git a/libgphoto2/gphoto2-filesys.c b/libgphoto2/gphoto2-filesys.c index a5abb7e1f..4b98bdfc9 100644 --- a/libgphoto2/gphoto2-filesys.c +++ b/libgphoto2/gphoto2-filesys.c @@ -2353,6 +2353,37 @@ gp_filesystem_set_info_noop (CameraFilesystem *fs, } /** + * \brief Mark the file info as dirty + * \param fs a #CameraFilesystem + * \param folder the foldername + * \param filename the filename + * \param context a #GPContext + * + * Mark the file info as dirty, so that the next attempt + * to retrieve the file info will query the camera driver + * instead of possibly returning cached data. + * + * \return a gphoto2 error code + **/ +int gp_filesystem_set_info_dirty (CameraFilesystem *fs, + const char *folder, const char *filename, + GPContext *context) +{ + CameraFilesystemFolder *f; + CameraFilesystemFile *xfile; + + C_PARAMS (fs && folder); + CC (context); + CA (folder, context); + + /* Search folder and file */ + CR (lookup_folder_file (fs, folder, filename, &f, &xfile, context)); + + xfile->info_dirty = 1; + return (GP_OK); +} + +/** * \brief Set information about a file * \param fs a #CameraFilesystem * \param folder foldername where the file resides diff --git a/libgphoto2/libgphoto2.sym b/libgphoto2/libgphoto2.sym index 3f7067344..e83fefcf0 100644 --- a/libgphoto2/libgphoto2.sym +++ b/libgphoto2/libgphoto2.sym @@ -117,6 +117,7 @@ gp_filesystem_reset gp_filesystem_set_file_noop gp_filesystem_set_info gp_filesystem_set_info_noop +gp_filesystem_set_info_dirty gp_filesystem_set_funcs gp_file_unref gp_gamma_correct_single |