# HG changeset patch # User renatofilho # Date 1165269701 0 # Node ID 944deaac3f015c157323ab97cd3e06b1a6924409 # Parent 653d06bca8262b3d3aff8afff43e0a8eda2f269c [svn r189] fixed gmyth_file_transfer compatibilit diff -r 653d06bca826 -r 944deaac3f01 libgnomevfs2-mythtv/modules/mythtv-method.c --- a/libgnomevfs2-mythtv/modules/mythtv-method.c Mon Dec 04 22:00:41 2006 +0000 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c Mon Dec 04 22:01:41 2006 +0000 @@ -95,11 +95,12 @@ /* Connect to the backend */ myth_handle->file_transfer = gmyth_file_transfer_new (backend_info); + g_object_unref (backend_info); g_return_val_if_fail (myth_handle->file_transfer != NULL, GNOME_VFS_ERROR_NOT_OPEN); /* sets the Playback monitor connection */ - ret = gmyth_file_transfer_open (myth_handle->file_transfer); + ret = gmyth_file_transfer_open (myth_handle->file_transfer, gnome_vfs_uri_get_path (uri)); if (ret == FALSE) { g_warning ("Mythtv FileTransfer open error\n"); return GNOME_VFS_ERROR_NOT_OPEN; @@ -209,7 +210,10 @@ GnomeVFSFileInfoOptions options, GnomeVFSContext *context) { - file_info->name = g_strdup ("fixme.txt"); + GMythFileTransfer *file_transfer = NULL; + GMythBackendInfo *backend_info = NULL; + + file_info->name = g_strdup (gnome_vfs_uri_get_path (uri)); file_info->valid_fields = file_info->valid_fields | GNOME_VFS_FILE_INFO_FIELDS_TYPE | GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE @@ -222,6 +226,21 @@ GNOME_VFS_PERM_OTHER_READ | GNOME_VFS_PERM_GROUP_READ; + backend_info = gmyth_backend_info_new_full (gnome_vfs_uri_get_host_name (uri), + gnome_vfs_uri_get_user_name (uri), + gnome_vfs_uri_get_password (uri), + NULL, + gnome_vfs_uri_get_host_port (uri)); + + file_transfer = gmyth_file_transfer_new (backend_info); + if (gmyth_file_transfer_open (file_transfer, gnome_vfs_uri_get_path (uri)) == TRUE) { + file_info->size = gmyth_file_transfer_get_filesize (file_transfer); + file_info->block_count = GNOME_VFS_FILE_INFO_FIELDS_BLOCK_COUNT; + file_info->io_block_size = GNOME_VFS_FILE_INFO_FIELDS_IO_BLOCK_SIZE; + } + + g_object_unref (file_transfer); + g_object_unref (backend_info); return GNOME_VFS_OK; }