Adjust syntax

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
TheJackiMonster 2023-02-09 22:13:01 +01:00
parent a88b61fbcd
commit ee76b2d84e
No known key found for this signature in database
GPG key ID: D850A5F772E880F9
2 changed files with 8 additions and 5 deletions

View file

@ -266,9 +266,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
targets = [
self.treeRedacOutline,
self.mainEditor
]
]
while new != None:
while new is not None:
if new in targets:
self._lastFocus = new
break
@ -851,7 +851,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
# risk a scenario where the timer somehow triggers a new save while saving.
self.saveTimerNoChanges.stop()
if self.currentProject == None:
if self.currentProject is None:
# No UI feedback here as this code path indicates a race condition that happens
# after the user has already closed the project through some way. But in that
# scenario, this code should not be reachable to begin with.
@ -1407,7 +1407,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
dictionaries = Spellchecker.availableDictionaries()
# Set first run dictionary
if settings.dict == None:
if settings.dict is None:
settings.dict = Spellchecker.getDefaultDictionary()
# Check if project dict is unavailable on this machine
@ -1623,7 +1623,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
w.cmbPOV.setVisible(val)
# POV in outline view
if val == None and Outline.POV in settings.outlineViewColumns:
if val is None and Outline.POV in settings.outlineViewColumns:
settings.outlineViewColumns.remove(Outline.POV)
from manuskript.ui.views.outlineView import outlineView

View file

@ -143,6 +143,9 @@ class mainEditor(QWidget, Ui_mainEditor):
self.updateThingsVisible(index)
def updateMainTreeView(self, index):
if not index.isValid():
return
self._updating = True
self.mw.treeRedacOutline.setCurrentIndex(index)
self._updating = False