Updated Resource Pack Formats

superseeds #4242
also this adds support for min_format and max_format and the major.minor
versioning.

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-03-17 00:40:49 +02:00
parent 98c3129424
commit d3f8dfe65c
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
7 changed files with 309 additions and 115 deletions

View file

@ -69,17 +69,8 @@ QVariant DataPackFolderModel::data(const QModelIndex& index, int role) const
case Qt::DisplayRole:
switch (column) {
case PackFormatColumn: {
auto& resource = at(row);
auto pack_format = resource.packFormat();
if (pack_format == 0)
return tr("Unrecognized");
auto version_bounds = resource.compatibleVersions();
if (version_bounds.first.toString().isEmpty())
return QString::number(pack_format);
return QString("%1 (%2 - %3)")
.arg(QString::number(pack_format), version_bounds.first.toString(), version_bounds.second.toString());
const auto& resource = at(row);
return resource.packFormatStr();
}
}
break;
@ -118,7 +109,7 @@ QVariant DataPackFolderModel::data(const QModelIndex& index, int role) const
case ProviderColumn:
mappedIndex = index.siblingAtColumn(ResourceFolderModel::ProviderColumn);
break;
// FIXME: there is no size column due to an oversight
// FIXME: there is no size column due to an oversight
}
if (mappedIndex.isValid()) {