]> www.fi.muni.cz Git - evince.git/blobdiff - backend/ev-document-factory.c
Updated Translation
[evince.git] / backend / ev-document-factory.c
index 251ede3fc2af00e666007f569af12f36f0443fda..1cf301414c4e7780060c3f13d2ab4a4061c13099 100644 (file)
@@ -35,6 +35,9 @@
 #ifdef ENABLE_DJVU
 #include "djvu-document.h"
 #endif
+#ifdef ENABLE_COMICS
+#include "comics-document.h"
+#endif
 
 #include <string.h>
 
@@ -69,8 +72,15 @@ const EvDocumentType document_types[] = {
        /* dvi: */
        {"application/x-dvi",          EV_BACKEND_DVI,  dvi_document_get_type},
 #endif
+
+#ifdef ENABLE_COMICS
+       /* cbr/cbz: */
+       {"application/x-cbr",           EV_BACKEND_COMICS,  comics_document_get_type},
+       {"application/x-cbz",           EV_BACKEND_COMICS,  comics_document_get_type},
+#endif
 };
 
+#ifdef ENABLE_PIXBUF
 /* Would be nice to have this in gdk-pixbuf */
 static gboolean
 mime_type_supported_by_gdk_pixbuf (const gchar *mime_type)
@@ -108,7 +118,7 @@ mime_type_supported_by_gdk_pixbuf (const gchar *mime_type)
 
        return retval;
 }
-
+#endif
 
 static GType
 ev_document_type_get_from_mime (const char *mime_type)
@@ -123,10 +133,11 @@ ev_document_type_get_from_mime (const char *mime_type)
                        return document_types[i].document_type_factory_callback();
                }
        }
-
+#ifdef ENABLE_PIXBUF
        if (mime_type_supported_by_gdk_pixbuf (mime_type)) {
                return pixbuf_document_get_type ();
        }
+#endif
 
        return G_TYPE_INVALID;
 }
@@ -138,7 +149,7 @@ ev_document_factory_get_document (const char *mime_type)
        
        type = ev_document_type_get_from_mime (mime_type);
 
-       if (type != G_TYPE_NONE) {
+       if (type != G_TYPE_INVALID) {
                return g_object_new (type, NULL);
        }