Version 0.16.1

- fixed a serious bug in section rebuild process
- opening search windows sets text focus into search edit box
This commit is contained in:
Nikolaj Schlej 2014-01-12 00:02:54 +01:00
parent 1fedb2becf
commit 5789e2f9e6
15 changed files with 641 additions and 670 deletions

View File

@ -1946,13 +1946,13 @@ UINT8 FfsEngine::reconstructRegion(const QModelIndex& index, QByteArray& reconst
// Check size of reconstructed region, it must be same
if (reconstructed.size() > model->body(index).size()) {
msg(tr("reconstructRegion: reconstructed body %1 is bigger then original %2")
msg(tr("reconstructRegion: reconstructed region (%1) is bigger then original (%2)")
.arg(reconstructed.size(), 8, 16, QChar('0'))
.arg(model->body(index).size(), 8, 16, QChar('0')), index);
return ERR_INVALID_PARAMETER;
}
else if (reconstructed.size() < model->body(index).size()) {
msg(tr("reconstructRegion: reconstructed body %1 is smaller then original %2")
msg(tr("reconstructRegion: reconstructed region (%1) is smaller then original (%2)")
.arg(reconstructed.size(), 8, 16, QChar('0'))
.arg(model->body(index).size(), 8, 16, QChar('0')), index);
return ERR_INVALID_PARAMETER;
@ -2009,8 +2009,8 @@ UINT8 FfsEngine::reconstructVolume(const QModelIndex& index, QByteArray& reconst
// Calculate volume base for boot volume
UINT32 volumeBase = 0;
QByteArray file;
if (model->subtype(index) == BootVolume) {
QByteArray file;
bool baseFound = false;
// Search for VTF
for (int i = 0; i < model->rowCount(index); i++) {
@ -2085,6 +2085,7 @@ out:
}
// Reconstruct file
QByteArray file;
result = reconstructFile(index.child(i, 0), volumeHeader->Revision, polarity, volumeBase + offset, file);
if (result)
return result;
@ -2357,7 +2358,7 @@ UINT8 FfsEngine::reconstructFile(const QModelIndex& index, const UINT8 revision,
reconstructed.clear();
// Construct new file body
UINT32 offset = 0;
QByteArray section;
for (int i = 0; i < model->rowCount(index); i++) {
// Align to 4 byte boundary
UINT8 alignment = offset % 4;
@ -2373,6 +2374,7 @@ UINT8 FfsEngine::reconstructFile(const QModelIndex& index, const UINT8 revision,
sectionBase = base + sizeof(EFI_FFS_FILE_HEADER) + offset;
// Reconstruct section
QByteArray section;
result = reconstructSection(index.child(i, 0), sectionBase, section);
if (result)
return result;
@ -2456,9 +2458,10 @@ UINT8 FfsEngine::reconstructSection(const QModelIndex& index, const UINT32 base,
// Reconstruct section with children
if (model->rowCount(index)) {
reconstructed.clear();
// Construct new section body
UINT32 offset = 0;
QByteArray section;
// Reconstruct section body
for (int i = 0; i < model->rowCount(index); i++) {
// Align to 4 byte boundary
@ -2470,6 +2473,7 @@ UINT8 FfsEngine::reconstructSection(const QModelIndex& index, const UINT32 base,
}
// Reconstruct subsections
QByteArray section;
result = reconstruct(index.child(i,0), section);
if (result)
return result;

View File

@ -82,7 +82,7 @@ QVariant TreeModel::headerData(int section, Qt::Orientation orientation,
}
QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent)
const
const
{
if (!hasIndex(row, column, parent))
return QModelIndex();

View File

@ -121,6 +121,9 @@ void UEFITool::populateUi(const QModelIndex &current)
void UEFITool::search()
{
// Set focus to edit box
searchDialog->ui->searchEdit->setFocus();
if (searchDialog->exec() != QDialog::Accepted)
return;

View File

@ -38,7 +38,7 @@
#include "searchdialog.h"
namespace Ui {
class UEFITool;
class UEFITool;
}
class UEFITool : public QMainWindow

View File

@ -20,7 +20,7 @@
<bool>true</bool>
</property>
<property name="windowTitle">
<string>UEFITool 0.16.0</string>
<string>UEFITool 0.16.1</string>
</property>
<widget class="QWidget" name="centralWidget">
<property name="sizePolicy">
@ -33,16 +33,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>0</number>
</property>
<item>
@ -62,16 +53,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>5</number>
</property>
<item>
@ -109,16 +91,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>5</number>
</property>
<item>
@ -148,16 +121,7 @@
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>5</number>
</property>
<property name="topMargin">
<number>5</number>
</property>
<property name="rightMargin">
<number>5</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>5</number>
</property>
<item>