X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/abf29a89efc569db4e51d582eec95d7740db36ad..4ba9eb8ea34baee7e5e100a0d3c33f23f75cf708:/src/panels/information/informationpanelcontent.cpp diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 8d8c21549..b18e6b26e 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -149,6 +150,7 @@ void InformationPanelContent::showItem(const KFileItem& item) const KUrl itemUrl = item.url(); const bool isNepomukSearchUrl = itemUrl.protocol().startsWith("nepomuk") && item.nepomukUri().isEmpty(); if (!applyPlace(itemUrl)) { + setNameLabelText(item.text()); if (isNepomukSearchUrl) { // in the case of a Nepomuk query-URL the URL is not readable for humans // (at least not useful to show in the Information Panel) @@ -157,7 +159,6 @@ void InformationPanelContent::showItem(const KFileItem& item) KIconLoader::NoGroup, KIconLoader::SizeEnormous); m_preview->setPixmap(icon); - setNameLabelText(QString()); } else { // try to get a preview pixmap from the item... m_pendingPreview = true; @@ -183,18 +184,12 @@ void InformationPanelContent::showItem(const KFileItem& item) this, SLOT(showPreview(const KFileItem&, const QPixmap&))); connect(job, SIGNAL(failed(const KFileItem&)), this, SLOT(showIcon(const KFileItem&))); - - setNameLabelText(item.text()); } } if (m_metaDataWidget != 0) { - if (isNepomukSearchUrl) { - m_metaDataWidget->hide(); - } else { - m_metaDataWidget->show(); - m_metaDataWidget->setItems(KFileItemList() << item); - } + m_metaDataWidget->show(); + m_metaDataWidget->setItems(KFileItemList() << item); } if (InformationPanelSettings::showPreview()) { @@ -375,8 +370,8 @@ void InformationPanelContent::setNameLabelText(const QString& text) QTextOption textOption; textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); - const QString processedText = KStringHandler::preProcessWrap(text); - + const QString processedText = Qt::mightBeRichText(text) ? text : KStringHandler::preProcessWrap(text); + QTextLayout textLayout(processedText); textLayout.setFont(m_nameLabel->font()); textLayout.setTextOption(textOption);