From 3a77392cbb6566c554b871d19724df84df1804df Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Tue, 30 Jul 2013 14:57:55 +0000 Subject: [PATCH] 6663: RecentFiles.do_save() doesn't do XML escape As John Ralls suggested, wrapped the path/db name in a CDATA section upon writeout. In DisplayState, instead of escaping _, tell gtk to ignore the underline; add logging to help seeing ignored files. svn: r22773 --- src/DisplayState.py | 5 +++-- src/RecentFiles.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/DisplayState.py b/src/DisplayState.py index cdf7b4988..3f6d1ed88 100644 --- a/src/DisplayState.py +++ b/src/DisplayState.py @@ -273,17 +273,18 @@ class RecentDocsMenu(object): for item in rfiles: try: - title = item.get_name().replace('_', '__') + title = item.get_name() filename = os.path.basename(item.get_path()) action_id = "RecentMenu%d" % count buf.write('' % action_id) actions.append((action_id, None, title, None, None, make_callback(item, self.load))) - mitem = gtk.MenuItem(title) + mitem = gtk.MenuItem(title, use_underline=False) mitem.connect('activate', make_callback(item, self.load)) mitem.show() new_menu.append(mitem) except RuntimeError: + _LOG.info("Ignoring the RecentItem %s (%s)" % (title, filename)) pass # ignore no longer existing files count += 1 diff --git a/src/RecentFiles.py b/src/RecentFiles.py index ac320eed9..f436edbae 100644 --- a/src/RecentFiles.py +++ b/src/RecentFiles.py @@ -173,8 +173,8 @@ class RecentFiles(object): if index > MAX_GRAMPS_ITEMS: break xml_file.write(' \n') - xml_file.write(' %s\n' % item.get_path()) - xml_file.write(' %s\n' % item.get_name()) + xml_file.write(' \n' % item.get_path()) + xml_file.write(' \n' % item.get_name()) xml_file.write(' %d\n' % item.get_time()) xml_file.write(' \n') xml_file.write('\n')