]> cloud.milkyroute.net Git - dolphin.git/commitdiff
escape the existing text instead of set to plain text
authorWeng Xuetian <wengxt@gmail.com>
Fri, 25 Jan 2013 21:07:33 +0000 (16:07 -0500)
committerWeng Xuetian <wengxt@gmail.com>
Sun, 27 Jan 2013 19:09:12 +0000 (14:09 -0500)
@info indicates it's rich text and will be added <html> tag by kdelibs,
so just escape the text that will be set to label for KDE/4.10

REVIEW: 108584
BUG: 313992

src/panels/information/informationpanelcontent.cpp

index 9b0dd0092f4806695fad9137c770403ae572bfa9..0c4c62fc7c6f710cf0233e4b8f5378d3765b4bd3 100644 (file)
@@ -105,7 +105,6 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
     QFont font = m_nameLabel->font();
     font.setBold(true);
     m_nameLabel->setFont(font);
-    m_nameLabel->setTextFormat(Qt::PlainText);
     m_nameLabel->setAlignment(Qt::AlignHCenter);
     m_nameLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
 
@@ -164,7 +163,7 @@ void InformationPanelContent::showItem(const KFileItem& item)
     const KUrl itemUrl = item.url();
     const bool isSearchUrl = itemUrl.protocol().contains("search") && item.nepomukUri().isEmpty();
     if (!applyPlace(itemUrl)) {
-        setNameLabelText(item.text());
+        setNameLabelText(Qt::escape(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)
@@ -362,7 +361,7 @@ bool InformationPanelContent::applyPlace(const KUrl& url)
     for (int i = 0; i < count; ++i) {
         const PlacesItem* item = m_placesItemModel->placesItem(i);
         if (item->url().equals(url, KUrl::CompareWithoutTrailingSlash)) {
-            setNameLabelText(item->text());
+            setNameLabelText(Qt::escape(item->text()));
             m_preview->setPixmap(KIcon(item->icon()).pixmap(128, 128));
             return true;
         }