old render cleanup part 2

This commit is contained in:
Agel committed 2026-10-25 15:10:38 +01:00
1 parent acc7e71e7b
commit cef762c3ee
40 files changed
+329 -3643

No files matched your search

+2 -29
View File
@@ -37,21 +37,10 @@ private slots:
QCOMPARE(parsed.sourcePath, sourcePath);
}
void roundTripThroughImageUrl()
{
const QString sourcePath = QStringLiteral("/books/unicode путь.cbz");
const QString url = ImageUrl::build(QStringLiteral("cbz"),
QStringLiteral("dir/page01.jpg"), sourcePath);
const auto parsed = ImageUrl::parseImageUrl(QUrl(url));
QCOMPARE(parsed.entry, QStringLiteral("dir/page01.jpg"));
QCOMPARE(parsed.sourcePath, sourcePath);
}
void providerIdWithoutQueryHasEmptySourcePath()
{
const auto parsed = ImageUrl::parseProviderId(QStringLiteral("OEBPS/img.png"));
QCOMPARE(parsed.entry, QStringLiteral("OEBPS/img.png"));
const auto parsed = ImageUrl::parseProviderId(QStringLiteral("page01.png"));
QCOMPARE(parsed.entry, QStringLiteral("page01.png"));
QVERIFY(parsed.sourcePath.isEmpty());
}
@@ -61,22 +50,6 @@ private slots:
const auto parsed = ImageUrl::parseProviderId(QStringLiteral("page%2001.jpg"));
QCOMPARE(parsed.entry, QStringLiteral("page 01.jpg"));
}
void entryWithSlashesSurvivesParsing()
{
const auto parsed = ImageUrl::parseImageUrl(
QUrl(QStringLiteral("image://dir/nested/deep/page.png")));
QCOMPARE(parsed.entry, QStringLiteral("nested/deep/page.png"));
QVERIFY(parsed.sourcePath.isEmpty());
}
void querySuffixMatchesBuild()
{
const QString sourcePath = QStringLiteral("/tmp/a b.fb2");
QCOMPARE(ImageUrl::build(QStringLiteral("fb2"), QStringLiteral("cover"), sourcePath),
ImageUrl::build(QStringLiteral("fb2"), QStringLiteral("cover"))
+ ImageUrl::querySuffix(sourcePath));
}
};
QTEST_MAIN(ImageUrlTest)