1.1 --- a/libgnomevfs2-mythtv/modules/mythtv-method.c Sat Dec 02 04:23:43 2006 +0000
1.2 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c Mon Dec 04 22:01:41 2006 +0000
1.3 @@ -95,11 +95,12 @@
1.4
1.5 /* Connect to the backend */
1.6 myth_handle->file_transfer = gmyth_file_transfer_new (backend_info);
1.7 + g_object_unref (backend_info);
1.8
1.9 g_return_val_if_fail (myth_handle->file_transfer != NULL, GNOME_VFS_ERROR_NOT_OPEN);
1.10
1.11 /* sets the Playback monitor connection */
1.12 - ret = gmyth_file_transfer_open (myth_handle->file_transfer);
1.13 + ret = gmyth_file_transfer_open (myth_handle->file_transfer, gnome_vfs_uri_get_path (uri));
1.14 if (ret == FALSE) {
1.15 g_warning ("Mythtv FileTransfer open error\n");
1.16 return GNOME_VFS_ERROR_NOT_OPEN;
1.17 @@ -209,7 +210,10 @@
1.18 GnomeVFSFileInfoOptions options,
1.19 GnomeVFSContext *context)
1.20 {
1.21 - file_info->name = g_strdup ("fixme.txt");
1.22 + GMythFileTransfer *file_transfer = NULL;
1.23 + GMythBackendInfo *backend_info = NULL;
1.24 +
1.25 + file_info->name = g_strdup (gnome_vfs_uri_get_path (uri));
1.26 file_info->valid_fields = file_info->valid_fields
1.27 | GNOME_VFS_FILE_INFO_FIELDS_TYPE
1.28 | GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE
1.29 @@ -222,6 +226,21 @@
1.30 GNOME_VFS_PERM_OTHER_READ |
1.31 GNOME_VFS_PERM_GROUP_READ;
1.32
1.33 + backend_info = gmyth_backend_info_new_full (gnome_vfs_uri_get_host_name (uri),
1.34 + gnome_vfs_uri_get_user_name (uri),
1.35 + gnome_vfs_uri_get_password (uri),
1.36 + NULL,
1.37 + gnome_vfs_uri_get_host_port (uri));
1.38 +
1.39 + file_transfer = gmyth_file_transfer_new (backend_info);
1.40 + if (gmyth_file_transfer_open (file_transfer, gnome_vfs_uri_get_path (uri)) == TRUE) {
1.41 + file_info->size = gmyth_file_transfer_get_filesize (file_transfer);
1.42 + file_info->block_count = GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT;
1.43 + file_info->io_block_size = GNOME_VFS_FILE_INFO_FIELDS_IO_BLOCK_SIZE;
1.44 + }
1.45 +
1.46 + g_object_unref (file_transfer);
1.47 + g_object_unref (backend_info);
1.48 return GNOME_VFS_OK;
1.49 }
1.50