Glib::Value<Glib::ustring> x;
g_value_init(x.gobj(),x.value_type());
-
- if(!layer->get_description().empty())
- x.set(layer->get_description());
- else
- x.set(layer->get_local_name());
+ x.set(layer->get_non_empty_description());
g_value_init(value.gobj(),x.value_type());
//g_value_copy(x.gobj(),value.gobj());
Glib::Value<Glib::ustring> x;
g_value_init(x.gobj(),x.value_type());
-
- if(!layer->get_description().empty())
- x.set(layer->get_description());
- else
- x.set(layer->get_local_name());
+ x.set(layer->get_non_empty_description());
g_value_init(value.gobj(),x.value_type());
g_value_copy(x.gobj(),value.gobj());
Glib::Value<Glib::ustring> x;
g_value_init(x.gobj(),x.value_type());
-
- if(!layer->get_description().empty())
- x.set(layer->get_description());
- else
- x.set(layer->get_local_name());
+ x.set(layer->get_non_empty_description());
g_value_init(value.gobj(),x.value_type());
//g_value_copy(x.gobj(),value.gobj());
{
if(!layer)
return _("Activate Layer");
- String name;
- if(layer->get_description().empty())
- name=layer->get_local_name();
- else
- name=layer->get_description();
return strprintf("%s '%s'",
new_status
? _("Activate Layer")
: _("Deactivate Layer"),
- name.c_str());
+ layer->get_non_empty_description().c_str());
}
Action::ParamVocab
(layer_list.size() == 1
? _("Remove Layer")
: _("Remove Layers")),
- (layer_list.begin()->first->get_description().empty()
- ? layer_list.begin()->first->get_local_name()
- : layer_list.begin()->first->get_description()).c_str());
+ layer_list.begin()->first->get_non_empty_description().c_str());
for(std::list<std::pair<synfig::Layer::Handle,int> >::const_iterator iter=++layer_list.begin(); iter!=layer_list.end(); ++iter)
- ret += strprintf(", '%s'", (iter->first->get_description().empty()
- ? iter->first->get_local_name()
- : iter->first->get_description()).c_str());
+ ret += strprintf(", '%s'", (iter->first->get_non_empty_description().c_str()));
return ret;
}
}
else if(value_desc.parent_is_layer_param())
name = strprintf(_("'%s' -> %s"),
- (value_desc.get_layer()->get_description().empty()
- ? value_desc.get_layer()->get_local_name()
- : value_desc.get_layer()->get_description()).c_str(),
+ value_desc.get_layer()->get_non_empty_description().c_str(),
value_desc.get_param_name().c_str());
else if(value_desc.parent_is_value_node())
{
Layer::Handle parent_layer(dynamic_cast<Layer*>(node));
if(parent_layer)
name = strprintf(_("'%s' => %s"),
- (parent_layer->get_description().empty()
- ? parent_layer->get_local_name()
- : parent_layer->get_description()).c_str(),
- value_node->link_local_name(value_desc.get_index()).c_str());
+ parent_layer->get_non_empty_description().c_str(),
+ value_node->link_local_name(value_desc.get_index()).c_str());
else
name = value_node->link_local_name(value_desc.get_index());
}