From 911e683ac3e37bc746b9890ae1fadc3746c45fb0 Mon Sep 17 00:00:00 2001 From: Nikita Kitaev Date: Wed, 14 Apr 2010 17:46:55 -0700 Subject: [PATCH] Cleanup dead code --- synfig-studio/src/gtkmm/instance.cpp | 125 +----------------------- synfig-studio/src/gtkmm/keyframetree.cpp | 1 - synfig-studio/src/gtkmm/layergrouptreestore.cpp | 1 - synfig-studio/src/gtkmm/metadatatreestore.cpp | 6 +- synfig-studio/src/gtkmm/toolbox.cpp | 15 +-- synfig-studio/src/gtkmm/widget_vector.cpp | 2 - 6 files changed, 9 insertions(+), 141 deletions(-) diff --git a/synfig-studio/src/gtkmm/instance.cpp b/synfig-studio/src/gtkmm/instance.cpp index db48457..62d63a0 100644 --- a/synfig-studio/src/gtkmm/instance.cpp +++ b/synfig-studio/src/gtkmm/instance.cpp @@ -82,15 +82,11 @@ int studio::Instance::instance_count_=0; Instance::Instance(synfig::Canvas::Handle canvas): synfigapp::Instance (canvas), -// canvas_tree_store_ (Gtk::TreeStore::create(CanvasTreeModel())), -// canvas_tree_store_ (Gtk::TreeStore::create()), + canvas_tree_store_ (Gtk::TreeStore::create(canvas_tree_model)), history_tree_store_ (HistoryTreeStore::create(this)), undo_status_(false), redo_status_(false) { - CanvasTreeModel model; - canvas_tree_store_=Gtk::TreeStore::create(model); - id_=instance_count_++; // Connect up all the signals @@ -107,8 +103,6 @@ Instance::Instance(synfig::Canvas::Handle canvas): ) ); - canvas_tree_store_=Gtk::TreeStore::create(canvas_tree_model); - refresh_canvas_tree(); } @@ -262,6 +256,7 @@ studio::Instance::dialog_save_as() Layer::Handle parent_layer(dynamic_cast(node)); if(parent_layer && parent_layer->get_canvas()->get_root()!=get_canvas()) { + //! \todo Fix big involving "Save As" with referenced compositions string msg(strprintf(_("There is currently a bug when using \"SaveAs\"\n" "on a composition that is being referenced by other\n" "files that are currently open. Close these\n" @@ -426,45 +421,8 @@ Instance::insert_canvas(Gtk::TreeRow row, synfig::Canvas::Handle canvas) for(iter=children.begin();iter!=children.end();iter++) insert_canvas(*(canvas_tree_store()->append(row.children())),*iter); - } - - /* - if(!canvas->value_node_list().empty()) - { - Gtk::TreeRow valuenode_row = *(canvas_tree_store()->append(row.children())); - - valuenode_row[canvas_tree_model.label] = ""; - valuenode_row[canvas_tree_model.canvas] = canvas; - valuenode_row[canvas_tree_model.is_canvas] = false; - valuenode_row[canvas_tree_model.is_value_node] = false; - - synfig::ValueNodeList::iterator iter; - synfig::ValueNodeList &value_node_list(canvas->value_node_list()); - - for(iter=value_node_list.begin();iter!=value_node_list.end();iter++) - insert_value_node(*(canvas_tree_store()->append(valuenode_row.children())),canvas,*iter); - } - */ -} - -/* -void -Instance::insert_value_node(Gtk::TreeRow row,Canvas::Handle canvas,etl::handle value_node) -{ - CanvasTreeModel canvas_tree_model; - assert(value_node); - assert(canvas); - - row[canvas_tree_model.id] = value_node->get_id(); - row[canvas_tree_model.name] = value_node->get_id(); - row[canvas_tree_model.label] = value_node->get_id(); - row[canvas_tree_model.canvas] = canvas; - row[canvas_tree_model.value_node] = value_node; - row[canvas_tree_model.is_canvas] = false; - row[canvas_tree_model.is_value_node] = true; - row[canvas_tree_model.icon] = Gtk::Button().render_icon(valuenode_icon(value_node),Gtk::ICON_SIZE_SMALL_TOOLBAR); + } } -*/ void Instance::refresh_canvas_tree() @@ -770,32 +728,6 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamLis Gtk::Image* image(manage(new Gtk::Image())); Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image); - /* - if(iter->task=="raise") - Gtk::Stock::lookup(Gtk::Stock::GO_UP,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="lower") - Gtk::Stock::lookup(Gtk::Stock::GO_DOWN,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="move_top") - Gtk::Stock::lookup(Gtk::Stock::GOTO_TOP,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="move_bottom") - Gtk::Stock::lookup(Gtk::Stock::GOTO_BOTTOM,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="remove") - Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="set_on") - Gtk::Stock::lookup(Gtk::Stock::YES,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="set_off") - Gtk::Stock::lookup(Gtk::Stock::NO,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="duplicate") - Gtk::Stock::lookup(Gtk::Stock::COPY,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="remove") - Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image); - else - { - Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) || - Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) || - Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image); - } - */ menu->items().push_back( Gtk::Menu_Helpers::ImageMenuElem( iter->local_name, @@ -849,31 +781,6 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamLis Gtk::Image* image(manage(new Gtk::Image())); Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image); -/* if(iter->task=="raise") - Gtk::Stock::lookup(Gtk::Stock::GO_UP,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="lower") - Gtk::Stock::lookup(Gtk::Stock::GO_DOWN,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="move_top") - Gtk::Stock::lookup(Gtk::Stock::GOTO_TOP,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="move_bottom") - Gtk::Stock::lookup(Gtk::Stock::GOTO_BOTTOM,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="remove") - Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="set_on") - Gtk::Stock::lookup(Gtk::Stock::YES,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="set_off") - Gtk::Stock::lookup(Gtk::Stock::NO,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="duplicate") - Gtk::Stock::lookup(Gtk::Stock::COPY,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="remove") - Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image); - else - { - Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) || - Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) || - Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image); - } -*/ menu->items().push_back( Gtk::Menu_Helpers::ImageMenuElem( iter->local_name, @@ -899,31 +806,7 @@ Instance::add_actions_to_menu(Gtk::Menu *menu, const synfigapp::Action::ParamLis { Gtk::Image* image(manage(new Gtk::Image())); Gtk::Stock::lookup(get_action_stock_id(*iter),Gtk::ICON_SIZE_MENU,*image); -/* if(iter->task=="raise") - Gtk::Stock::lookup(Gtk::Stock::GO_UP,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="lower") - Gtk::Stock::lookup(Gtk::Stock::GO_DOWN,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="move_top") - Gtk::Stock::lookup(Gtk::Stock::GOTO_TOP,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="move_bottom") - Gtk::Stock::lookup(Gtk::Stock::GOTO_BOTTOM,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="remove") - Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="set_on") - Gtk::Stock::lookup(Gtk::Stock::YES,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="set_off") - Gtk::Stock::lookup(Gtk::Stock::NO,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="duplicate") - Gtk::Stock::lookup(Gtk::Stock::COPY,Gtk::ICON_SIZE_MENU,*image); - else if(iter->task=="remove") - Gtk::Stock::lookup(Gtk::Stock::DELETE,Gtk::ICON_SIZE_MENU,*image); - else - { - Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->name),Gtk::ICON_SIZE_MENU,*image) || - Gtk::Stock::lookup(Gtk::StockID("gtk-"+iter->task),Gtk::ICON_SIZE_MENU,*image) || - Gtk::Stock::lookup(Gtk::StockID("synfig-"+iter->task),Gtk::ICON_SIZE_MENU,*image); - } -*/ + menu->items().push_back( Gtk::Menu_Helpers::ImageMenuElem( iter->local_name, diff --git a/synfig-studio/src/gtkmm/keyframetree.cpp b/synfig-studio/src/gtkmm/keyframetree.cpp index 14af5ab..e480292 100644 --- a/synfig-studio/src/gtkmm/keyframetree.cpp +++ b/synfig-studio/src/gtkmm/keyframetree.cpp @@ -103,7 +103,6 @@ KeyframeTree::KeyframeTree() append_column(*column); } - // append_column_editable(_("Description"),model.description); { Gtk::TreeView::Column* column = Gtk::manage( new Gtk::TreeView::Column(_("Description")) ); diff --git a/synfig-studio/src/gtkmm/layergrouptreestore.cpp b/synfig-studio/src/gtkmm/layergrouptreestore.cpp index 077436c..9c947c6 100644 --- a/synfig-studio/src/gtkmm/layergrouptreestore.cpp +++ b/synfig-studio/src/gtkmm/layergrouptreestore.cpp @@ -471,7 +471,6 @@ LayerGroupTreeStore::row_draggable_vfunc (const TreeModel::Path& /*path*/)const // Gtk::TreeModel::Row row(*get_iter(path)); return true; -// return (bool)true; } bool diff --git a/synfig-studio/src/gtkmm/metadatatreestore.cpp b/synfig-studio/src/gtkmm/metadatatreestore.cpp index 383cda1..98bb7c6 100644 --- a/synfig-studio/src/gtkmm/metadatatreestore.cpp +++ b/synfig-studio/src/gtkmm/metadatatreestore.cpp @@ -106,7 +106,7 @@ MetaDataTreeStore::get_value_vfunc (const Gtk::TreeModel::iterator& iter, int co { if(column>=get_n_columns_vfunc()) { - g_warning("KeyframeTreeStore::set_value_impl: Bad column (%d)",column); + g_warning("MetaDataTreeStore::set_value_impl: Bad column (%d)",column); return; } @@ -126,13 +126,13 @@ MetaDataTreeStore::set_value_impl(const Gtk::TreeModel::iterator& iter, int colu { if(column>=get_n_columns_vfunc()) { - g_warning("KeyframeTreeStore::set_value_impl: Bad column (%d)",column); + g_warning("MetaDataTreeStore::set_value_impl: Bad column (%d)",column); return; } if(!g_value_type_compatible(G_VALUE_TYPE(value.gobj()),get_column_type_vfunc(column))) { - g_warning("KeyframeTreeStore::set_value_impl: Bad value type"); + g_warning("MetaDataTreeStore::set_value_impl: Bad value type"); return; } diff --git a/synfig-studio/src/gtkmm/toolbox.cpp b/synfig-studio/src/gtkmm/toolbox.cpp index af2931e..ea40e7d 100644 --- a/synfig-studio/src/gtkmm/toolbox.cpp +++ b/synfig-studio/src/gtkmm/toolbox.cpp @@ -240,16 +240,6 @@ Toolbox::Toolbox(): filemenu->items().push_back(Gtk::Menu_Helpers::SeparatorElem()); filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Panels"),*dock_dialogs)); - //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Canvas Browser..."), - // sigc::mem_fun(studio::App::show_comp_view))); - //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Gradient Editor..."), - // sigc::mem_fun(show_dialog_gradient))); - //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Tool Options"), - // sigc::mem_fun(show_dialog_tool_options))); - //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Colors..."), - // sigc::mem_fun(show_dialog_color))); - //filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Color Palette..."), - // sigc::mem_fun(show_dialog_palette))); filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Input Devices..."), sigc::ptr_fun(&show_dialog_input))); filemenu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Setup..."), @@ -349,9 +339,8 @@ Toolbox::Toolbox(): table1->set_col_spacings(0); table1->attach(*menubar1, 0,1, 0,1, Gtk::FILL|Gtk::EXPAND, Gtk::SHRINK, 0, 0); table1->attach(*file_buttons, 0,1, 1,2, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0); - //table1->attach(*manage(new Gtk::Label(_("Tools"))), 0, 1, 2, 3, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0); - table1->attach(*handle_tools, 0,1, 3,4, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0); - table1->attach(*handle_defaults, 0,1, 4,5, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0); + table1->attach(*handle_tools, 0,1, 2,3, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0); + table1->attach(*handle_defaults, 0,1, 3,4, Gtk::FILL|Gtk::EXPAND,Gtk::EXPAND|Gtk::FILL, 0, 0); table1->show_all(); diff --git a/synfig-studio/src/gtkmm/widget_vector.cpp b/synfig-studio/src/gtkmm/widget_vector.cpp index ad82683..f905d34 100644 --- a/synfig-studio/src/gtkmm/widget_vector.cpp +++ b/synfig-studio/src/gtkmm/widget_vector.cpp @@ -211,8 +211,6 @@ Widget_Vector::set_canvas(synfig::Canvas::LooseHandle x) { spinbutton_x->hide(); spinbutton_y->hide(); -// delete spinbutton_x; -// delete spinbutton_y; } distance_x->show(); distance_y->show(); -- 2.7.4