Commit 0e1f4ad7 authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

fix display of mime type icon

we need a fall back for some files
parent 03de44d0
......@@ -296,13 +296,21 @@ void KateTabBar::setTabDocument(int idx, KTextEditor::Document *doc)
void KateTabBar::setModifiedStateIcon(int idx, KTextEditor::Document *doc)
// simple modified indicator if modified
QIcon tabIcon;
if (doc->isModified()) {
setTabIcon(idx, QIcon::fromTheme(QStringLiteral("choice-round")));
tabIcon = QIcon::fromTheme(QStringLiteral("choice-round"));
// else mime-type icon
setTabIcon(idx, QIcon(QMimeDatabase().mimeTypeForName(doc->mimeType()).iconName()));
else {
tabIcon = QIcon::fromTheme(QMimeDatabase().mimeTypeForName(doc->mimeType()).iconName());
// ensure we always have a valid icon
if (tabIcon.isNull()) {
tabIcon = QIcon::fromTheme(QStringLiteral("text-plain"));
setTabIcon(idx, tabIcon);
void KateTabBar::setCurrentDocument(KTextEditor::Document *doc)
Supports Markdown
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