Don't show "Synfig Animation 1" in the title bar twice for unnamed documents. If...
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 20 Feb 2008 02:07:10 +0000 (02:07 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Wed, 20 Feb 2008 02:07:10 +0000 (02:07 +0000)
git-svn-id: http://svn.voria.com/code@1783 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/canvasview.cpp

index 8436ec9..31d3153 100644 (file)
@@ -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())
        {