Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions manuskript/models/characterModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,20 @@ def getCharactersByImportance(self):

return r

def getPovCharactersByImportance(self):
"""
Lists characters with POV activated by importance.

@return: array of array of ´character´, by importance.
"""
r = [[], [], []]

for c in self.characters:
if c.pov():
r[2-int(c.importance())].append(c)

return r

def getCharacterByID(self, ID):
if ID != None:
ID = str(ID)
Expand Down
2 changes: 1 addition & 1 deletion manuskript/models/characterPOVModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def filterAcceptsRow(self, sourceRow, sourceParent):
# this is simpler to do, actually works and also more ideomatic Qt code.
index = self.sourceModel().index(sourceRow, C.pov.value, sourceParent)
value = self.sourceModel().data(index)
return bool(value)
return value == 'True'

def rowToSource(self, row):
index = self.index(row, 0)
Expand Down
2 changes: 1 addition & 1 deletion manuskript/ui/views/storylineView.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def charactersReferences(self):
if not self._mdlCharacter:
pass

chars = self._mdlCharacter.getCharactersByImportance()
chars = self._mdlCharacter.getPovCharactersByImportance()
r = []
for importance in chars:
for c in importance:
Expand Down