Code

display filter label, if any, in filtered item description
authorbuliabyak <buliabyak@users.sourceforge.net>
Sat, 3 Jan 2009 01:36:41 +0000 (01:36 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sat, 3 Jan 2009 01:36:41 +0000 (01:36 +0000)
src/sp-item.cpp

index b5d9050c69685d26b2ab183b8ab1623b64c56ac7..886c5d4c2c5c3d0c7edcc8ddf1b8777beaf6edbb 100644 (file)
@@ -1047,8 +1047,14 @@ sp_item_description(SPItem *item)
             g_free (s);
             s = snew;
         }
-        if (SP_OBJECT_STYLE(item) && SP_OBJECT_STYLE(item)->filter.href) {
-            gchar *snew = g_strdup_printf (_("%s; <i>filtered</i>"), s);
+        if (SP_OBJECT_STYLE(item) && SP_OBJECT_STYLE(item)->filter.href && SP_OBJECT_STYLE(item)->filter.href->getObject()) {
+            const gchar *label = SP_OBJECT_STYLE(item)->filter.href->getObject()->label();
+            gchar *snew;
+            if (label) {
+                snew = g_strdup_printf (_("%s; <i>filtered (%s)</i>"), s, label);
+            } else {
+                snew = g_strdup_printf (_("%s; <i>filtered</i>"), s);
+            }
             g_free (s);
             s = snew;
         }