Commit 81828188 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Don't covert icons to pixmaps multiple times

Summary: We don't need to convert the icon which is loaded by name to a pixmap here. The conversion happens later in the DecorationRole data() call.

Test Plan:
Open archive. Icons in the file list appear and are properly sized.
Trigger overwrite dialog. Icons appear and are properly sized.

Verified performance improvement with hotspot (see highlighted entries)

before:
{F7770370}

after:
{F7770371}

Reviewers: #ark, elvisangelaccio

Reviewed By: #ark, elvisangelaccio

Subscribers: elvisangelaccio, kde-utils-devel

Tags: #ark

Differential Revision: https://phabricator.kde.org/D25377
parent cce9aac9
......@@ -581,10 +581,8 @@ void ArchiveModel::insertEntry(Archive::Entry *entry, InsertBehaviour behaviour)
QMimeDatabase db;
QIcon icon;
entry->isDir()
? icon = QIcon::fromTheme(db.mimeTypeForName(QStringLiteral("inode/directory")).iconName()).pixmap(IconSize(KIconLoader::Small),
IconSize(KIconLoader::Small))
: icon = QIcon::fromTheme(db.mimeTypeForFile(entry->fullPath()).iconName()).pixmap(IconSize(KIconLoader::Small),
IconSize(KIconLoader::Small));
? icon = QIcon::fromTheme(db.mimeTypeForName(QStringLiteral("inode/directory")).iconName())
: icon = QIcon::fromTheme(db.mimeTypeForFile(entry->fullPath()).iconName());
m_entryIcons.insert(entry->fullPath(NoTrailingSlash), icon);
}
......
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