X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-job-xfer.c;h=cc9b7c4709f70968eb88f32258239deb4a90fd62;hb=43f12175ba221f7c241f0c9cde323c23b8db53e8;hp=49f674e53f2ebdbeec8b9c6840426aec05c70bef;hpb=270571fe9d9ab085696c5b2af5a484dfc272b7a0;p=evince.git diff --git a/shell/ev-job-xfer.c b/shell/ev-job-xfer.c index 49f674e5..cc9b7c47 100644 --- a/shell/ev-job-xfer.c +++ b/shell/ev-job-xfer.c @@ -90,7 +90,7 @@ ev_job_xfer_new (const gchar *uri) void ev_job_xfer_run (EvJobXfer *job) { - GType document_type; + EvDocument *document; GError *error = NULL; GnomeVFSURI *source_uri; GnomeVFSURI *target_uri; @@ -102,10 +102,10 @@ ev_job_xfer_run (EvJobXfer *job) job->error = NULL; } - document_type = ev_document_type_lookup (job->uri, NULL, &error); + document = ev_document_types_get_document (job->uri, NULL, &error); - if (document_type != G_TYPE_INVALID) { - EV_JOB (job)->document = g_object_new (document_type, NULL); + if (document != NULL) { + EV_JOB (job)->document = document; } else { job->error = error; EV_JOB (job)->finished = TRUE; @@ -115,9 +115,11 @@ ev_job_xfer_run (EvJobXfer *job) source_uri = gnome_vfs_uri_new (job->uri); if (!gnome_vfs_uri_is_local (source_uri)) { char *tmp_name; + char *base_name; tmp_name = ev_tmp_filename (); - job->local_uri = g_strconcat ("file:", tmp_name, NULL); + base_name = g_path_get_basename (job->uri); + job->local_uri = g_strconcat ("file:", tmp_name, base_name, NULL); g_free (tmp_name); target_uri = gnome_vfs_uri_new (job->local_uri);