From: dooglus Date: Fri, 11 Jan 2008 10:11:39 +0000 (+0000) Subject: Use Layer::get_non_empty_description() instead of checking whether the description... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d57e1c20fdab21aab99fe0561b942b9972f9fbba;p=synfig.git Use Layer::get_non_empty_description() instead of checking whether the description is empty in various places. git-svn-id: http://svn.voria.com/code@1328 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/layergrouptreestore.cpp b/synfig-studio/trunk/src/gtkmm/layergrouptreestore.cpp index 003f167..aa84808 100644 --- a/synfig-studio/trunk/src/gtkmm/layergrouptreestore.cpp +++ b/synfig-studio/trunk/src/gtkmm/layergrouptreestore.cpp @@ -212,11 +212,7 @@ LayerGroupTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int Glib::Value 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()); diff --git a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp index bde9efe..4f6cf01 100644 --- a/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp +++ b/synfig-studio/trunk/src/gtkmm/layerparamtreestore.cpp @@ -133,11 +133,7 @@ LayerParamTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int Glib::Value 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()); diff --git a/synfig-studio/trunk/src/gtkmm/layertreestore.cpp b/synfig-studio/trunk/src/gtkmm/layertreestore.cpp index 894563c..1e12538 100644 --- a/synfig-studio/trunk/src/gtkmm/layertreestore.cpp +++ b/synfig-studio/trunk/src/gtkmm/layertreestore.cpp @@ -198,11 +198,7 @@ LayerTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int colum Glib::Value 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()); diff --git a/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp b/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp index 9b69de7..948bc6f 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/layeractivate.cpp @@ -68,17 +68,12 @@ Action::LayerActivate::get_local_name()const { 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 diff --git a/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp b/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp index 6ca5e8a..4f08c3f 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/layerremove.cpp @@ -75,14 +75,10 @@ Action::LayerRemove::get_local_name()const (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 >::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; } diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp index 01f38ae..e5edf2a 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuedescset.cpp @@ -84,9 +84,7 @@ Action::ValueDescSet::get_local_name()const } 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()) { @@ -96,10 +94,8 @@ Action::ValueDescSet::get_local_name()const Layer::Handle parent_layer(dynamic_cast(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()); }