summaryrefslogtreecommitdiff
path: root/camlibs/st2205
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2010-04-11 18:59:22 +0000
committerHans de Goede <hdegoede@redhat.com>2010-04-11 18:59:22 +0000
commitd16b14109a408ca4fa13b29ab557a0f9db58f73a (patch)
treeccc697ebfd94d56805a71876cfac97156a5839c1 /camlibs/st2205
parent578f14f99ae243548408b33a6a08a03b8806fd9a (diff)
downloadlibgphoto2-d16b14109a408ca4fa13b29ab557a0f9db58f73a.tar.gz
st2205: add delete all support
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12991 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/st2205')
-rw-r--r--camlibs/st2205/library.c16
-rw-r--r--camlibs/st2205/st2205.c1
2 files changed, 15 insertions, 2 deletions
diff --git a/camlibs/st2205/library.c b/camlibs/st2205/library.c
index 237c765e2..fc6cea2e0 100644
--- a/camlibs/st2205/library.c
+++ b/camlibs/st2205/library.c
@@ -68,8 +68,8 @@ camera_abilities (CameraAbilitiesList *list)
a.usb_vendor = 0x1403;
a.usb_product= 0x0001;
a.operations = GP_OPERATION_NONE;
- a.folder_operations = GP_FOLDER_OPERATION_PUT_FILE;
- /* FIXME add support for delete all */
+ a.folder_operations = GP_FOLDER_OPERATION_PUT_FILE |
+ GP_FOLDER_OPERATION_DELETE_ALL;
a.file_operations = GP_FILE_OPERATION_DELETE | GP_FILE_OPERATION_RAW;
return gp_abilities_list_append (list, a);
}
@@ -346,6 +346,17 @@ delete_file_func (CameraFilesystem *fs, const char *folder,
}
static int
+delete_all_func (CameraFilesystem *fs, const char *folder, void *data,
+ GPContext *context)
+{
+ Camera *camera = data;
+
+ CHECK (st2205_delete_all (camera))
+
+ return st2205_commit (camera);
+}
+
+static int
get_info_func (CameraFilesystem *fs, const char *folder, const char *filename,
CameraFileInfo *info, void *data, GPContext *context)
{
@@ -378,6 +389,7 @@ static CameraFilesystemFuncs fsfuncs = {
.get_file_func = get_file_func,
.del_file_func = delete_file_func,
.put_file_func = put_file_func,
+ .delete_all_func = delete_all_func,
};
static int
diff --git a/camlibs/st2205/st2205.c b/camlibs/st2205/st2205.c
index 0ff6d9446..ddd939c76 100644
--- a/camlibs/st2205/st2205.c
+++ b/camlibs/st2205/st2205.c
@@ -724,6 +724,7 @@ st2205_delete_all(Camera *camera)
/* Mark the memory block we've directly manipulated dirty. */
camera->pl->block_dirty[0] = 1;
+ CHECK (st2205_write_file_count (camera, 0))
CHECK (st2205_update_fat_checksum (camera))
CHECK (st2205_copy_fat (camera))