diff gui/filebrowser.py @ 170:0296f5f74a0f

Fixed saving and loading that broke with changing of the settings module.
author Beliar <KarstenBock@gmx.net>
date Sat, 25 Feb 2012 22:05:39 +0100
parents 06145a6ee387
children
line wrap: on
line diff
--- a/gui/filebrowser.py	Sat Feb 25 00:21:28 2012 +0100
+++ b/gui/filebrowser.py	Sat Feb 25 22:05:39 2012 +0100
@@ -50,7 +50,9 @@
         # FIXME M. George Hansen 2011-06-06: Not sure that user_path is set
         #     correctly atm. Plus, I don't think that this should be
         #     hard-coded.
-        self.path = os.path.join(self.settings.user_path, 'saves')
+        self.path = os.path.relpath(os.path.join(self.settings.get("parpg", "DataPath"), 'saves'))
+        if not os.path.exists(self.path):
+            os.makedirs(self.path)
         self.dir_list = []
         self.file_list = []
         
@@ -115,7 +117,6 @@
                                     listDirectories(self.path))
         file_list = filter(lambda f: f.split('.')[-1] in self.extensions, \
                            self.engine.getVFS().listFiles(self.path))
-                
         self.dir_list = decodeList(dir_list)
         self.file_list = decodeList(file_list)
         self._widget.distributeInitialData({