]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Do not show links for unsupported protocols, ie. pre-4.4 resources which used URNs...
authorSebastian Trueg <sebastian@trueg.de>
Tue, 8 Dec 2009 15:51:51 +0000 (15:51 +0000)
committerSebastian Trueg <sebastian@trueg.de>
Tue, 8 Dec 2009 15:51:51 +0000 (15:51 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=1060341

src/panels/information/kloadmetadatathread.cpp

index fa1f3e1e914f4e5f9457e92cbdd19d9c05bf6cc6..37c2cf64ea64f83f6cd84391a5591d04b061756f 100644 (file)
@@ -24,6 +24,7 @@
 #include <kglobal.h>
 #include <klocale.h>
 #include <kdebug.h>
+#include <kprotocolinfo.h>
 
 #include <nepomuk/resource.h>
 
@@ -168,9 +169,12 @@ QString  KLoadMetaDataThread::formatValue(const Nepomuk::Variant& value)
     } else if (value.isResource() || value.isResourceList()) {
         QStringList links;
         foreach(const Nepomuk::Resource& res, value.toResourceList()) {
-            links << QString::fromLatin1("<a href=\"%1\">%2</a>")
-                .arg(KUrl(res.resourceUri()).url())
-                .arg(res.genericLabel());
+            if (KProtocolInfo::isKnownProtocol(res.resourceUri()))
+                links << QString::fromLatin1("<a href=\"%1\">%2</a>")
+                    .arg(KUrl(res.resourceUri()).url())
+                    .arg(res.genericLabel());
+            else
+                links << res.genericLabel();
         }
         return QLatin1String("<p>") + links.join(QLatin1String(";\n"));
     } else {