From 5d1f6eaf57e03ba0c08e1e0e536dd93b1613b8cc Mon Sep 17 00:00:00 2001 From: buliabyak Date: Fri, 27 Mar 2009 13:51:48 +0000 Subject: [PATCH] add lpe names to path description --- src/sp-path.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/sp-path.cpp b/src/sp-path.cpp index 760f61e27..e570030dd 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -20,6 +20,11 @@ #include +#include "live_effects/effect.h" +#include "live_effects/lpeobject.h" +#include "live_effects/lpeobject-reference.h" +#include "sp-lpe-item.h" + #include #include #include <2geom/pathvector.h> @@ -132,9 +137,24 @@ static gchar * sp_path_description(SPItem * item) { int count = sp_nodes_in_path(SP_PATH(item)); - if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(item))) { - return g_strdup_printf(ngettext("Path (%i node, path effect)", - "Path (%i nodes, path effect)",count), count); + if (SP_IS_LPE_ITEM(item) && sp_lpe_item_has_path_effect(SP_LPE_ITEM(item))) { + + Glib::ustring s; + + PathEffectList effect_list = sp_lpe_item_get_effect_list(SP_LPE_ITEM(item)); + for (PathEffectList::iterator it = effect_list.begin(); it != effect_list.end(); it++) + { + LivePathEffectObject *lpeobj = (*it)->lpeobject; + if (!lpeobj || !lpeobj->get_lpe()) + break; + if (s.empty()) + s = lpeobj->get_lpe()->getName(); + else + s = s + ", " + lpeobj->get_lpe()->getName(); + } + + return g_strdup_printf(ngettext("Path (%i node, path effect: %s)", + "Path (%i nodes, path effect: %s)",count), count, s.c_str()); } else { return g_strdup_printf(ngettext("Path (%i node)", "Path (%i nodes)",count), count); -- 2.30.2