From 708ca4356f4ebdf0af16fed833f2510236bd6f97 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Fri, 8 Mar 2013 23:33:30 -0500 Subject: Only consider visible directories in _USERHOME/themes/ as themes; core/gui.lua --- core/gui.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'core/gui.lua') diff --git a/core/gui.lua b/core/gui.lua index 0f856c58..e6ccb9aa 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -226,11 +226,15 @@ end function gui.select_theme() local themes, themes_found = {}, {} for theme in lfs.dir(_HOME..'/themes') do - if not theme:find('^%.%.?$') then themes_found[theme] = true end + if not theme:find('^%.') then themes_found[theme] = true end end if lfs.attributes(_USERHOME..'/themes') then - for theme in lfs.dir(_USERHOME..'/themes') do - if not theme:find('^%.%.?$') then themes_found[theme] = true end + local theme_dir = _USERHOME..'/themes/' + for theme in lfs.dir(theme_dir) do + if not theme:find('^%.') and + lfs.attributes(theme_dir..theme, 'mode') == 'directory' then + themes_found[theme] = true + end end end for theme in pairs(themes_found) do themes[#themes + 1] = theme end -- cgit v1.2.3