Version 0.8.1

- memory management improved
- heap corruption is (hopefully) no more
This commit is contained in:
Nikolaj Schlej 2013-11-17 12:13:37 +01:00
parent 3d7dad6bb6
commit 84ce5deeca
5 changed files with 20 additions and 14 deletions

View File

@ -48,10 +48,10 @@ TreeModel* FfsEngine::model() const
void FfsEngine::msg(const QString & message, const QModelIndex index)
{
messageItems.enqueue(new MessageListItem(message, NULL, 0, index));
messageItems.enqueue(MessageListItem(message, NULL, 0, index));
}
QQueue<MessageListItem*> FfsEngine::message()
QQueue<MessageListItem> FfsEngine::message()
{
return messageItems;
}
@ -2018,7 +2018,7 @@ UINT8 FfsEngine::reconstruct(const QModelIndex & index, QQueue<QByteArray> & que
return result;
// Check for auth status valid attribute
if (guidDefinedHeader->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) {
msg(tr("reconstruct: %1: GUID defined section signature can become invalid invalid")
msg(tr("reconstruct: %1: GUID defined section signature can now become invalid")
.arg(guidToQString(guidDefinedHeader->SectionDefinitionGuid)));
}
// Replace new section body

View File

@ -38,7 +38,7 @@ public:
TreeModel* model() const;
// Returns message items queue
QQueue<MessageListItem*> message();
QQueue<MessageListItem> message();
// Firmware image parsing
UINT8 parseInputFile(const QByteArray & buffer);
@ -77,7 +77,7 @@ private:
TreeModel *treeModel;
// Message helper
QQueue<MessageListItem*> messageItems;
QQueue<MessageListItem> messageItems;
void msg(const QString & message, const QModelIndex index = QModelIndex());
// Internal operations

View File

@ -64,6 +64,8 @@ void UEFITool::init()
ui->actionSaveImageFile->setDisabled(true);
// Make new ffsEngine
if (ffsEngine)
delete ffsEngine;
ffsEngine = new FfsEngine(this);
ui->structureTreeView->setModel(ffsEngine->model());
@ -200,10 +202,11 @@ void UEFITool::saveImageFile()
QByteArray reconstructed;
UINT8 result = ffsEngine->reconstructImage(reconstructed);
showMessage();
if (result)
{
ui->statusBar->showMessage(tr("Reconstruction failed (%1)").arg(result));
showMessage();
return;
}
@ -211,7 +214,6 @@ void UEFITool::saveImageFile()
outputFile.write(reconstructed);
outputFile.close();
ui->statusBar->showMessage(tr("Reconstructed image written"));
showMessage();
}
void UEFITool::resizeTreeViewColums()
@ -250,12 +252,12 @@ void UEFITool::openImageFile(QString path)
init();
UINT8 result = ffsEngine->parseInputFile(buffer);
showMessage();
if (result)
ui->statusBar->showMessage(tr("Opened file can't be parsed (%1)").arg(result));
else
ui->statusBar->showMessage(tr("Opened: %1").arg(fileInfo.fileName()));
showMessage();
resizeTreeViewColums();
}
@ -344,9 +346,12 @@ void UEFITool::dropEvent(QDropEvent* event)
void UEFITool::showMessage()
{
ui->messageListWidget->clear();
QQueue<MessageListItem*> messageItems = ffsEngine->message();
if (!ffsEngine)
return;
messageItems = ffsEngine->message();
for (int i = 0; i < messageItems.count(); i++) {
ui->messageListWidget->addItem(messageItems.at(i));
ui->messageListWidget->addItem(new MessageListItem(messageItems.at(i)));
}
}

View File

@ -65,6 +65,7 @@ private slots:
private:
Ui::UEFITool * ui;
FfsEngine* ffsEngine;
QQueue<MessageListItem> messageItems;
void dragEnterEvent(QDragEnterEvent* event);
void dropEvent(QDropEvent* event);

View File

@ -20,7 +20,7 @@
<bool>true</bool>
</property>
<property name="windowTitle">
<string>UEFITool 0.8.0</string>
<string>UEFITool 0.8.1</string>
</property>
<widget class="QWidget" name="centralWidget">
<property name="sizePolicy">