diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2015-05-17 07:47:43 +0100 |
---|---|---|
committer | Ross Lagerwall <rosslagerwall@gmail.com> | 2015-05-20 07:42:39 +0100 |
commit | 725eaa2e33a842f812caf59af8a8766461bf9512 (patch) | |
tree | b14e4bceacdae3215cdb11155d6b718490abd956 | |
parent | 13aafd9f3518c9d39b4b7e25558fa19d899af221 (diff) | |
download | gvfs-725eaa2e33a842f812caf59af8a8766461bf9512.tar.gz |
mtp: Refresh storage information in query_info
Get the storage information from the device in query_info() and
query_fs_info() so that the disk space numbers are correct. Previously,
if you deleted an item and checked the free space, it would not have
changed.
https://bugzilla.gnome.org/show_bug.cgi?id=749491
-rw-r--r-- | daemon/gvfsbackendmtp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/daemon/gvfsbackendmtp.c b/daemon/gvfsbackendmtp.c index 03661165..4ecd988a 100644 --- a/daemon/gvfsbackendmtp.c +++ b/daemon/gvfsbackendmtp.c @@ -1378,6 +1378,12 @@ do_query_info (GVfsBackend *backend, LIBMTP_devicestorage_t *storage; gboolean found = FALSE; + + int ret = LIBMTP_Get_Storage (device, LIBMTP_STORAGE_SORTBY_NOTSORTED); + if (ret != 0) { + fail_job (G_VFS_JOB (job), device); + goto exit; + } for (storage = device->storage; storage != 0; storage = storage->next) { if (storage->id == entry->storage) { DEBUG ("(I) found storage %X\n", storage->id); @@ -1459,6 +1465,12 @@ do_query_fs_info (GVfsBackend *backend, } LIBMTP_devicestorage_t *storage; + + int ret = LIBMTP_Get_Storage (device, LIBMTP_STORAGE_SORTBY_NOTSORTED); + if (ret != 0) { + fail_job (G_VFS_JOB (job), device); + goto exit; + } for (storage = device->storage; storage != 0; storage = storage->next) { if (storage->id == entry->storage) { get_storage_info (storage, info); |