diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2015-05-17 07:47:43 +0100 |
---|---|---|
committer | Ross Lagerwall <rosslagerwall@gmail.com> | 2015-05-17 07:52:52 +0100 |
commit | e7e6e1cde38f935e04e3e9d651eacf57557ff0c5 (patch) | |
tree | b7616d148146eb538e316ae8f779f27275f0436a | |
parent | 5b053ef5a7d6b8391e30e1f915700b7d56bf5967 (diff) | |
download | gvfs-e7e6e1cde38f935e04e3e9d651eacf57557ff0c5.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); |