]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/panels/information/informationpanelcontent.cpp
Unify the search interface for non-indexed and indexed folders
[dolphin.git] / src / panels / information / informationpanelcontent.cpp
index 5254eb2eb417286d18a3950b9d813bfb93ff2786..31128bafeb784339d8083345787501552cfdf189 100644 (file)
@@ -148,17 +148,17 @@ void InformationPanelContent::showItem(const KFileItem& item)
     m_pendingPreview = false;
 
     const KUrl itemUrl = item.url();
-    const bool isNepomukSearchUrl = itemUrl.protocol().startsWith("nepomuk") && item.nepomukUri().isEmpty();
+    const bool isSearchUrl = itemUrl.protocol().contains("search") && item.nepomukUri().isEmpty();
     if (!applyPlace(itemUrl)) {
-        if (isNepomukSearchUrl) {
-            // in the case of a Nepomuk query-URL the URL is not readable for humans
+        setNameLabelText(item.text());
+        if (isSearchUrl) {
+            // in the case of a search-URL the URL is not readable for humans
             // (at least not useful to show in the Information Panel)
             KIconLoader iconLoader;
             QPixmap icon = iconLoader.loadIcon("nepomuk",
                                                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);