Commit 9ca5e303 authored by Ismael Asensio's avatar Ismael Asensio
Browse files

Fix the path shown for unrepresented files

To represent the bunch of smaller files, we add a fake File item
with a custom string as a file name.

Set the directory path too into that string. Otherwise, File adds
the current working directory as the path for our fake item,
showing the wrong information.

BUG: 461964
FIXED-IN: 22.12.0
parent f9dc6dd9
Pipeline #275053 passed with stage
in 1 minute and 54 seconds
......@@ -213,12 +213,13 @@ bool RadialMap::Map::build(const std::shared_ptr<Folder> &dir, const uint depth,
if ((depth == 0 || Config::showSmallFiles) && hiddenSize >= m_limits[depth] && hiddenFileCount > 0) {
// append a segment for unrepresented space - a "fake" segment
const QString s = i18np("1 file, with an average size of %2",
const QString s = i18np("%1 file, with an average size of %2",
"%1 files, with an average size of %2",
KFormat().formatByteSize(hiddenSize / hiddenFileCount));
const QString segmentPath = QStringLiteral("%1\n%2").arg(dir->displayName(), s);
m_signature[depth].append(new Segment(std::make_shared<File>(s.toUtf8().constData(), hiddenSize), a_start, a_end - a_start, true));
m_signature[depth].append(new Segment(std::make_shared<File>(segmentPath.toUtf8().constData(), hiddenSize), a_start, a_end - a_start, true));
Q_EMIT signatureChanged();
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