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)



Reviewers: #ark, elvisangelaccio

Reviewed By: #ark, elvisangelaccio

Subscribers: elvisangelaccio, kde-utils-devel

Tags: #ark

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