From: Sebastian Trueg Date: Thu, 5 Nov 2009 17:12:38 +0000 (+0000) Subject: Handle lists of resources nicer. Maybe a list separated by new-lines is not the best... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d07b3d9ddba8863988bf6951c57c7988526f09a4?ds=inline Handle lists of resources nicer. Maybe a list separated by new-lines is not the best though... svn path=/trunk/KDE/kdebase/apps/; revision=1045283 --- diff --git a/src/panels/information/kloadmetadatathread.cpp b/src/panels/information/kloadmetadatathread.cpp index 40d82ddd6..ca908f6dd 100644 --- a/src/panels/information/kloadmetadatathread.cpp +++ b/src/panels/information/kloadmetadatathread.cpp @@ -171,6 +171,8 @@ QString KLoadMetaDataThread::tunedLabel(const QString& label) const // This is a short hack until we have a proper formatting facility in Nepomuk +// here we simply handle the most common formatting situations that do not look nice +// when using Nepomuk::Variant::toString() QString KLoadMetaDataThread::formatValue(const Nepomuk::Variant& value) { if (value.isDateTime()) { @@ -179,6 +181,13 @@ QString KLoadMetaDataThread::formatValue(const Nepomuk::Variant& value) else if (value.isResource()) { return value.toResource().genericLabel(); } + else if (value.isResourceList()) { + QStringList ll; + foreach(const Nepomuk::Resource& res, value.toResourceList()) { + ll << res.genericLabel(); + } + return ll.join(QLatin1String(";\n")); + } else { return value.toString(); }