Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h theme.c
Log Message:
Enable additional theme dir paths.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.375
retrieving revision 1.376
diff -u -3 -r1.375 -r1.376
--- E.h 22 Feb 2005 21:44:10 -0000 1.375
+++ E.h 24 Feb 2005 22:07:32 -0000 1.376
@@ -900,6 +900,7 @@
struct
{
char *name;
+ char *extra_path;
} theme;
#ifdef ENABLE_THEME_TRANSPARENCY
struct
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/theme.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -3 -r1.42 -r1.43
--- theme.c 6 Feb 2005 19:13:34 -0000 1.42
+++ theme.c 24 Feb 2005 22:07:39 -0000 1.43
@@ -155,19 +155,26 @@
char **
ThemesList(int *number)
{
- char s[FILEPATH_LEN_MAX], **list = NULL;
- char *def = NULL, *def2 = NULL;
- int count = 0;
-
- Esnprintf(s, sizeof(s), "%s/themes", EDirUser());
- def = append_merge_dir(s, &list, &count);
- if (def)
- Efree(def);
-
- Esnprintf(s, sizeof(s), "%s/themes", EDirRoot());
- def2 = append_merge_dir(s, &list, &count);
- if (def2)
- Efree(def2);
+ char paths[4096];
+ char buf[4096], *s, **list = NULL;
+ int len, count = 0;
+
+ Esnprintf(paths, sizeof(paths), "%s/themes:%s/themes:%s", EDirUser(),
+ EDirRoot(), (Conf.theme.extra_path) ? Conf.theme.extra_path : "");
+
+ count = 0;
+ for (s = paths;;)
+ {
+ len = 0;
+ sscanf(s, "%4095[^:]%n", buf, &len);
+
+ if (len > 0)
+ append_merge_dir(buf, &list, &count);
+
+ s += len;
+ if (*s++ != ':')
+ break;
+ }
*number = count;
return list;
@@ -444,8 +451,10 @@
if (!p || cmd[0] == '?')
{
IpcPrintf("Name: %s\n", Conf.theme.name);
- IpcPrintf("Path: %s\n", Mode.theme.path);
- IpcPrintf("User: %s\n", ThemeGetDefault());
+ IpcPrintf("Full: %s\n", Mode.theme.path);
+ IpcPrintf("Default: %s\n", ThemeGetDefault());
+ IpcPrintf("Path: %s/themes:%s/themes:%s", EDirUser(), EDirRoot(),
+ (Conf.theme.extra_path) ? Conf.theme.extra_path : "");
}
else if (!strncmp(cmd, "list", 2))
{
@@ -479,6 +488,7 @@
static const CfgItem ThemeCfgItems[] = {
CFG_ITEM_STR(Conf.theme, name),
+ CFG_ITEM_STR(Conf.theme, extra_path),
};
#define N_CFG_ITEMS (sizeof(ThemeCfgItems)/sizeof(CfgItem))
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs