def fill(self): manager = Gtk.RecentManager.get_default() items = manager.get_items() items.sort(key=lambda i: i.get_visited(), reverse=True) count = 0 for item in items: if item.has_group('pluma'): uri = item.get_uri() if Pluma.utils_uri_exists(uri): self.append(GLib.filename_from_uri(uri)[0]) count += 1 if count >= self.max_recents: break
def restore_open_files(self, window): if self.is_only_window(): settings = Gio.Settings.new(SCHEMA_ID) for uri in settings.get_value('uris'): if Pluma.utils_uri_exists(uri): Pluma.commands_load_uri(window, uri, None, -1)