Improve LinkableValueNode::get_description().
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 5 Feb 2008 11:40:19 +0000 (11:40 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 5 Feb 2008 11:40:19 +0000 (11:40 +0000)
git-svn-id: http://svn.voria.com/code@1590 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/valuenode.cpp

index af1fb0d..44a1b43 100644 (file)
@@ -582,12 +582,23 @@ LinkableValueNode::get_description(int index, bool show_exported_name)const
 {
        String description;
 
-       if (show_exported_name && !is_exported())
-               show_exported_name = false;
-
-       if (index != -1)
+       if (index == -1)
+       {
+               if (show_exported_name && is_exported())
+                       description += strprintf(" (%s)", get_id().c_str());
+       }
+       else
+       {
                description = String(":") + link_local_name(index);
 
+               if (show_exported_name)
+               {
+                       ValueNode::LooseHandle link(get_link(index));
+                       if (link->is_exported())
+                               description += strprintf(" (%s)", link->get_id().c_str());
+               }
+       }
+
        const synfig::Node* node = this;
        LinkableValueNode::ConstHandle parent_linkable_vn = 0;
 
@@ -627,8 +638,5 @@ LinkableValueNode::get_description(int index, bool show_exported_name)const
                                                                description.c_str());
        }
 
-       if (show_exported_name)
-               description += strprintf(" (%s)", get_id().c_str());
-
        return description;
 }