diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-03-12 12:26:55 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2009-03-12 12:26:55 +0000 |
commit | 1174a7a597f0f6246b4e95e654e356bc31c98456 (patch) | |
tree | 1b4227181419dd01c991b79d7212d2208a6a91de | |
parent | 113a3b2329259a6be241f3aaa6f0d39dec1208c2 (diff) | |
download | gvfs-1174a7a597f0f6246b4e95e654e356bc31c98456.tar.gz |
Make sure we ignore broken stores the same way we do in the volume
2009-03-12 Alexander Larsson <alexl@redhat.com>
* daemon/gvfsbackendgphoto2.c:
(ensure_ignore_prefix):
Make sure we ignore broken stores the same way we do in the
volume monitor.
svn path=/trunk/; revision=2319
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | daemon/gvfsbackendgphoto2.c | 22 |
2 files changed, 24 insertions, 5 deletions
@@ -1,3 +1,10 @@ +2009-03-12 Alexander Larsson <alexl@redhat.com> + + * daemon/gvfsbackendgphoto2.c: + (ensure_ignore_prefix): + Make sure we ignore broken stores the same way we do in the + volume monitor. + 2009-03-11 Alexander Larsson <alexl@redhat.com> Bug 572521 – gvfsd-cdda create two different Audio Disc Icons on Desktop diff --git a/daemon/gvfsbackendgphoto2.c b/daemon/gvfsbackendgphoto2.c index d86b654d..a21df894 100644 --- a/daemon/gvfsbackendgphoto2.c +++ b/daemon/gvfsbackendgphoto2.c @@ -1310,8 +1310,8 @@ static gboolean ensure_ignore_prefix (GVfsBackendGphoto2 *gphoto2_backend, GVfsJob *job) { gchar *prefix; - CameraStorageInformation *storage_info; - int num_storage_info; + CameraStorageInformation *storage_info, *head; + int num_storage_info, i; /* already set */ if (gphoto2_backend->ignore_prefix != NULL) @@ -1325,10 +1325,22 @@ ensure_ignore_prefix (GVfsBackendGphoto2 *gphoto2_backend, GVfsJob *job) gphoto2_backend->context) != 0) goto out; - if (num_storage_info > 1) - goto out; + head = NULL; + for (i = 0; i < num_storage_info; i++) + { + /* Ignore storage with no capacity (see bug 570888) */ + if ((storage_info[i].fields & GP_STORAGEINFO_MAXCAPACITY) && + storage_info[i].capacitykbytes == 0) + continue; + + /* Multiple heads, don't ignore */ + if (head != NULL) + goto out; + + head = &storage_info[i]; + } - prefix = g_strdup_printf ("%s/", storage_info[0].basedir); + prefix = g_strdup_printf ("%s/", head->basedir); out: |