]> www.fi.muni.cz Git - evince.git/blobdiff - libdocument/ev-file-helpers.c
[printing] Fix multipage even/odd printing issues
[evince.git] / libdocument / ev-file-helpers.c
index 7b9a9e9cfbe30ed4d8a468d402f9fb02ae2bf92b..3da4a59832d5031bedac8c19a00c3ef62fc4686b 100644 (file)
@@ -122,6 +122,12 @@ ev_tmp_filename (const gchar *prefix)
        return filename;
 }
 
        return filename;
 }
 
+gchar * 
+ev_tmp_directory (const gchar *prefix) 
+{
+       return ev_tmp_filename (prefix ? prefix : "directory");
+}
+
 /* Remove a local temp file created by evince */
 void
 ev_tmp_filename_unlink (const gchar *filename)
 /* Remove a local temp file created by evince */
 void
 ev_tmp_filename_unlink (const gchar *filename)
@@ -222,6 +228,7 @@ get_mime_type_from_uri (const gchar *uri, GError **error)
        GFile       *file;
        GFileInfo   *file_info;
        const gchar *content_type;
        GFile       *file;
        GFileInfo   *file_info;
        const gchar *content_type;
+        gchar       *mime_type = NULL;
 
        file = g_file_new_for_uri (uri);
        file_info = g_file_query_info (file,
 
        file = g_file_new_for_uri (uri);
        file_info = g_file_query_info (file,
@@ -233,12 +240,12 @@ get_mime_type_from_uri (const gchar *uri, GError **error)
                return NULL;
 
        content_type = g_file_info_get_content_type (file_info);
                return NULL;
 
        content_type = g_file_info_get_content_type (file_info);
-       g_object_unref (file_info);
+       if (content_type) {
+                mime_type = g_content_type_get_mime_type (content_type);
+        }
 
 
-       if (!content_type)
-               return NULL;
-
-       return g_content_type_get_mime_type (content_type);
+       g_object_unref (file_info);
+       return mime_type;
 }
 
 static gchar *
 }
 
 static gchar *