Commit bb9ede75 authored by Ragnar Thomsen's avatar Ragnar Thomsen

Fix drag-and-drop extraction of parentless files

In some archives parent folders of some files might not be part of the
archive themselves, i.e. the archive does not contain separate entries
for them. In this case ArchiveModel creates ArchiveDirNodes for the
folders. However, the FileName and InternalID properties of these
folders do not get a trailing slash. This results in faulty root nodes
leading to e.g. broken drag-n-drop extraction of files within these
folders.

This diff simply appends a traling slash to the properties in
ArchiveModel::parentFor().

BUG: 367549
FIXED-IN: 16.08.2
Differential Revision: D2909
parent 593568d0
......@@ -679,7 +679,7 @@ ArchiveDirNode* ArchiveModel::parentFor(const ArchiveEntry& entry)
if (!node) {
ArchiveEntry e;
e[ FileName ] = (parent == m_rootNode) ?
piece : parent->entry()[ FileName ].toString() + QLatin1Char( '/' ) + piece;
piece + QLatin1Char('/') : parent->entry()[FileName].toString() + piece + QLatin1Char('/');
e[ InternalID ] = e.value(FileName);
e[ IsDirectory ] = true;
node = new ArchiveDirNode(parent, e);
......
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