Skip to content

Commit 166e31b

Browse files
committed
recent: Use MIME type instead of application name
This is probably more correct, but actually motivated by https://bugzilla.gnome.org/show_bug.cgi?id=695970
1 parent 11f03bc commit 166e31b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

meld/recent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
class RecentFiles(object):
5252

53+
mime_type = "application/x-meld-comparison"
5354
recent_path = os.path.join(GLib.get_user_data_dir(), "meld")
5455
recent_path = recent_path.decode('utf8')
5556
recent_suffix = ".meldcmp"
@@ -60,7 +61,7 @@ class RecentFiles(object):
6061
def __init__(self):
6162
self.recent_manager = Gtk.RecentManager.get_default()
6263
self.recent_filter = Gtk.RecentFilter()
63-
self.recent_filter.add_application(self.app_name)
64+
self.recent_filter.add_mime_type(self.mime_type)
6465
self._stored_comparisons = []
6566
self.app_exec = os.path.abspath(sys.argv[0])
6667

@@ -106,7 +107,7 @@ def add(self, tab, flags=None):
106107
description = "%s comparison\n%s" % (comp_type, ", ".join(paths))
107108

108109
recent_metadata = Gtk.RecentData()
109-
recent_metadata.mime_type = "application/x-meld-comparison"
110+
recent_metadata.mime_type = self.mime_type
110111
recent_metadata.app_name = self.app_name
111112
recent_metadata.app_exec = "%s --comparison-file %%u" % self.app_exec
112113
recent_metadata.display_name = display_name.encode('utf8')

0 commit comments

Comments
 (0)