Skip to content

Commit

Permalink
fix(core): use archive_entry_pathname_utf8
Browse files Browse the repository at this point in the history
Removes Windows specific code path.
  • Loading branch information
trollixx committed Jun 22, 2024
1 parent 07a357c commit 5081898
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/libs/core/extractor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,8 @@ void Extractor::extract(const QString &sourceFile, const QString &destination, c
// TODO: Do not strip root directory in archive if it equals to 'root'
archive_entry *entry;
while (archive_read_next_header(info.archiveHandle, &entry) == ARCHIVE_OK) {
#ifndef Q_OS_WIN32
QString pathname = QString::fromUtf8(archive_entry_pathname(entry));
#else
// TODO: Remove once https://github.com/libarchive/libarchive/issues/587 is resolved.
QString pathname = QString::fromWCharArray(archive_entry_pathname_w(entry));
#endif
// See https://github.com/libarchive/libarchive/issues/587 for more on UTF-8.
QString pathname = QString::fromUtf8(archive_entry_pathname_utf8(entry));

if (!root.isEmpty()) {
pathname.remove(0, pathname.indexOf(QLatin1String("/")) + 1);
Expand Down

0 comments on commit 5081898

Please sign in to comment.