The sizes from KIconLoader are considered to go away in KF6
Details
Details
- Reviewers
elvisangelaccio - Group Reviewers
Ark - Maniphest Tasks
- T11637: KIconThemes Cleanups
- Commits
- R36:7c463bec1c34: Get icon size from QStyle instead of KIconLoader
Open archive. Icons in file view are properly sized
Diff Detail
Diff Detail
- Repository
- R36 Ark
- Branch
- nokicon
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 18918 Build 18936: arc lint + arc unit
Comment Actions
+1 but why only archivemodel.cpp ?
$ git grep KIconLoader kerfuffle/extractiondialog.cpp:#include <KIconLoader> kerfuffle/extractiondialog.cpp: m_ui->iconLabel->setPixmap(QIcon::fromTheme(QStringLiteral("archive-extract")).pixmap(IconSize(KIconLoader::Desktop), IconSize(KIconLoader::Desktop))); kerfuffle/propertiesdialog.cpp:#include <KIconLoader> kerfuffle/propertiesdialog.cpp: m_ui->lblIcon->setPixmap(icon.pixmap(IconSize(KIconLoader::Desktop), IconSize(KIconLoader::Desktop))); part/archivemodel.cpp:#include <KIconLoader> part/archivemodel.cpp: return m_entryIcons.value(e->fullPath(NoTrailingSlash)).pixmap(IconSize(KIconLoader::Small), IconSize(KIconLoader::Small), mode); part/arkviewer.cpp:#include <KIconLoader> part/arkviewer.cpp: m_iconLabel->setPixmap(QIcon::fromTheme(mimeType.iconName()).pixmap(IconSize(KIconLoader::Small), IconSize(KIconLoader::Small))); part/infopanel.cpp:#include <KIconLoader> part/infopanel.cpp: return QIcon::fromTheme(name).pixmap(IconSize(KIconLoader::Desktop), IconSize(KIconLoader::Desktop));
If we also remove those, we could get rid of the KIconLoader dependency altogheter.
Comment Actions
Can't you just return a QIcon and let the view figure it out? I don't like the model making assumptions on the visual representation
Comment Actions
This seems not trivially possible because of the mode argument. That can only be set in pixmap() or paint()