- introduce Extract Uncompressed and Uncompressed Hex View actions for compressed items

- remove unused code to support Qt 5.5 and earlier Qt versions
- remove unused section parsing code
- add a check and description for section alignment quirk (compiled out for now)
This commit is contained in:
Nikolaj Schlej 2022-08-24 22:17:51 +02:00
parent cc274319bf
commit 12f40cf289
20 changed files with 165 additions and 224 deletions

View file

@ -92,12 +92,7 @@ USTATUS FfsBuilder::buildCapsule(const UModelIndex & index, UByteArray & capsule
}
// Build image
#if ((QT_VERSION_MAJOR == 5) && (QT_VERSION_MINOR < 6)) || (QT_VERSION_MAJOR < 5)
UModelIndex imageIndex = index.child(0, 0);
#else
UModelIndex imageIndex = index.model()->index(0, 0, index);
#endif
UByteArray imageData;
// Check image type
@ -170,19 +165,11 @@ USTATUS FfsBuilder::buildIntelImage(const UModelIndex & index, UByteArray & inte
// Rebuild
else if (model->action(index) == Actions::Rebuild) {
// First child will always be descriptor for this type of image, and it's read only for now
#if ((QT_VERSION_MAJOR == 5) && (QT_VERSION_MINOR < 6)) || (QT_VERSION_MAJOR < 5)
intelImage = model->header(index.child(0, 0)) + model->body(index.child(0, 0)) + model->tail(index.child(0, 0));
#else
intelImage = model->header(index.model()->index(0, 0, index)) + model->body(index.model()->index(0, 0, index)) + model->tail(index.model()->index(0, 0, index));
#endif
// Process other regions
for (int i = 1; i < model->rowCount(index); i++) {
#if ((QT_VERSION_MAJOR == 5) && (QT_VERSION_MINOR < 6)) || (QT_VERSION_MAJOR < 5)
UModelIndex currentRegion = index.child(i, 0);
#else
UModelIndex currentRegion = index.model()->index(i, 0, index);
#endif
// Skip regions with Remove action
if (model->action(currentRegion) == Actions::Remove)
@ -282,14 +269,9 @@ USTATUS FfsBuilder::buildRawArea(const UModelIndex & index, UByteArray & rawArea
// Build children
for (int i = 0; i < model->rowCount(index); i++) {
USTATUS result = U_SUCCESS;
#if ((QT_VERSION_MAJOR == 5) && (QT_VERSION_MINOR < 6)) || (QT_VERSION_MAJOR < 5)
UModelIndex currentChild = index.child(i, 0);
#else
UModelIndex currentChild = index.model()->index(i, 0, index);
#endif
UByteArray currentData;
// Check child type
if (model->type(currentChild) == Types::Volume) {
result = buildVolume(currentChild, currentData);