Changeset View
Changeset View
Standalone View
Standalone View
messagecore/src/attachment/attachmentpropertiesdialog.cpp
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | 102 | { | |||
---|---|---|---|---|---|
125 | mainLayout->addWidget(buttonBox); | 125 | mainLayout->addWidget(buttonBox); | ||
126 | populateWhatsThis(); | 126 | populateWhatsThis(); | ||
127 | } | 127 | } | ||
128 | 128 | | |||
129 | void AttachmentPropertiesDialog::Private::mimeTypeChanged(const QString &type) | 129 | void AttachmentPropertiesDialog::Private::mimeTypeChanged(const QString &type) | ||
130 | { | 130 | { | ||
131 | QMimeDatabase db; | 131 | QMimeDatabase db; | ||
132 | const QMimeType mimeType = db.mimeTypeForName(type); | 132 | const QMimeType mimeType = db.mimeTypeForName(type); | ||
133 | QPixmap pix; | 133 | QPixmap pix = QIcon::fromTheme(mimeType.iconName(), QIcon::fromTheme(QStringLiteral("unknown"))).pixmap(q->style()->pixelMetric(QStyle::PM_MessageBoxIconSize)); | ||
134 | if (mimeType.isValid()) { | 134 | | ||
135 | pix = KIconLoader::global()->loadMimeTypeIcon(mimeType.iconName(), KIconLoader::Desktop); | | |||
136 | } else { | | |||
137 | pix = QIcon::fromTheme(QStringLiteral("unknown")).pixmap(q->style()->pixelMetric(QStyle::PM_MessageBoxIconSize)); | | |||
138 | } | | |||
139 | if (mReadOnly) { | 135 | if (mReadOnly) { | ||
140 | uiReadOnly->mimeIcon->setPixmap(pix); | 136 | uiReadOnly->mimeIcon->setPixmap(pix); | ||
141 | } else { | 137 | } else { | ||
142 | ui->mimeIcon->setPixmap(pix); | 138 | ui->mimeIcon->setPixmap(pix); | ||
143 | } | 139 | } | ||
144 | } | 140 | } | ||
145 | 141 | | |||
146 | void AttachmentPropertiesDialog::Private::populateWhatsThis() | 142 | void AttachmentPropertiesDialog::Private::populateWhatsThis() | ||
▲ Show 20 Lines • Show All 248 Lines • Show Last 20 Lines |