projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use LinkableValueNode members functions when possible in the derived valuenodes.
[synfig.git]
/
synfig-core
/
src
/
synfig
/
valuenode_timestring.cpp
diff --git
a/synfig-core/src/synfig/valuenode_timestring.cpp
b/synfig-core/src/synfig/valuenode_timestring.cpp
index
a0808aa
..
93e7408
100644
(file)
--- a/
synfig-core/src/synfig/valuenode_timestring.cpp
+++ b/
synfig-core/src/synfig/valuenode_timestring.cpp
@@
-54,6
+54,8
@@
using namespace synfig;
ValueNode_TimeString::ValueNode_TimeString(const ValueBase &value):
LinkableValueNode(value.get_type())
{
ValueNode_TimeString::ValueNode_TimeString(const ValueBase &value):
LinkableValueNode(value.get_type())
{
+ Vocab ret(get_children_vocab());
+ set_children_vocab(ret);
switch(value.get_type())
{
case ValueBase::TYPE_STRING:
switch(value.get_type())
{
case ValueBase::TYPE_STRING:
@@
-62,8
+64,6
@@
ValueNode_TimeString::ValueNode_TimeString(const ValueBase &value):
default:
throw Exception::BadType(ValueBase::type_local_name(value.get_type()));
}
default:
throw Exception::BadType(ValueBase::type_local_name(value.get_type()));
}
-
- DCAST_HACK_ENABLE();
}
LinkableValueNode*
}
LinkableValueNode*
@@
-143,47
+143,25
@@
ValueNode_TimeString::get_link_vfunc(int i)const
return 0;
}
return 0;
}
-int
-ValueNode_TimeString::link_count()const
-{
- return 1;
-}
-
-String
-ValueNode_TimeString::link_name(int i)const
+bool
+ValueNode_TimeString::check_type(ValueBase::Type type)
{
{
- assert(i>=0 && i<link_count());
-
- switch(i)
- {
- case 0: return "time";
- }
- return String();
+ return
+ type==ValueBase::TYPE_STRING;
}
}
-String
-ValueNode_TimeString::
link_local_name(int i
)const
+LinkableValueNode::Vocab
+ValueNode_TimeString::
get_children_vocab_vfunc(
)const
{
{
- assert(i>=0 && i<link_count());
-
- switch(i)
- {
- case 0: return _("Time");
- }
- return String();
-}
+ if(children_vocab.size())
+ return children_vocab;
-int
-ValueNode_TimeString::get_link_index_from_name(const String &name)const
-{
- if (name=="time") return 0;
+ LinkableValueNode::Vocab ret;
- throw Exception::BadLinkName(name);
-}
+ ret.push_back(ParamDesc(ValueBase(),"time")
+ .set_local_name(_("Time"))
+ .set_description(_("The time that is converted to string"))
+ );
-bool
-ValueNode_TimeString::check_type(ValueBase::Type type)
-{
- return
- type==ValueBase::TYPE_STRING;
+ return ret;
}
}