Fixed a bug in project open where old projects were converted before asking permision

This commit is contained in:
Veronica K. B. Olsen
2020-09-28 23:39:43 +02:00
parent 28ef1d12b0
commit 5152d80ac4
+13 -7
View File
@@ -390,16 +390,11 @@ class NWProject():
# Check for Old Legacy Data
# =========================
errList = []
legacyList = [] # Cleanup is done later
for projItem in listdir(self.projPath):
logger.verbose("Project contains: %s" % projItem)
if projItem.startswith("data_"):
errList = self._legacyDataFolder(projItem, errList)
if errList:
self.makeAlert(errList, nwAlert.ERROR)
self._deprecatedFiles()
legacyList.append(projItem)
# Project Lock
# ============
@@ -611,6 +606,17 @@ class NWProject():
self.optState.loadSettings()
# Sort out old file locations
if legacyList:
errList = []
for projItem in legacyList:
errList = self._legacyDataFolder(projItem, errList)
if errList:
self.makeAlert(errList, nwAlert.ERROR)
# Clean up old files
self._deprecatedFiles()
# Update recent projects
self.mainConf.updateRecentCache(self.projPath, self.projName, self.lastWCount, time())
self.mainConf.saveRecentCache()