summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2009-11-06 00:49:17 +0000
committerBastien Nocera <hadess@hadess.net>2009-11-09 16:06:21 +0000
commit92c179d6ce2682595e7ce1a77e301ffc49e25526 (patch)
tree204f0d0da89096f46b89e28449c255c03bdd6519
parent7226f3868128ff7b888a7bde88c6b4484c373b43 (diff)
downloadgvfs-92c179d6ce2682595e7ce1a77e301ffc49e25526.tar.gz
[afc] Add x-content types for AFC backend
https://bugzilla.gnome.org/show_bug.cgi?id=597805
-rw-r--r--daemon/gvfsbackendafc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/daemon/gvfsbackendafc.c b/daemon/gvfsbackendafc.c
index aa90a418..0c34e8be 100644
--- a/daemon/gvfsbackendafc.c
+++ b/daemon/gvfsbackendafc.c
@@ -255,6 +255,9 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
int retries;
iphone_error_t err;
lockdownd_client_t lockdown_cli = NULL;
+ char *camera_x_content_types[] = { "x-content/audio-player", "x-content/image-dcf", NULL};
+ char *media_player_x_content_types[] = {"x-content/audio-player", NULL};
+ char **dcim_afcinfo;
self = G_VFS_BACKEND_AFC(backend);
self->connected = FALSE;
@@ -384,6 +387,14 @@ g_vfs_backend_afc_mount (GVfsBackend *backend,
/* lockdown connection is not needed anymore */
lockdownd_client_free (lockdown_cli);
+ /* Add camera item if necessary */
+ dcim_afcinfo = NULL;
+ if (afc_get_file_info (self->afc_cli, "/DCIM", &dcim_afcinfo) == AFC_E_SUCCESS)
+ g_vfs_backend_set_x_content_types (backend, camera_x_content_types);
+ else
+ g_vfs_backend_set_x_content_types (backend, media_player_x_content_types);
+ g_strfreev (dcim_afcinfo);
+
self->connected = TRUE;
g_vfs_job_succeeded (G_VFS_JOB(job));
return;