X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fhistorytreestore.cpp;h=bc0c97ad8879ddc450345df8a3a6c6750cbc2d90;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=ae6016a932122aeb98bf33cb0c04bb9ca472fb3d;hpb=ce408de81ca266b1f334ee9bc6c8fb7ba1492ed4;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/historytreestore.cpp b/synfig-studio/trunk/src/gtkmm/historytreestore.cpp index ae6016a..bc0c97a 100644 --- a/synfig-studio/trunk/src/gtkmm/historytreestore.cpp +++ b/synfig-studio/trunk/src/gtkmm/historytreestore.cpp @@ -2,10 +2,11 @@ /*! \file historytreestore.cpp ** \brief Template File ** -** $Id: historytreestore.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -31,12 +32,14 @@ #include "historytreestore.h" #include -#include "iconcontroler.h" +#include "iconcontroller.h" #include #include #include #include "instance.h" +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -75,7 +78,8 @@ HistoryTreeStore::HistoryTreeStore(etl::loose_handle instance_ HistoryTreeStore::~HistoryTreeStore() { - synfig::info("HistoryTreeStore::~HistoryTreeStore(): Deleted"); + if (getenv("SYNFIG_DEBUG_DESTRUCTORS")) + synfig::info("HistoryTreeStore::~HistoryTreeStore(): Deleted"); } Glib::RefPtr @@ -88,22 +92,22 @@ void HistoryTreeStore::rebuild() { synfigapp::Action::Stack::const_iterator iter; - + clear(); - + for(iter=instance()->undo_action_stack().begin();iter!=instance()->undo_action_stack().end();++iter) { - insert_action(*(prepend()),*iter,true,true,false); + insert_action(*(prepend()),*iter,true,true,false); } curr_row=*children().end(); for(iter=instance()->redo_action_stack().begin();iter!=instance()->redo_action_stack().end();++iter) { - insert_action(*(append()),*iter,true,false,true); - } + insert_action(*(append()),*iter,true,false,true); + } } void -HistoryTreeStore::insert_action(Gtk::TreeRow row,etl::handle action, bool is_active, bool is_undo, bool is_redo) +HistoryTreeStore::insert_action(Gtk::TreeRow row,etl::handle action, bool /*is_active*/, bool is_undo, bool is_redo) { assert(action); @@ -112,13 +116,13 @@ HistoryTreeStore::insert_action(Gtk::TreeRow row,etl::handleis_active(); row[model.is_undo] = is_undo; row[model.is_redo] = is_redo; - + synfigapp::Action::CanvasSpecific *specific_action; specific_action=dynamic_cast(action.get()); if(specific_action) { row[model.canvas] = specific_action->get_canvas(); - row[model.canvas_id] = specific_action->get_canvas()->get_id(); + row[model.canvas_id] = specific_action->get_canvas()->get_id(); } etl::handle group; @@ -132,8 +136,8 @@ HistoryTreeStore::insert_action(Gtk::TreeRow row,etl::handleis_active(); return; } - } + } +} + +bool +HistoryTreeStore::search_func(const Glib::RefPtr&,int,const Glib::ustring& x,const Gtk::TreeModel::iterator& iter) +{ + const Model model; + + Glib::ustring substr(x.uppercase()); + Glib::ustring name((*iter)[model.name]); + name=name.uppercase(); + + return name.find(substr)==Glib::ustring::npos; }