Skip to content

Commit

Permalink
Fix purging of GTK recently used resources list
Browse files Browse the repository at this point in the history
- purge_items() was called in preview mode
- it was called once for each of the two xbel files
- it was not called when the xbel files did not exist

This bug predates commit 0c032ef (December 2012)

Closes #194
  • Loading branch information
az0 committed Feb 9, 2017
1 parent b28ea86 commit 83d09cc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bleachbit/Cleaner.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,19 @@ def get_commands(self, option_id):
# shredding.
#
# https://bugzilla.gnome.org/show_bug.cgi?id=591404

def gtk_purge_items():
"""Purge GTK items"""
gtk.RecentManager().purge_items()
yield 0

for pathname in ["~/.recently-used.xbel", "~/.local/share/recently-used.xbel"]:
pathname = expanduser(pathname)
if os.path.lexists(pathname):
yield Command.Shred(pathname)
if HAVE_GTK:
gtk.RecentManager().purge_items()
if HAVE_GTK:
# Use the Function to skip when in preview mode
yield Command.Function(None, gtk_purge_items, _('Recent documents list'))

if 'posix' == os.name and 'rotated_logs' == option_id:
for path in Unix.rotated_logs():
Expand Down

0 comments on commit 83d09cc

Please sign in to comment.