diff --git a/part/infopanel.h b/part/infopanel.h --- a/part/infopanel.h +++ b/part/infopanel.h @@ -65,6 +65,8 @@ void showMetaDataFor(const QModelIndex &index); + QPixmap getPixmap(const QString& name); + ArchiveModel *m_model; QString m_prettyFileName; }; diff --git a/part/infopanel.cpp b/part/infopanel.cpp --- a/part/infopanel.cpp +++ b/part/infopanel.cpp @@ -24,17 +24,16 @@ #include #include -#include #include #include #include using namespace Kerfuffle; -static QPixmap getDesktopIconForName(const QString& name) +QPixmap InfoPanel::getPixmap(const QString& name) { - return QIcon::fromTheme(name).pixmap(IconSize(KIconLoader::Desktop), IconSize(KIconLoader::Desktop)); + return QIcon::fromTheme(name).pixmap(48); } InfoPanel::InfoPanel(ArchiveModel *model, QWidget *parent) @@ -60,7 +59,7 @@ void InfoPanel::updateWithDefaults() { - iconLabel->setPixmap(getDesktopIconForName(QStringLiteral("utilities-file-archiver"))); + iconLabel->setPixmap(getPixmap(QStringLiteral("utilities-file-archiver"))); const QString currentFileName = prettyFileName(); @@ -109,7 +108,7 @@ mimeType = db.mimeTypeForFile(entry->fullPath(), QMimeDatabase::MatchExtension); } - iconLabel->setPixmap(getDesktopIconForName(mimeType.iconName())); + iconLabel->setPixmap(getPixmap(mimeType.iconName())); if (entry->isDir()) { uint dirs; uint files; @@ -141,7 +140,7 @@ } else if (list.size() == 1) { setIndex(list[ 0 ]); } else { - iconLabel->setPixmap(getDesktopIconForName(QStringLiteral("utilities-file-archiver"))); + iconLabel->setPixmap(getPixmap(QStringLiteral("utilities-file-archiver"))); fileName->setText(i18np("One file selected", "%1 files selected", list.size())); quint64 totalSize = 0; for (const QModelIndex& index : list) {