From 2443560c1ded59c4f4643e7e0da35bd995ba8265 Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Mon, 2 Nov 2015 21:48:00 +0100 Subject: [PATCH] Qt4 compatibility --- UEFITool/ffsfinder.cpp | 2 +- UEFITool/ffsfinder.h | 3 +++ UEFITool/uefitool.cpp | 4 ++-- common/ffsparser.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/UEFITool/ffsfinder.cpp b/UEFITool/ffsfinder.cpp index 17ab1f2..9baa632 100644 --- a/UEFITool/ffsfinder.cpp +++ b/UEFITool/ffsfinder.cpp @@ -138,7 +138,7 @@ STATUS FfsFinder::findGuidPattern(const QModelIndex & index, const QByteArray & if (hexPattern.count('.') == hexPattern.length()) return ERR_SUCCESS; - QRegExp regexp = QRegExp(QString(hexPattern), Qt::CaseInsensitive); + QRegExp regexp(QString(hexPattern), Qt::CaseInsensitive); INT32 offset = regexp.indexIn(hexBody); while (offset >= 0) { if (offset % 2 == 0) { diff --git a/UEFITool/ffsfinder.h b/UEFITool/ffsfinder.h index 5e49d77..2411e55 100644 --- a/UEFITool/ffsfinder.h +++ b/UEFITool/ffsfinder.h @@ -18,6 +18,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include +#include +#include #include "../common/basetypes.h" #include "../common/treemodel.h" diff --git a/UEFITool/uefitool.cpp b/UEFITool/uefitool.cpp index 81e59e0..5385307 100644 --- a/UEFITool/uefitool.cpp +++ b/UEFITool/uefitool.cpp @@ -899,7 +899,7 @@ void UEFITool::showFitTable() // Set up the FIT table ui->fitTableWidget->clear(); - ui->fitTableWidget->setRowCount(fitTable.length()); + ui->fitTableWidget->setRowCount(fitTable.size()); ui->fitTableWidget->setColumnCount(5); ui->fitTableWidget->setHorizontalHeaderLabels(QStringList() << tr("Address") << tr("Size") << tr("Version") << tr("Type") << tr("Checksum")); ui->fitTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); @@ -908,7 +908,7 @@ void UEFITool::showFitTable() ui->fitTableWidget->horizontalHeader()->setStretchLastSection(true); // Add all data to the table widget - for (INT32 i = 0; i < fitTable.length(); i++) { + for (INT32 i = 0; i < fitTable.size(); i++) { for (UINT8 j = 0; j < 5; j++) { ui->fitTableWidget->setItem(i, j, new QTableWidgetItem(fitTable[i][j])); } diff --git a/common/ffsparser.cpp b/common/ffsparser.cpp index fcc6a1e..e4688ec 100644 --- a/common/ffsparser.cpp +++ b/common/ffsparser.cpp @@ -1844,7 +1844,7 @@ STATUS FfsParser::parseGuidedSectionHeader(const QByteArray & section, const UIN // Obtain header fields const EFI_COMMON_SECTION_HEADER* sectionHeader = (const EFI_COMMON_SECTION_HEADER*)(section.constData()); - const EFI_GUID_DEFINED_SECTION* guidDefinedSectionHeader = guidDefinedSectionHeader = (const EFI_GUID_DEFINED_SECTION*)sectionHeader; + const EFI_GUID_DEFINED_SECTION* guidDefinedSectionHeader = (const EFI_GUID_DEFINED_SECTION*)sectionHeader; EFI_GUID guid = guidDefinedSectionHeader->SectionDefinitionGuid; UINT16 dataOffset = guidDefinedSectionHeader->DataOffset; UINT16 attributes = guidDefinedSectionHeader->Attributes;