diff --git a/Alacarte/MenuEditor.py b/Alacarte/MenuEditor.py
index 73dd6c0..3f81099 100644
--- a/Alacarte/MenuEditor.py
+++ b/Alacarte/MenuEditor.py
@@ -477,13 +477,7 @@ class MenuEditor:
 		return True
 
 	def __getPath(self, menu, path=None):
-		if not path:
-                        path = menu.tree.root.get_menu_id()
-		if menu.get_parent():
-			path = self.__getPath(menu.get_parent(), path)
-			path += '/'
-			path += menu.menu_id
-		return path
+		return '/'.join([d.menu_id for d in menu.real_path if hasattr(d, 'menu_id')])
 
 	def __getXmlMenu(self, path, element, dom):
 		if '/' in path:
