Fixing bug while loading recent projects open path with old configurations
authorlaurent
Wed, 25 Jul 2012 17:37:29 +0200
changeset 793 1b24b970a816
parent 792 fd113777d1ae
child 794 5bbf57905011
Fixing bug while loading recent projects open path with old configurations
Beremiz.py
--- a/Beremiz.py	Mon Jul 23 02:53:02 2012 +0200
+++ b/Beremiz.py	Wed Jul 25 17:37:29 2012 +0200
@@ -652,8 +652,11 @@
             self.FileMenu.Enable(wx.ID_CLOSE_ALL, False)
     
     def RefreshRecentProjectsMenu(self):
-        recent_projects = map(DecodeFileSystemPath, 
-                              self.GetConfigEntry("RecentProjects", []))
+        try:
+            recent_projects = map(DecodeFileSystemPath, 
+                                  self.GetConfigEntry("RecentProjects", []))
+        except:
+            recent_projects = []
         self.FileMenu.Enable(ID_FILEMENURECENTPROJECTS, len(recent_projects) > 0)
         for idx, projectpath in enumerate(recent_projects):
             text = u'%d: %s' % (idx + 1, projectpath)
@@ -788,8 +791,11 @@
             self.DebugVariablePanel.SetDataProducer(None)
     
     def RefreshConfigRecentProjects(self, projectpath):
-        recent_projects = map(DecodeFileSystemPath, 
-                              self.GetConfigEntry("RecentProjects", []))
+        try:
+            recent_projects = map(DecodeFileSystemPath, 
+                                  self.GetConfigEntry("RecentProjects", []))
+        except:
+            recent_projects = []
         if projectpath in recent_projects:
             recent_projects.remove(projectpath)
         recent_projects.insert(0, projectpath)