forked from qt-creator/qt-creator
ProjectExplorer: Use FilePath::readContents() for API detection
Change-Id: I3f19ed8ffc99f43fde4b7e5edbb53f92c7ef17ab Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -31,7 +31,6 @@
|
||||
|
||||
#include <QDebug>
|
||||
#include <QtEndian>
|
||||
#include <QFile>
|
||||
#include <QRegularExpression>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
@@ -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);
|
||||
|
Reference in New Issue
Block a user