mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 16:08:23 +08:00
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:
parent
1fedb2becf
commit
5789e2f9e6
@ -1946,13 +1946,13 @@ UINT8 FfsEngine::reconstructRegion(const QModelIndex& index, QByteArray& reconst
|
|||||||
|
|
||||||
// Check size of reconstructed region, it must be same
|
// Check size of reconstructed region, it must be same
|
||||||
if (reconstructed.size() > model->body(index).size()) {
|
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(reconstructed.size(), 8, 16, QChar('0'))
|
||||||
.arg(model->body(index).size(), 8, 16, QChar('0')), index);
|
.arg(model->body(index).size(), 8, 16, QChar('0')), index);
|
||||||
return ERR_INVALID_PARAMETER;
|
return ERR_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
else if (reconstructed.size() < model->body(index).size()) {
|
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(reconstructed.size(), 8, 16, QChar('0'))
|
||||||
.arg(model->body(index).size(), 8, 16, QChar('0')), index);
|
.arg(model->body(index).size(), 8, 16, QChar('0')), index);
|
||||||
return ERR_INVALID_PARAMETER;
|
return ERR_INVALID_PARAMETER;
|
||||||
@ -2009,8 +2009,8 @@ UINT8 FfsEngine::reconstructVolume(const QModelIndex& index, QByteArray& reconst
|
|||||||
|
|
||||||
// Calculate volume base for boot volume
|
// Calculate volume base for boot volume
|
||||||
UINT32 volumeBase = 0;
|
UINT32 volumeBase = 0;
|
||||||
QByteArray file;
|
|
||||||
if (model->subtype(index) == BootVolume) {
|
if (model->subtype(index) == BootVolume) {
|
||||||
|
QByteArray file;
|
||||||
bool baseFound = false;
|
bool baseFound = false;
|
||||||
// Search for VTF
|
// Search for VTF
|
||||||
for (int i = 0; i < model->rowCount(index); i++) {
|
for (int i = 0; i < model->rowCount(index); i++) {
|
||||||
@ -2085,6 +2085,7 @@ out:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reconstruct file
|
// Reconstruct file
|
||||||
|
QByteArray file;
|
||||||
result = reconstructFile(index.child(i, 0), volumeHeader->Revision, polarity, volumeBase + offset, file);
|
result = reconstructFile(index.child(i, 0), volumeHeader->Revision, polarity, volumeBase + offset, file);
|
||||||
if (result)
|
if (result)
|
||||||
return result;
|
return result;
|
||||||
@ -2357,7 +2358,7 @@ UINT8 FfsEngine::reconstructFile(const QModelIndex& index, const UINT8 revision,
|
|||||||
reconstructed.clear();
|
reconstructed.clear();
|
||||||
// Construct new file body
|
// Construct new file body
|
||||||
UINT32 offset = 0;
|
UINT32 offset = 0;
|
||||||
QByteArray section;
|
|
||||||
for (int i = 0; i < model->rowCount(index); i++) {
|
for (int i = 0; i < model->rowCount(index); i++) {
|
||||||
// Align to 4 byte boundary
|
// Align to 4 byte boundary
|
||||||
UINT8 alignment = offset % 4;
|
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;
|
sectionBase = base + sizeof(EFI_FFS_FILE_HEADER) + offset;
|
||||||
|
|
||||||
// Reconstruct section
|
// Reconstruct section
|
||||||
|
QByteArray section;
|
||||||
result = reconstructSection(index.child(i, 0), sectionBase, section);
|
result = reconstructSection(index.child(i, 0), sectionBase, section);
|
||||||
if (result)
|
if (result)
|
||||||
return result;
|
return result;
|
||||||
@ -2456,9 +2458,10 @@ UINT8 FfsEngine::reconstructSection(const QModelIndex& index, const UINT32 base,
|
|||||||
|
|
||||||
// Reconstruct section with children
|
// Reconstruct section with children
|
||||||
if (model->rowCount(index)) {
|
if (model->rowCount(index)) {
|
||||||
|
reconstructed.clear();
|
||||||
// Construct new section body
|
// Construct new section body
|
||||||
UINT32 offset = 0;
|
UINT32 offset = 0;
|
||||||
QByteArray section;
|
|
||||||
// Reconstruct section body
|
// Reconstruct section body
|
||||||
for (int i = 0; i < model->rowCount(index); i++) {
|
for (int i = 0; i < model->rowCount(index); i++) {
|
||||||
// Align to 4 byte boundary
|
// Align to 4 byte boundary
|
||||||
@ -2470,6 +2473,7 @@ UINT8 FfsEngine::reconstructSection(const QModelIndex& index, const UINT32 base,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Reconstruct subsections
|
// Reconstruct subsections
|
||||||
|
QByteArray section;
|
||||||
result = reconstruct(index.child(i,0), section);
|
result = reconstruct(index.child(i,0), section);
|
||||||
if (result)
|
if (result)
|
||||||
return result;
|
return result;
|
||||||
|
@ -82,7 +82,7 @@ QVariant TreeModel::headerData(int section, Qt::Orientation orientation,
|
|||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent)
|
QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent)
|
||||||
const
|
const
|
||||||
{
|
{
|
||||||
if (!hasIndex(row, column, parent))
|
if (!hasIndex(row, column, parent))
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
|
@ -121,6 +121,9 @@ void UEFITool::populateUi(const QModelIndex ¤t)
|
|||||||
|
|
||||||
void UEFITool::search()
|
void UEFITool::search()
|
||||||
{
|
{
|
||||||
|
// Set focus to edit box
|
||||||
|
searchDialog->ui->searchEdit->setFocus();
|
||||||
|
|
||||||
if (searchDialog->exec() != QDialog::Accepted)
|
if (searchDialog->exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include "searchdialog.h"
|
#include "searchdialog.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class UEFITool;
|
class UEFITool;
|
||||||
}
|
}
|
||||||
|
|
||||||
class UEFITool : public QMainWindow
|
class UEFITool : public QMainWindow
|
||||||
|
46
uefitool.ui
46
uefitool.ui
@ -20,7 +20,7 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>UEFITool 0.16.0</string>
|
<string>UEFITool 0.16.1</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralWidget">
|
<widget class="QWidget" name="centralWidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -33,16 +33,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -62,16 +53,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -109,16 +91,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -148,16 +121,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>5</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>5</number>
|
<number>5</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
Loading…
Reference in New Issue
Block a user