aboutsummaryrefslogtreecommitdiff
path: root/x11/menu-cache
diff options
context:
space:
mode:
authorKris Moore <kmoore@FreeBSD.org>2011-03-17 15:14:56 +0000
committerKris Moore <kmoore@FreeBSD.org>2011-03-17 15:14:56 +0000
commitba4bdeed25f21e705c69b8cb96706614e1e4f576 (patch)
tree8606a02aa064e5e8a9f2663d7d0d8472a940920d /x11/menu-cache
parentb4c88ee7c5aa7d7d9093939849cb83eba5475c5d (diff)
downloadports-ba4bdeed25f21e705c69b8cb96706614e1e4f576.tar.gz
ports-ba4bdeed25f21e705c69b8cb96706614e1e4f576.zip
- Fixed a bug causing unnecessary menu cache reload and related issues with LXDE launch menu
- Bump PORTREVISION
Notes
Notes: svn path=/head/; revision=271119
Diffstat (limited to 'x11/menu-cache')
-rw-r--r--x11/menu-cache/Makefile1
-rw-r--r--x11/menu-cache/files/patch-menu-cached.c32
2 files changed, 33 insertions, 0 deletions
diff --git a/x11/menu-cache/Makefile b/x11/menu-cache/Makefile
index 75d8c3fc0eaf..a3248758d546 100644
--- a/x11/menu-cache/Makefile
+++ b/x11/menu-cache/Makefile
@@ -7,6 +7,7 @@
PORTNAME= menu-cache
PORTVERSION= 0.3.2
+PORTREVISION= 1
CATEGORIES= x11
MASTER_SITES= SF/lxde/menu-cache/menu-cache%20${PORTVERSION}/
diff --git a/x11/menu-cache/files/patch-menu-cached.c b/x11/menu-cache/files/patch-menu-cached.c
new file mode 100644
index 000000000000..c70d4d966117
--- /dev/null
+++ b/x11/menu-cache/files/patch-menu-cached.c
@@ -0,0 +1,32 @@
+--- menu-cache-daemon/menu-cached.c.o 2011-03-17 10:58:03.876822788 -0400
++++ menu-cache-daemon/menu-cached.c 2011-03-17 10:58:49.355824755 -0400
+@@ -341,6 +341,29 @@
+ GFileMonitorEvent evt, Cache* cache )
+ {
+ /* DEBUG("file %s is changed (%d).", g_file_get_path(gf), evt); */
++
++ if ( evt == G_FILE_MONITOR_EVENT_DELETED )
++ {
++ int idx;
++ /* dirty hack: get index of the monitor in array */
++ for(idx = 0; idx < cache->n_files; ++idx)
++ {
++ if(mon == cache->mons[idx])
++ break;
++ }
++
++ /* Check if this file or directory was already removed from the cache */
++ char* changed_file = g_file_get_path(gf);
++ char* dir_path = cache->files[idx]+1;
++ int len = strlen(dir_path);
++ char* base_name = changed_file + len + 1;
++ gboolean in_cache = is_desktop_file_in_cache(cache, idx, base_name);
++ if( ! in_cache ) { /* Means this file was already deleted, no need to refresh cache */
++ DEBUG("files are changed, but no re-generation is needed.");
++ return;
++ }
++ }
++
+ /* if( mon != cache->cache_mon ) */
+ {
+ /* Optimization: Some files in the dir are changed, but it