Enlightenment CVS committal

Author  : jethomas
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_theme.c 


Log Message:
Try to fall back to default theme before failing.

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_theme.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- ewl_theme.c 1 Dec 2007 22:43:18 -0000       1.49
+++ ewl_theme.c 28 Dec 2007 22:06:28 -0000      1.50
@@ -16,6 +16,8 @@
 static char *ewl_theme_path_find(const char *name);
 static void ewl_theme_data_free(void *data);
 
+#define DEFAULT_THEME "e17"
+
 /**
  * @internal
  * @return Returns TRUE on success, FALSE on failure.
@@ -28,13 +30,19 @@
 int
 ewl_theme_init(void)
 {
+       const char *theme;
+
        DENTER_FUNCTION(DLEVEL_STABLE);
 
-       if (!ewl_theme_theme_set(ewl_config_string_get(ewl_config,
-                                               EWL_CONFIG_THEME_NAME)))
+       theme = ewl_config_string_get(ewl_config, EWL_CONFIG_THEME_NAME);
+       if (!ewl_theme_theme_set(theme))
        {
-               DWARNING("No usable theme found, exiting.");
-               DRETURN_INT(FALSE, DLEVEL_STABLE);
+               if ((!strcmp(theme, DEFAULT_THEME)) || 
+                               (!ewl_theme_theme_set(DEFAULT_THEME)))
+               {
+                       DWARNING("No usable theme found, exiting.");
+                       DRETURN_INT(FALSE, DLEVEL_STABLE);
+               }
        }
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to