[meld] recent: Remove RecentFiles argument so we can move it from MeldApp



commit 01937d00c8cd2f20e2c95a7028a0d974a4a03e30
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Dec 21 06:49:30 2013 +1000

    recent: Remove RecentFiles argument so we can move it from MeldApp

 meld/meldapp.py |    2 +-
 meld/recent.py  |    8 +++-----
 2 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/meld/meldapp.py b/meld/meldapp.py
index d21966d..0a03fe0 100644
--- a/meld/meldapp.py
+++ b/meld/meldapp.py
@@ -43,7 +43,7 @@ class MeldApp(Gtk.Application):
         self.set_application_id("org.gnome.meld")
         GObject.set_application_name("Meld")
         Gtk.Window.set_default_icon_name("meld")
-        self.recent_comparisons = meld.recent.RecentFiles(sys.argv[0])
+        self.recent_comparisons = meld.recent.RecentFiles()
         self.window = None
 
     def do_startup(self):
diff --git a/meld/recent.py b/meld/recent.py
index b4a20ed..0f0318d 100644
--- a/meld/recent.py
+++ b/meld/recent.py
@@ -32,6 +32,7 @@ try:
 except ImportError:
     import ConfigParser as configparser
 import os
+import sys
 import tempfile
 
 from gettext import gettext as _
@@ -58,16 +59,13 @@ class RecentFiles(object):
 
     # Recent data
     app_name = "Meld"
-    app_exec = "meld"
 
-    def __init__(self, exec_path=None):
+    def __init__(self):
         self.recent_manager = Gtk.RecentManager.get_default()
         self.recent_filter = Gtk.RecentFilter()
         self.recent_filter.add_application(self.app_name)
         self._stored_comparisons = []
-        # Should be argv[0] to support roundtripping in uninstalled use
-        if exec_path:
-            self.app_exec = os.path.abspath(exec_path)
+        self.app_exec = os.path.abspath(sys.argv[0])
 
         if not os.path.exists(self.recent_path):
             os.makedirs(self.recent_path)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]