Enlightenment CVS committal

Author  : codewarrior
Project : e17
Module  : apps/exhibit

Dir     : e17/apps/exhibit/src/bin


Modified Files:
        Makefile.am exhibit.h exhibit_file.c exhibit_main.c 


Log Message:
use efreet for checking mime types, dont use string compares extension (unless 
efreet cant determine it, in which case its either invalid or something like an 
edje file)

===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- Makefile.am 15 Sep 2006 11:30:10 -0000      1.10
+++ Makefile.am 6 Jul 2007 11:11:49 -0000       1.11
@@ -4,7 +4,8 @@
 -Wall -g \
 -I/usr/local/include \
 -I$(top_srcdir)/lib \
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@ \
[EMAIL PROTECTED]@
 
 bin_PROGRAMS = exhibit
 
@@ -31,7 +32,7 @@
 exhibit_menus.c \
 exhibit_sort.c \
 exhibit_thumb.c \
-exhibit_tab.c \
+exhibit_tab.c  \
 exhibit_slideshow.c \
 exhibit_favorites.c \
 exhibit_options.c \
@@ -40,4 +41,4 @@
 exhibit_model_wobbly.c \
 $(exhibit_INCLUDES)
 
-exhibit_LDADD = @my_libs@
+exhibit_LDADD = @exhibit_libs@ @optional_libs@
===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- exhibit.h   6 Jul 2007 10:17:54 -0000       1.44
+++ exhibit.h   6 Jul 2007 11:11:49 -0000       1.45
@@ -13,6 +13,7 @@
 #include <Edje.h>
 #include <Ecore_Evas.h>
 #include <Epsilon.h>
+#include <Efreet_Mime.h>
 #include <etk/Etk.h>
 #include <stdio.h>
 #include <stdlib.h>
===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_file.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- exhibit_file.c      1 Jun 2007 10:19:06 -0000       1.17
+++ exhibit_file.c      6 Jul 2007 11:11:49 -0000       1.18
@@ -6,17 +6,20 @@
 
 static void _ex_file_download_dialog_response(Etk_Object *obj, int 
response_id, void *data);
 
-char *viewables[] =
+char *viewables[] = 
 {
-   ".jpg",
-   ".jpeg",
-   ".png",
-   ".gif",
-   ".tiff",
    ".edj",
-   ".svg",
-   ".svgz",
-   ".xpm",
+   NULL
+};
+
+char *mimes[] =
+{
+   "image/jpeg",
+   "image/png",
+   "image/gif",
+   "image/tiff",
+   "image/svg+xml",
+   "image/xpm",
    NULL
 };
 
@@ -118,13 +121,23 @@
 {
    char *ext;
    int i = 0;
+   char *mime = NULL;
 
-   ext = strrchr(file, '.');
-   if(!ext) return 0;
+   if (!(mime = efreet_mime_type_get(file)))
+     {
+       ext = strrchr(file, '.');
+       if(!ext) return 0;
+
+       for(i = 0; viewables[i]; i++)
+         {
+            if(!strcasecmp(ext, viewables[i]))
+              return 1;
+         }
+     }
 
-   for(i = 0; viewables[i]; i++)
+   for (i = 0; mimes[i]; i++)
      {
-       if(!strcasecmp(ext, viewables[i]))
+       if (!strcasecmp(mime, mimes[i]))
          return 1;
      }
 
===================================================================
RCS file: /cvs/e/e17/apps/exhibit/src/bin/exhibit_main.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -3 -r1.108 -r1.109
--- exhibit_main.c      6 Jul 2007 10:17:54 -0000       1.108
+++ exhibit_main.c      6 Jul 2007 11:11:49 -0000       1.109
@@ -1165,7 +1165,13 @@
        fprintf(stderr, "Could not init etk. Exiting...\n");
        return 0;
      };
-   
+
+   if (!efreet_mime_init())
+     {
+       fprintf(stderr, "Could not init Efreet. Exiting...\n");
+       return 0;
+     }
+
    ecore_file_init();
    if(!_ex_options_init())
      fprintf(stderr, "WARNING: Exhibit could not set up its options files!\n"
@@ -1184,6 +1190,7 @@
      _ex_options_save(e);
    _ex_options_shutdown();
    ecore_file_shutdown();
+   efreet_mime_shutdown();
    etk_shutdown();
 
    return 0;



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to