diff options
| author | Sebastian Trueg <[email protected]> | 2009-12-08 15:51:51 +0000 |
|---|---|---|
| committer | Sebastian Trueg <[email protected]> | 2009-12-08 15:51:51 +0000 |
| commit | d326572a72163da3ecda128c87dac84c00d8b017 (patch) | |
| tree | 62a32e776566c2c7f8e98d7a830431785fff036f | |
| parent | 49a611f2137c2ae45019761bec8d93f121144541 (diff) | |
Do not show links for unsupported protocols, ie. pre-4.4 resources which used URNs instead of nepomuk:/res/<uuid> URIs.
svn path=/trunk/KDE/kdebase/apps/; revision=1060341
| -rw-r--r-- | src/panels/information/kloadmetadatathread.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/panels/information/kloadmetadatathread.cpp b/src/panels/information/kloadmetadatathread.cpp index fa1f3e1e9..37c2cf64e 100644 --- a/src/panels/information/kloadmetadatathread.cpp +++ b/src/panels/information/kloadmetadatathread.cpp @@ -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 { |
