From ed68687614472e18904c4a3f613d01df2f5bb90e Mon Sep 17 00:00:00 2001 From: Sebastian Trueg Date: Thu, 22 Jul 2010 08:26:07 +0000 Subject: Properly KIO::stat instead of simply using the KFileItem constructor when showing metadata for the currently selected folder. This way we can even get rid of the special handling of nepomuksearch:/ URLs since the KIO slave provides a nice name and all you need to show to the user. Even nicer: When clicking an entry in the metadata view the resulting query will be related to the one clicked resource. This resource will then be represented by the query folder. So all in all this patch makes Dolphin more generic while additionally activating a new feature. svn path=/trunk/KDE/kdebase/apps/; revision=1152959 --- src/panels/information/informationpanelcontent.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/panels/information/informationpanelcontent.cpp') diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 5254eb2eb..b18e6b26e 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -150,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) @@ -158,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; @@ -184,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()) { @@ -377,7 +371,7 @@ void InformationPanelContent::setNameLabelText(const QString& text) textOption.setWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere); const QString processedText = Qt::mightBeRichText(text) ? text : KStringHandler::preProcessWrap(text); - + QTextLayout textLayout(processedText); textLayout.setFont(m_nameLabel->font()); textLayout.setTextOption(textOption); -- cgit v1.3