restore opened file and position

This commit is contained in:
Agel committed 2026-03-16 15:34:15 +01:00
1 parent fcacd0495d
commit 2ecf9f4178
12 files changed
+491 -11

No files matched your search

+21
View File
@@ -88,6 +88,27 @@ private slots:
// After completion, loading should be false
QVERIFY(!ctrl.loading());
}
void currentFilePathInitiallyEmpty()
{
BookController ctrl;
QVERIFY(ctrl.currentFilePath().isEmpty());
}
void currentFilePathSetOnOpen()
{
BookController ctrl;
ctrl.openBook(QUrl::fromLocalFile(fixturePath("sample.txt")));
QCOMPARE(ctrl.currentFilePath(), fixturePath("sample.txt"));
}
void currentFilePathClearedOnClose()
{
BookController ctrl;
ctrl.openBook(QUrl::fromLocalFile(fixturePath("sample.txt")));
ctrl.closeBook();
QVERIFY(ctrl.currentFilePath().isEmpty());
}
};
QTEST_MAIN(BookControllerTest)