- KConfig config("kmetainformationrc", KConfig::NoGlobals);
- KConfigGroup settings = config.group("Show");
- initMetaInfoSettings(settings);
-
- Nepomuk::Resource res(item.url());
-
- QHash<QUrl, Nepomuk::Variant> properties = res.properties();
- QHash<QUrl, Nepomuk::Variant>::const_iterator it = properties.constBegin();
- while (it != properties.constEnd()) {
- Nepomuk::Types::Property prop(it.key());
- if (settings.readEntry(prop.name(), true)) {
- // TODO #1: use Nepomuk::formatValue(res, prop) if available
- // instead of it.value().toString()
- // TODO #2: using tunedLabel() is a workaround for KDE 4.3 until
- // we get translated labels
- m_metaTextLabel->add(tunedLabel(prop.label()) + ':', it.value().toString());
+ if ( item.nepomukUri().isValid() ) {
+ KConfig config("kmetainformationrc", KConfig::NoGlobals);
+ KConfigGroup settings = config.group("Show");
+ initMetaInfoSettings(settings);
+
+ Nepomuk::Resource res(item.url());
+
+ QHash<QUrl, Nepomuk::Variant> properties = res.properties();
+ QHash<QUrl, Nepomuk::Variant>::const_iterator it = properties.constBegin();
+ while (it != properties.constEnd()) {
+ Nepomuk::Types::Property prop(it.key());
+ if (settings.readEntry(prop.name(), true)) {
+ // TODO #1: use Nepomuk::formatValue(res, prop) if available
+ // instead of it.value().toString()
+ // TODO #2: using tunedLabel() is a workaround for KDE 4.3 until
+ // we get translated labels
+ m_metaTextLabel->add(tunedLabel(prop.label()) + ':', it.value().toString());
+ }
+ ++it;