summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-07-24 16:35:44 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-07-24 16:35:44 (GMT)
commit9014ef75cb2756040b75d665dcbedc5fb5629b71 (patch)
tree4d88db489160dca92861fb802e6eee9f4ea4b6ad
parent2e2432308f7508d41a418669eac803b4f8e7eaf0 (diff)
Fix setting of icon in backend about dialog
-rw-r--r--part.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/part.cpp b/part.cpp
index 05cd57a..49ae4cd 100644
--- a/part.cpp
+++ b/part.cpp
@@ -2647,19 +2647,26 @@ void Part::slotAboutBackend()
KAboutData aboutData = KAboutData::fromPluginMetaData(data);
- if (data.iconName().isEmpty())
- {
- // fall back to mime type icon
+ QIcon icon = QIcon::fromTheme(data.iconName());
+
+ // fall back to mime type icon
+ if (icon.isNull()) {
const Okular::DocumentInfo documentInfo = m_document->documentInfo(QSet<DocumentInfo::Key>() << DocumentInfo::MimeType);
const QString mimeTypeName = documentInfo.get(DocumentInfo::MimeType);
- if (!mimeTypeName.isEmpty())
- {
+ if (!mimeTypeName.isEmpty()) {
QMimeDatabase db;
QMimeType type = db.mimeTypeForName(mimeTypeName);
- if (type.isValid())
- aboutData.setProgramIconName(type.iconName());
+ if (type.isValid()) {
+ icon = QIcon::fromTheme(type.iconName());
+ }
}
}
+
+ if (!icon.isNull()) {
+ // 48x48 is what KAboutApplicationDialog wants, which doesn't match any default so we hardcode it
+ aboutData.setProgramLogo(icon.pixmap(48, 48));
+ }
+
KAboutApplicationDialog dlg(aboutData, widget());
dlg.exec();
}