Commit aba21d8f authored by Aleksei Nikiforov's avatar Aleksei Nikiforov Committed by Elvis Angelaccio
Browse files

libarchive backend: display permissions in octal format

Summary: Currently when libarchive backend is used to read archive, permissions are displayed in decimal format. But a lot of userspace tools show and use permissions either in text format or in octal number format for convenience, not in a decimal number format.

Test Plan:
Open an archive which ark uses libarchive for opening. For example,

For directories permissions should be displayed as '40775' instead of '16893'.
For non-executable files permissions should be displayed as '100664' instead of '33204'.

Reviewers: #ark, elvisangelaccio

Reviewed By: #ark, elvisangelaccio

Subscribers: kde-utils-devel

Tags: #ark

Differential Revision:
parent 2c684ecd
...@@ -458,7 +458,7 @@ void LibarchivePlugin::emitEntryFromArchiveEntry(struct archive_entry *aentry) ...@@ -458,7 +458,7 @@ void LibarchivePlugin::emitEntryFromArchiveEntry(struct archive_entry *aentry)
const mode_t mode = archive_entry_mode(aentry); const mode_t mode = archive_entry_mode(aentry);
if (mode != 0) { if (mode != 0) {
e->setProperty("permissions", QString::number(mode)); e->setProperty("permissions", QString::number(mode, 8));
} }
e->setProperty("isExecutable", mode & (S_IXUSR | S_IXGRP | S_IXOTH)); e->setProperty("isExecutable", mode & (S_IXUSR | S_IXGRP | S_IXOTH));
Markdown is supported
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