Commit 43008ab1 authored by Ragnar Thomsen's avatar Ragnar Thomsen
Browse files

libarchiveplugin: Show progress in percentage when listing archives

Use the archive_filter_bytes() function in libarchive to get number of
read bytes. This enables us to calculate progress in percentage when
listing an archive with this plugin.

Differential Revision: D2939
parent 8cb82c36
......@@ -61,6 +61,7 @@ bool LibarchivePlugin::list()
m_cachedArchiveEntryCount = 0;
m_extractedFilesSize = 0;
qulonglong compressedArchiveSize = QFileInfo(filename()).size();
struct archive_entry *aentry;
int result = ARCHIVE_RETRY;
......@@ -79,6 +80,8 @@ bool LibarchivePlugin::list()
m_extractedFilesSize += (qlonglong)archive_entry_size(aentry);
emit progress(float(archive_filter_bytes(m_archiveReader.data(), -1))/float(compressedArchiveSize));
m_cachedArchiveEntryCount++;
archive_read_data_skip(m_archiveReader.data());
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment