From: Enlightenment S. <no-...@en...> - 2008-10-15 15:25:03
|
Log: Disable localization of theme files. Author: kwo Date: 2008-10-15 08:20:20 -0700 (Wed, 15 Oct 2008) New Revision: 36682 Modified: trunk/E16/e/src/E.h trunk/E16/e/src/backgrounds.c trunk/E16/e/src/config.c trunk/E16/e/src/cursors.c trunk/E16/e/src/iclass.c trunk/E16/e/src/menus-misc.c trunk/E16/e/src/sound.c trunk/E16/e/src/theme.c Modified: trunk/E16/e/src/E.h =================================================================== --- trunk/E16/e/src/E.h 2008-10-15 15:19:12 UTC (rev 36681) +++ trunk/E16/e/src/E.h 2008-10-15 15:20:20 UTC (rev 36682) @@ -259,7 +259,6 @@ char animate; } startup; struct { - char localise; char use_alt_font_cfg; char *name; char *extra_path; @@ -441,9 +440,8 @@ int ConfigParseline1(char *str, char *s2, char **p2, char **p3); void ConfigParseError(const char *where, const char *line); void ConfigAlertLoad(const char *txt); -char *FindFile(const char *file, const char *themepath, - int localized); -char *ThemeFileFind(const char *file, int localized); +char *FindFile(const char *file, const char *themepath); +char *ThemeFileFind(const char *file); char *ConfigFileFind(const char *name, const char *themepath, int pp); int ConfigFileLoad(const char *name, const char *themepath, Modified: trunk/E16/e/src/backgrounds.c =================================================================== --- trunk/E16/e/src/backgrounds.c 2008-10-15 15:19:12 UTC (rev 36681) +++ trunk/E16/e/src/backgrounds.c 2008-10-15 15:20:20 UTC (rev 36682) @@ -93,7 +93,7 @@ { char *f; - f = ThemeFileFind(bg->bg.file, 0); + f = ThemeFileFind(bg->bg.file); if (f) { f1 = fileinode(f); @@ -106,7 +106,7 @@ { char *f; - f = ThemeFileFind(bg->top.file, 0); + f = ThemeFileFind(bg->top.file); if (f) { f4 = fileinode(f); @@ -259,7 +259,7 @@ /* And delete the actual image files */ if (bg->bg.file) { - f = ThemeFileFind(bg->bg.file, 0); + f = ThemeFileFind(bg->bg.file); if (f) { E_rm(f); @@ -268,7 +268,7 @@ } if (bg->top.file) { - f = ThemeFileFind(bg->top.file, 0); + f = ThemeFileFind(bg->top.file); if (f) { E_rm(f); @@ -548,7 +548,7 @@ if (bg->bg.file && !bg->bg.im) { if (!bg->bg.real_file) - bg->bg.real_file = ThemeFileFind(bg->bg.file, 0); + bg->bg.real_file = ThemeFileFind(bg->bg.file); if (bg->bg.real_file) bg->bg.im = EImageLoad(bg->bg.real_file); } @@ -556,7 +556,7 @@ if (bg->top.file && !bg->top.im) { if (!bg->top.real_file) - bg->top.real_file = ThemeFileFind(bg->top.file, 0); + bg->top.real_file = ThemeFileFind(bg->top.file); if (bg->top.real_file) bg->top.im = EImageLoad(bg->top.real_file); } @@ -1084,7 +1084,7 @@ /* check first if we can actually find the files */ if (bg1) { - tmp = ThemeFileFind(bg1, 0); + tmp = ThemeFileFind(bg1); if (!tmp) ok = 0; else @@ -1092,7 +1092,7 @@ } if (bg2) { - tmp = ThemeFileFind(bg2, 0); + tmp = ThemeFileFind(bg2); if (!tmp) ok = 0; else @@ -1248,10 +1248,10 @@ fprintf(fs, "560 %d %d %d\n", r, g, b); if ((bg->bg.file) && (!bg->bg.real_file)) - bg->bg.real_file = ThemeFileFind(bg->bg.file, 0); + bg->bg.real_file = ThemeFileFind(bg->bg.file); if ((bg->top.file) && (!bg->top.real_file)) - bg->top.real_file = ThemeFileFind(bg->top.file, 0); + bg->top.real_file = ThemeFileFind(bg->top.file); if ((bg->bg.file) && (bg->bg.real_file)) { Modified: trunk/E16/e/src/config.c =================================================================== --- trunk/E16/e/src/config.c 2008-10-15 15:19:12 UTC (rev 36681) +++ trunk/E16/e/src/config.c 2008-10-15 15:20:20 UTC (rev 36682) @@ -400,55 +400,31 @@ } static char * -FindFileLocalized(const char *name, const char *path, int localized) +FindFilePath(const char *name, const char *path) { char s[FILEPATH_LEN_MAX]; - const char *lang; - char *p[4]; - int i, len; + int len; if (path) - len = Esnprintf(s, sizeof(s), "%s/%s", path, name); + { + len = Esnprintf(s, sizeof(s), "%s/%s", path, name); + name = s; + } else - len = Esnprintf(s, sizeof(s), "%s", name); - if (len <= 0) - return NULL; - - lang = Mode.locale.lang; - if (!localized || !lang) { - if (canread(s)) - return Estrdup(s); - else - return NULL; + len = strlen(name); } - - if (len + 1 + strlen(lang) >= sizeof(s)) + if (len <= 0) return NULL; - s[len] = '.'; - strcpy(s + len + 1, lang); - - p[0] = s + len + 1 + strlen(lang); /* .da_DK.UTF-8 */ - p[1] = strchr(s + len + 1, '.'); /* .da_DK */ - p[2] = strchr(s + len + 1, '_'); /* .da */ - p[3] = s + len; - - for (i = 0; i < 4; i++) - { - if (p[i] == NULL) - continue; - - *p[i] = '\0'; - if (canread(s)) - return Estrdup(s); - } - - return NULL; + if (canread(name)) + return Estrdup(name); + else + return NULL; } char * -FindFile(const char *file, const char *themepath, int localized) +FindFile(const char *file, const char *themepath) { char s[FILEPATH_LEN_MAX]; char *p; @@ -456,27 +432,27 @@ /* if absolute path - and file exists - return it */ if (isabspath(file)) { - p = FindFileLocalized(file, NULL, localized); + p = FindFilePath(file, NULL); if (p) return p; } /* look in ~/.e16 first */ - p = FindFileLocalized(file, EDirUser(), localized); + p = FindFilePath(file, EDirUser()); if (p) return p; if (themepath) { /* look in theme dir */ - p = FindFileLocalized(file, themepath, localized); + p = FindFilePath(file, themepath); if (p) return p; } /* look in system config dir */ Esnprintf(s, sizeof(s), "%s/config", EDirRoot()); - p = FindFileLocalized(file, s, localized); + p = FindFilePath(file, s); if (p) return p; @@ -485,9 +461,9 @@ } char * -ThemeFileFind(const char *file, int localized) +ThemeFileFind(const char *file) { - return FindFile(file, Mode.theme.path, localized); + return FindFile(file, Mode.theme.path); } char * @@ -497,7 +473,7 @@ char *fullname, *file, *ppfile; int i, err; - fullname = FindFile(name, themepath, Conf.theme.localise); + fullname = FindFile(name, themepath); if (!fullname) return NULL; Modified: trunk/E16/e/src/cursors.c =================================================================== --- trunk/E16/e/src/cursors.c 2008-10-15 15:19:12 UTC (rev 36681) +++ trunk/E16/e/src/cursors.c 2008-10-15 15:20:20 UTC (rev 36682) @@ -108,7 +108,7 @@ if (image) { - img = FindFile(image, Mode.theme.path, 0); + img = FindFile(image, Mode.theme.path); if (!img) return NULL; Modified: trunk/E16/e/src/iclass.c =================================================================== --- trunk/E16/e/src/iclass.c 2008-10-15 15:19:12 UTC (rev 36681) +++ trunk/E16/e/src/iclass.c 2008-10-15 15:20:20 UTC (rev 36682) @@ -158,7 +158,7 @@ return im; } - f = ThemeFileFind(file, 0); + f = ThemeFileFind(file); if (f) { im = EImageLoad(f); @@ -253,7 +253,7 @@ /* not loaded, load and setup */ if (!is->real_file) - is->real_file = ThemeFileFind(is->im_file, 0); + is->real_file = ThemeFileFind(is->im_file); if (is->real_file) is->im = EImageLoad(is->real_file); if (!is->im) Modified: trunk/E16/e/src/menus-misc.c =================================================================== --- trunk/E16/e/src/menus-misc.c 2008-10-15 15:19:12 UTC (rev 36681) +++ trunk/E16/e/src/menus-misc.c 2008-10-15 15:20:20 UTC (rev 36682) @@ -397,15 +397,15 @@ if (isabspath(file)) { - ff = FindFile(file, NULL, 0); + ff = FindFile(file, NULL); } else { /* Check menus subdir first */ Esnprintf(buf, sizeof(buf), "menus/%s", file); - ff = FindFile(buf, NULL, 0); + ff = FindFile(buf, NULL); if (!ff) - ff = FindFile(file, NULL, 0); + ff = FindFile(file, NULL); } if (!ff) goto done; Modified: trunk/E16/e/src/sound.c =================================================================== --- trunk/E16/e/src/sound.c 2008-10-15 15:19:12 UTC (rev 36681) +++ trunk/E16/e/src/sound.c 2008-10-15 15:20:20 UTC (rev 36682) @@ -113,7 +113,7 @@ { char *file; - file = FindFile(sclass->file, Mode.theme.path, 0); + file = FindFile(sclass->file, Mode.theme.path); if (file) { sclass->sample = ops->SampleLoad(file); Modified: trunk/E16/e/src/theme.c =================================================================== --- trunk/E16/e/src/theme.c 2008-10-15 15:19:12 UTC (rev 36681) +++ trunk/E16/e/src/theme.c 2008-10-15 15:20:20 UTC (rev 36682) @@ -534,7 +534,6 @@ #define N_IPC_FUNCS (sizeof(ThemeIpcArray)/sizeof(IpcItem)) static const CfgItem ThemeCfgItems[] = { - CFG_ITEM_BOOL(Conf.theme, localise, 0), CFG_ITEM_STR(Conf.theme, name), CFG_ITEM_STR(Conf.theme, extra_path), CFG_ITEM_STR(Conf.theme, ttfont_path), |