[gvfs/gnome-3-16] mtp: Refresh storage information in query_info
- From: Ross Lagerwall <rossl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/gnome-3-16] mtp: Refresh storage information in query_info
- Date: Wed, 20 May 2015 06:43:34 +0000 (UTC)
commit 725eaa2e33a842f812caf59af8a8766461bf9512
Author: Ross Lagerwall <rosslagerwall gmail com>
Date: Sun May 17 07:47:43 2015 +0100
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
daemon/gvfsbackendmtp.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gvfsbackendmtp.c b/daemon/gvfsbackendmtp.c
index 0366116..4ecd988 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]