| 84 | } |
| 85 | |
| 86 | std::pair<int, bool> ResourcePack::compare(const Resource& other, SortType type) const |
| 87 | { |
| 88 | auto const& cast_other = static_cast<ResourcePack const&>(other); |
| 89 | |
| 90 | switch (type) { |
| 91 | default: { |
| 92 | auto res = Resource::compare(other, type); |
| 93 | if (res.first != 0) |
| 94 | return res; |
| 95 | [[fallthrough]]; |
| 96 | } |
| 97 | case SortType::PACK_FORMAT: { |
| 98 | auto this_ver = packFormat(); |
| 99 | auto other_ver = cast_other.packFormat(); |
| 100 | |
| 101 | if (this_ver > other_ver) |
| 102 | return { 1, type == SortType::PACK_FORMAT }; |
| 103 | if (this_ver < other_ver) |
| 104 | return { -1, type == SortType::PACK_FORMAT }; |
| 105 | } |
| 106 | } |
| 107 | return { 0, false }; |
| 108 | } |
| 109 | |
| 110 | bool ResourcePack::applyFilter(QRegularExpression filter) const |
| 111 | { |
nothing calls this directly
no test coverage detected