summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/libarchivewrapper_p.h
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-10-25 15:28:09 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-10-26 15:29:27 +0300
commit9cf92b4cd273be55c056253b8e4a3a57e13195a8 (patch)
treeff0d4b9ad85fb5b5dea96045fb57ecf40a3ce0b2 /src/libs/installer/libarchivewrapper_p.h
parent4066fbebcabbdf591c2fc525343f8f78486457d2 (diff)
Add support for seeking files handled with libarchive
This fixes losing executable bits of files in Zip archives when extracted. Zip archives store file metadata in two ways, partial metadata per-entry and full metadata at the end of archive. IFW's read implementation previously did only streaming without support for seeking archives, which is required to obtain full metadata - meaning the partial metadata was used instead by libarchive's Zip reader. The extracted entries between the two metadata types are not consistent. This change also enables usage of archive formats that cannot be accurately handled with a streaming model, like 7zip which needs to read key data from the end of the file before reading file data from the beginning. Task-number: QTIFW-2372 Change-Id: Ie4ed33040fc52de073546e46d9da726816f47a81 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/libarchivewrapper_p.h')
-rw-r--r--src/libs/installer/libarchivewrapper_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libs/installer/libarchivewrapper_p.h b/src/libs/installer/libarchivewrapper_p.h
index ea8409da0..722c91f17 100644
--- a/src/libs/installer/libarchivewrapper_p.h
+++ b/src/libs/installer/libarchivewrapper_p.h
@@ -66,6 +66,7 @@ Q_SIGNALS:
void currentEntryChanged(const QString &filename);
void completedChanged(const quint64 completed, const quint64 total);
void dataBlockRequested();
+ void seekRequested(qint64 offset, int whence);
void remoteWorkerFinished();
public Q_SLOTS:
@@ -74,12 +75,14 @@ public Q_SLOTS:
private Q_SLOTS:
void processSignals();
void onDataBlockRequested();
+ void onSeekRequested(qint64 offset, int whence);
private:
void init();
void addDataBlock(const QByteArray &buffer);
void setClientDataAtEnd();
+ void setClientFilePosition(qint64 pos);
ExtractWorker::Status workerStatus() const;
private: