From c916bcd04922bba32fe3f9e98059cec7700f4361 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 9 Jul 2021 08:42:47 +0200 Subject: [PATCH] ProjectExplorer: Use FilePath::readContents() for API detection Change-Id: I3f19ed8ffc99f43fde4b7e5edbb53f92c7ef17ab Reviewed-by: Christian Stenger --- src/plugins/projectexplorer/abi.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 0582fb4d3aa..ba4acf1f519 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #include #include @@ -1168,9 +1167,6 @@ Abis Abi::abisOfBinary(const Utils::FilePath &path) && getUint8(data, 6) == '>' && getUint8(data, 7) == 0x0a) { // We got an ar file: possibly a static lib for ELF, PE or Mach-O - QFile f(path.toString()); - const bool canRead = f.open(QFile::ReadOnly); - data = data.mid(8); // Cut of ar file magic quint64 offset = 8; @@ -1196,14 +1192,8 @@ Abis Abi::abisOfBinary(const Utils::FilePath &path) if (!tmp.isEmpty() && tmp.at(0).binaryFormat() != MachOFormat) break; - if (!canRead) { - // FIXME: Implement remote - QTC_ASSERT(!path.needsDevice(), return {}); - } - offset += (offset % 2); // ar is 2 byte aligned - f.seek(offset); - data = f.read(1024); + data = path.fileContents(1024, offset); } } else { tmp = abiOf(data);