← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~bratsche/appmenu-gtk/rebuild-item-cache-fix into lp:appmenu-gtk

 

Cody Russell has proposed merging lp:~bratsche/appmenu-gtk/rebuild-item-cache-fix into lp:appmenu-gtk.

Requested reviews:
  Canonical Desktop Experience Team (canonical-dx-team)
Related bugs:
  #636962 Nautilus "Open With" items duplicated
  https://bugs.launchpad.net/bugs/636962

-- 
https://code.launchpad.net/~bratsche/appmenu-gtk/rebuild-item-cache-fix/+merge/35296
Your team ayatana-commits is subscribed to branch lp:appmenu-gtk.
=== modified file 'src/bridge.c'
--- src/bridge.c	2010-09-09 18:22:00 +0000
+++ src/bridge.c	2010-09-13 15:31:02 +0000
@@ -878,11 +878,17 @@
                 }
             }
 
-          recurse->stack[recurse->count] = g_hash_table_lookup (recurse->context->lookup, widget);
-          if (!recurse->stack[recurse->count])
+          DbusmenuMenuitem *dmi = g_hash_table_lookup (recurse->context->lookup, widget);
+          if (dmi != NULL)
+            {
+              if (increment)
+                recurse->count--;
+
+              return;
+            }
+          else
             {
               recurse->stack[recurse->count] = construct_dbusmenu_for_widget (widget, previous_separator);
-
               g_hash_table_insert (recurse->context->lookup, widget, recurse->stack[recurse->count]);
             }
 
@@ -921,7 +927,7 @@
               GList *children = NULL;
               GList *peek = NULL;
 
-              if (recurse->stack[recurse->count -1])
+              if (recurse->stack[recurse->count - 1])
                 {
                   children = dbusmenu_menuitem_get_children (recurse->stack[recurse->count - 1]);
 


Follow ups