From 5a247e6553036e04a5bd43f7e544bb85b8a9a036 Mon Sep 17 00:00:00 2001 From: gapan Date: Mon, 13 Feb 2012 12:14:35 +0000 Subject: [PATCH] Don't crawl through the same xdg_data_dirs twice --- src/xdgmenumaker | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xdgmenumaker b/src/xdgmenumaker index 6098a01..e0a1715 100755 --- a/src/xdgmenumaker +++ b/src/xdgmenumaker @@ -192,9 +192,15 @@ def sortedcategories(applist): return categories def desktopfilelist(): - dirs = bd.xdg_data_dirs + dirs = [] + # some directories are mentioned twice in bd.xdg_data_dirs, once + # with and once without a trailing / + for i in bd.xdg_data_dirs: + dirs.append(i.rstrip('/')) + dirs = set(dirs) filelist = [] for d in dirs: + print d xdgdir = d+'/applications' if os.path.isdir(xdgdir): for i in os.listdir(xdgdir):