Skip to content

Commit

Permalink
Adjust syntax
Browse files Browse the repository at this point in the history
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
  • Loading branch information
TheJackiMonster committed Feb 9, 2023
1 parent a88b61f commit ee76b2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions manuskript/mainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ def focusChanged(self, old, new):
targets = [
self.treeRedacOutline,
self.mainEditor
]
]

while new != None:
while new is not None:
if new in targets:
self._lastFocus = new
break
Expand Down Expand Up @@ -851,7 +851,7 @@ def saveDatas(self, projectName=None):
# 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.
Expand Down Expand Up @@ -1407,7 +1407,7 @@ def updateMenuDict(self):
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
Expand Down Expand Up @@ -1623,7 +1623,7 @@ def viewModeFictionVisibilitySwitch(self, val):
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
Expand Down
3 changes: 3 additions & 0 deletions manuskript/ui/editors/mainEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ def tabChanged(self, index=QModelIndex()):
self.updateThingsVisible(index)

def updateMainTreeView(self, index):
if not index.isValid():
return

self._updating = True
self.mw.treeRedacOutline.setCurrentIndex(index)
self._updating = False
Expand Down

0 comments on commit ee76b2d

Please sign in to comment.