From: dooglus Date: Fri, 11 Jan 2008 09:43:10 +0000 (+0000) Subject: Define Layer::get_non_empty_description() which returns the layer's description if... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=09a59b4cf5f0806bdb959d9eeb2ca11cc5a96e66;p=synfig.git Define Layer::get_non_empty_description() which returns the layer's description if non-empty, else its generic local name. This test was (and still is, currently) reproduced in several places. git-svn-id: http://svn.voria.com/code@1324 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/layer.h b/synfig-core/trunk/src/synfig/layer.h index 3e332d9..7971fcb 100644 --- a/synfig-core/trunk/src/synfig/layer.h +++ b/synfig-core/trunk/src/synfig/layer.h @@ -322,6 +322,9 @@ public: //! \writeme void set_description(const String& x); + //! Returns the layer's description if it's not empty, else its local name + const String get_non_empty_description()const { return get_description().empty() ? get_local_name() : get_description(); } + /* -- ** -- V I R T U A L F U N C T I O N S ----------------------------------- */