MCPcopy Create free account
hub / github.com/YACReader/yacreader / get_double_pages

Function get_double_pages

common/comic.cpp:1022–1035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1020}
1021
1022void get_double_pages(const QList<QString> &pageNames, QList<QString> &singlePageNames /*out*/, QList<QString> &doublePageNames /*out*/)
1023{
1024 uint maxExpectedDoublePagesNumberLenght = (int)(log10(pageNames.length()) + 1) * 2;
1025
1026 QString mostCommonPrefix = get_most_common_prefix(pageNames);
1027
1028 for (const QString &pageName : std::as_const(pageNames)) {
1029 if (is_double_page(pageName.split('/').last(), mostCommonPrefix, maxExpectedDoublePagesNumberLenght)) {
1030 doublePageNames.append(pageName);
1031 } else {
1032 singlePageNames.append(pageName);
1033 }
1034 }
1035}
1036
1037QList<QString> merge_pages(QList<QString> &singlePageNames, QList<QString> &doublePageNames)
1038{

Callers 1

comic_pages_sortFunction · 0.85

Calls 3

get_most_common_prefixFunction · 0.85
is_double_pageFunction · 0.85
splitMethod · 0.80

Tested by

no test coverage detected