Fix existing tests

This commit is contained in:
Veronica Berglyd Olsen
2025-03-23 22:37:16 +01:00
parent 762efedb96
commit 34a3a6e85c
26 changed files with 78 additions and 59 deletions
+2 -2
View File
@@ -479,7 +479,7 @@ class Index:
def _generateNovelModel(self, tHandle: str) -> None:
"""Generate a novel model for a specific handle."""
if (item := SHARED.project.tree[tHandle]) and item.isRootType() and item.isNovelLike():
if (item := self._project.tree[tHandle]) and item.isRootType() and item.isNovelLike():
model = NovelModel()
model.setExtraColumn(self._novelExtra)
self._appendSubTreeToModel(tHandle, model)
@@ -488,7 +488,7 @@ class Index:
def _appendSubTreeToModel(self, tHandle: str, model: NovelModel) -> None:
"""Append all active novel documents to a novel model."""
for handle in SHARED.project.tree.subTree(tHandle):
for handle in self._project.tree.subTree(tHandle):
if (
(node := self._itemIndex[handle])
and node.item.isDocumentLayout()
+1 -3
View File
@@ -25,7 +25,6 @@ from __future__ import annotations
import logging
from PyQt5.QtCore import QSize
from PyQt6.QtCore import QAbstractTableModel, QModelIndex, Qt
from PyQt6.QtGui import QIcon, QPixmap
@@ -52,12 +51,11 @@ T_NodeData = str | QIcon | QPixmap | Qt.AlignmentFlag | None
class NovelModel(QAbstractTableModel):
__slots__ = ("_rows", "_header", "_more", "_columns", "_extraKey", "_extraLabel")
__slots__ = ("_rows", "_more", "_columns", "_extraKey", "_extraLabel")
def __init__(self) -> None:
super().__init__()
self._rows: list[dict[int, T_NodeData]] = []
self._header: list[QSize] = []
self._more = SHARED.theme.getIcon("more_arrow")
self._columns = 3
self._extraKey = ""
+4 -4
View File
@@ -69,10 +69,10 @@ class NWProjectData:
self._initCounts = [0, 0]
self._currCounts = [0, 0]
self._lastHandle: dict[str, str | None] = {
"editor": None,
"viewer": None,
"novelTree": None,
"outline": None,
"editor": None,
"viewer": None,
"novel": None,
"outline": None,
}
self._autoReplace: dict[str, str] = {}
self._titleFormat: dict[str, str] = {