From 5c26aae7e2fadadd823acb38c4c6a5b91dd35b7b Mon Sep 17 00:00:00 2001 From: dooglus Date: Mon, 11 Feb 2008 02:12:25 +0000 Subject: [PATCH] List exported canvases recursively - exported canvases can have exported canvases of their own, etc. git-svn-id: http://svn.voria.com/code@1667 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/tool/main.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/synfig-core/trunk/src/tool/main.cpp b/synfig-core/trunk/src/tool/main.cpp index fa6d785..7fa7357 100644 --- a/synfig-core/trunk/src/tool/main.cpp +++ b/synfig-core/trunk/src/tool/main.cpp @@ -845,6 +845,16 @@ int extract_list_canvases(arg_list_t &arg_list,bool &list_canvases) return SYNFIGTOOL_OK; } +void list_child_canvases(string prefix, Canvas::Handle canvas) +{ + Canvas::Children children(canvas->children()); + for (Canvas::Children::iterator iter = children.begin(); iter != children.end(); iter++) + { + cout << prefix << ":" << (*iter)->get_id() << endl; + list_child_canvases(prefix + ":" + (*iter)->get_id(), *iter); + } +} + /* === M E T H O D S ======================================================= */ /* === E N T R Y P O I N T ================================================= */ @@ -1121,10 +1131,8 @@ int main(int argc, char *argv[]) } else if (job_list.front().list_canvases) { - cerr << "Listing Canvases:" << endl; - Canvas::Children children(job_list.front().canvas->children()); - for (Canvas::Children::iterator iter = children.begin(); iter != children.end(); iter++) - cout << " " << job_list.front().filename << "#:" << (*iter)->get_id() << endl; + list_child_canvases(job_list.front().filename + "#", job_list.front().canvas); + cerr << endl; } else { -- 2.7.4