Commit 593568d0 authored by Ragnar Thomsen's avatar Ragnar Thomsen

Fix drag-and-drop extraction of entries from certain archive formats

When listing certain archive formats e.g. AppImage and RPM,
libarchiveplugin outputs no trailing slash for folders. This diff adds a
trailing slash to folders that miss one. The code is added in
ArchiveModel::newEntry() so it's applied for all plugins.

Differential Revision: D2908
parent 868bc931
......@@ -805,6 +805,14 @@ void ArchiveModel::newEntry(const ArchiveEntry& receivedEntry, InsertBehaviour b
}
entry[FileName] = entryFileName;
// For some archive formats (e.g. AppImage and RPM) paths of folders do not
// contain a trailing slash, so we append it.
if (entry[IsDirectory].toBool() && !entry[FileName].toString().endsWith(QLatin1Char('/'))) {
entry[FileName] = entry[FileName].toString() + QLatin1Char('/');
entry[InternalID] = entry[FileName];
qCDebug(ARK) << "Trailing slash appended to entry:" << entry[FileName];
}
/// 1. Skip already created nodes
if (m_rootNode) {
ArchiveNode *existing = m_rootNode->findByPath(entry[ FileName ].toString().split(QLatin1Char( '/' )));
......
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