[gnoduino] autopurge bogus items from recent menu list
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnoduino] autopurge bogus items from recent menu list
- Date: Mon, 26 May 2014 13:59:32 +0000 (UTC)
commit 0f9d76b1837a21447757c36635e4a9df8af642e9
Author: Lucian Langa <lucilanga gnome org>
Date: Mon May 26 15:58:53 2014 +0200
autopurge bogus items from recent menu list
src/ui.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/ui.py b/src/ui.py
index cc9aef2..c404792 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -545,6 +545,13 @@ def recentMenuActivated(widget):
processFile(urlparse.urlparse(widget.get_current_uri()).path)
def createRecentMenu():
+ """purge nonexistant (NA moved) items"""
+ for i in recentmanager.get_items():
+ if str(i.get_applications()[0]) == 'gnoduino':
+ file = urlparse.urlparse(i.get_uri()).path
+ if os.path.exists(file) is False:
+ recentmanager.remove_item(i.get_uri())
+
menuRecent = gtk.RecentChooserMenu(recentmanager)
menuRecent.set_limit(10)
menuRecent.set_sort_type(gtk.RECENT_SORT_MRU)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]