mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-06-10 15:04:34 +12:00
apply patch per PR feedback to avoid segfault (fixes olivierkes#950)
This commit is contained in:
parent
5a6d68e139
commit
750b96e18e
|
@ -63,6 +63,6 @@ def loadProject(project):
|
||||||
LOGGER.info("Detected file format version: {}. Zip: {}.".format(version, isZip))
|
LOGGER.info("Detected file format version: {}. Zip: {}.".format(version, isZip))
|
||||||
|
|
||||||
if version == 0:
|
if version == 0:
|
||||||
v0.loadProject(project)
|
return v0.loadProject(project)
|
||||||
else:
|
else:
|
||||||
v1.loadProject(project, zip=isZip)
|
return v1.loadProject(project, zip=isZip)
|
||||||
|
|
|
@ -430,13 +430,13 @@ def saveProject(zip=None):
|
||||||
filesWithPermissionErrors.append(project)
|
filesWithPermissionErrors.append(project)
|
||||||
|
|
||||||
if len(filesWithPermissionErrors) > 0:
|
if len(filesWithPermissionErrors) > 0:
|
||||||
dlg = ListDialog()
|
dlg = ListDialog(mw)
|
||||||
dlg.setModal(True)
|
dlg.setModal(True)
|
||||||
dlg.setWindowTitle(dlg.tr("Files not saved"))
|
dlg.setWindowTitle(dlg.tr("Files not saved"))
|
||||||
dlg.label.setText(dlg.tr("The following files were not saved and appear to be open in another program"))
|
dlg.label.setText(dlg.tr("The following files were not saved and appear to be open in another program"))
|
||||||
for f in filesWithPermissionErrors:
|
for f in filesWithPermissionErrors:
|
||||||
QListWidgetItem(f, dlg.listWidget)
|
QListWidgetItem(f, dlg.listWidget)
|
||||||
dlg.exec()
|
dlg.open()
|
||||||
|
|
||||||
if project in filesWithPermissionErrors:
|
if project in filesWithPermissionErrors:
|
||||||
return False
|
return False
|
||||||
|
@ -920,13 +920,13 @@ def loadProject(project, zip=None):
|
||||||
mdl.rootItem.checkIDs()
|
mdl.rootItem.checkIDs()
|
||||||
|
|
||||||
if len(filesWithPermissionErrors) > 0:
|
if len(filesWithPermissionErrors) > 0:
|
||||||
dlg = ListDialog()
|
dlg = ListDialog(mw)
|
||||||
dlg.setModal(True)
|
dlg.setModal(True)
|
||||||
dlg.setWindowTitle(dlg.tr("Files not loaded"))
|
dlg.setWindowTitle(dlg.tr("Files not loaded"))
|
||||||
dlg.label.setText(dlg.tr("The following files were not loaded and appear to be open in another program"))
|
dlg.label.setText(dlg.tr("The following files were not loaded and appear to be open in another program"))
|
||||||
for f in filesWithPermissionErrors:
|
for f in filesWithPermissionErrors:
|
||||||
QListWidgetItem(f, dlg.listWidget)
|
QListWidgetItem(f, dlg.listWidget)
|
||||||
dlg.exec()
|
dlg.open()
|
||||||
|
|
||||||
return errors
|
return errors
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue