From 255a245accc393317e6c5d75c8a0a6cfc45a55a5 Mon Sep 17 00:00:00 2001 From: Hannes Janetzek Date: Thu, 6 May 2010 16:12:34 +0000 Subject: [PATCH] only show recent files of subdirs when browsing SVN revision: 48648 --- src/modules/everything-files/e_mod_main.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/modules/everything-files/e_mod_main.c b/src/modules/everything-files/e_mod_main.c index 268815b07..e4bcd7d5f 100644 --- a/src/modules/everything-files/e_mod_main.c +++ b/src/modules/everything-files/e_mod_main.c @@ -1001,11 +1001,18 @@ _recentf_items_add_cb(const Eina_Hash *hash, const void *key, void *data, void * } /* searching subdirs */ - if (p->directory && strncmp(path, p->directory, strlen(p->directory))) + if (p->directory) { - /* DBG("not in dir %s", path); */ - eina_stringshare_del(path); - return EINA_TRUE; + /* dont show recent files from same dir */ + int len = strlen(p->directory); + char *end = strrchr(path, '/'); + if (strncmp(path, p->directory, len) || + (end - path) <= len) + { + /* DBG("not in dir %s", path); */ + eina_stringshare_del(path); + return EINA_TRUE; + } } if (!(match = evry_fuzzy_match(label, p->input)) &&