From: dooglus Date: Wed, 20 Feb 2008 02:07:10 +0000 (+0000) Subject: Don't show "Synfig Animation 1" in the title bar twice for unnamed documents. If... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=cf0e1e5a13352ba0e07e4a2f53088c7661f73181;p=synfig.git Don't show "Synfig Animation 1" in the title bar twice for unnamed documents. If the document isn't saved yet, only show the canvas's name. git-svn-id: http://svn.voria.com/code@1783 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index 8436ec9..31d3153 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -2035,14 +2035,20 @@ CanvasView::update_title() { string title; - if(get_instance()->synfigapp::Instance::get_action_count()) - title="*"; - title+=etl::basename(get_instance()->get_file_name()) - +" : "; - if(get_canvas()->get_name().empty()) - title+='"'+get_canvas()->get_id()+'"'; - else - title+='"'+get_canvas()->get_name()+'"'; + title = strprintf("%s%s\"%s\"", + ( + get_instance()->get_action_count() + ? "*" + : "" + ), ( + get_instance()->has_real_filename() + ? (etl::basename(get_instance()->get_file_name()) + " : ").c_str() + : "" + ), ( + get_canvas()->get_name().empty() + ? get_canvas()->get_id().c_str() + : get_canvas()->get_name().c_str() + )); if(get_instance()->synfigapp::Instance::in_repository()) {