From ccd9a32988576784f77f63539b48745843ac52ba Mon Sep 17 00:00:00 2001 From: Sebastian Trueg Date: Sat, 21 Nov 2009 09:33:37 +0000 Subject: Simplified the clickable resource metadata display. This also fixes a bug where sometimes resources are not displayed at all svn path=/trunk/KDE/kdebase/apps/; revision=1052237 --- src/panels/information/kloadmetadatathread.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/panels/information/kloadmetadatathread.cpp') diff --git a/src/panels/information/kloadmetadatathread.cpp b/src/panels/information/kloadmetadatathread.cpp index b942c2038..fa1f3e1e9 100644 --- a/src/panels/information/kloadmetadatathread.cpp +++ b/src/panels/information/kloadmetadatathread.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include @@ -100,11 +101,7 @@ void KLoadMetaDataThread::run() Item item; item.name = prop.name(); item.label = tunedLabel(prop.label()); - if (it.value().isResource() || it.value().isResourceList()) { - item.resources = it.value().toResourceList(); - } else { - item.value = formatValue(it.value()); - } + item.value = formatValue(it.value()); m_items.append(item); } ++it; @@ -168,14 +165,14 @@ QString KLoadMetaDataThread::formatValue(const Nepomuk::Variant& value) { if (value.isDateTime()) { return KGlobal::locale()->formatDateTime(value.toDateTime(), KLocale::FancyLongDate); - } else if (value.isResource()) { - return value.toResource().genericLabel(); - } else if (value.isResourceList()) { - QStringList list; + } else if (value.isResource() || value.isResourceList()) { + QStringList links; foreach(const Nepomuk::Resource& res, value.toResourceList()) { - list << res.genericLabel(); + links << QString::fromLatin1("%2") + .arg(KUrl(res.resourceUri()).url()) + .arg(res.genericLabel()); } - return list.join(QLatin1String(";\n")); + return QLatin1String("

") + links.join(QLatin1String(";\n")); } else { return value.toString(); } -- cgit v1.3