]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-sidebar-attachments.c
Fixes bug #542924. Makes enums static to fix Solaris build.
[evince.git] / shell / ev-sidebar-attachments.c
index 5d2beff317e1ab722450284b9654eeca99f03846..2aeadd69a68343ee2e1ca4bb4f02d5096816e8b1 100644 (file)
@@ -295,7 +295,7 @@ ev_sidebar_attachments_button_press (EvSidebarAttachments *ev_attachbar,
                                ev_attachment_open (attachment, &error);
                                
                                if (error) {
                                ev_attachment_open (attachment, &error);
                                
                                if (error) {
-                                       g_warning (error->message);
+                                       g_warning ("%s", error->message);
                                        g_error_free (error);
                                }
                                
                                        g_error_free (error);
                                }
                                
@@ -406,7 +406,8 @@ ev_sidebar_attachments_drag_data_get (GtkWidget        *widget,
                EvAttachment *attachment;
                GtkTreePath  *path;
                GtkTreeIter   iter;
                EvAttachment *attachment;
                GtkTreePath  *path;
                GtkTreeIter   iter;
-               gchar        *uri, *filename;
+               GFile        *file;
+               gchar        *filename;
                GError       *error = NULL;
                
                path = (GtkTreePath *) l->data;
                GError       *error = NULL;
                
                path = (GtkTreePath *) l->data;
@@ -420,21 +421,25 @@ ev_sidebar_attachments_drag_data_get (GtkWidget        *widget,
                filename = g_build_filename (ev_tmp_dir (),
                                             ev_attachment_get_name (attachment),
                                             NULL);
                filename = g_build_filename (ev_tmp_dir (),
                                             ev_attachment_get_name (attachment),
                                             NULL);
+               file = g_file_new_for_path (filename);
+               g_free (filename);
                
                
-               uri = g_filename_to_uri (filename, NULL, NULL);
+               if (ev_attachment_save (attachment, file, &error)) {
+                       gchar *uri;
 
 
-               if (ev_attachment_save (attachment, filename, &error)) {
+                       uri = g_file_get_uri (file);
                        g_string_append (uri_list, uri);
                        g_string_append_c (uri_list, '\n');
                        g_string_append (uri_list, uri);
                        g_string_append_c (uri_list, '\n');
+                       g_free (uri);
                }
        
                if (error) {
                }
        
                if (error) {
-                       g_warning (error->message);
+                       g_warning ("%s", error->message);
                        g_error_free (error);
                }
 
                        g_error_free (error);
                }
 
-               g_free (uri);
                gtk_tree_path_free (path);
                gtk_tree_path_free (path);
+               g_object_unref (file);
                g_object_unref (attachment);
        }
 
                g_object_unref (attachment);
        }