From 4c3d9dc64225fc3dd4142fb85240b3c7d345efa7 Mon Sep 17 00:00:00 2001 From: Ryan Clary Date: Tue, 30 Mar 2021 18:04:52 -0700 Subject: [PATCH] * check for recent files in main project configuration section and move to workspace section --- spyder/plugins/projects/api.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/spyder/plugins/projects/api.py b/spyder/plugins/projects/api.py index 4983a6ce405..5ff412835f1 100644 --- a/spyder/plugins/projects/api.py +++ b/spyder/plugins/projects/api.py @@ -84,7 +84,16 @@ def set_recent_files(self, recent_files): def get_recent_files(self): """Return a list of files opened by the project.""" - recent_files = self.get_option("recent_files", default=[]) + + # Check if recent_files in [main] (Spyder 4) + recent_files = self.get_option("recent_files", 'main', []) + if recent_files: + # Move to [workspace] (Spyder 5) + self.config.remove_option('main', 'recent_files') + self.set_recent_files(recent_files) + else: + recent_files = self.get_option("recent_files", default=[]) + recent_files = [recent_file if os.path.isabs(recent_file) else os.path.join(self.root_path, recent_file) for recent_file in recent_files]