X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Ftoolbox.cpp;h=22ba151fcb171b01fc80fd3a323564871e203ecd;hb=c3ad95144d148602f672e95ddda1f18fc35502f8;hp=f29025df0d533770ddaba20094becff7ded43dc8;hpb=ae541a6f7dabada6e3a4fba01bd6bdc7db400892;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/toolbox.cpp b/synfig-studio/trunk/src/gtkmm/toolbox.cpp index f29025d..22ba151 100644 --- a/synfig-studio/trunk/src/gtkmm/toolbox.cpp +++ b/synfig-studio/trunk/src/gtkmm/toolbox.cpp @@ -557,19 +557,27 @@ Toolbox::on_recent_files_changed() recent_files_menu->remove(**recent_files_menu->get_children().begin()); list::const_iterator iter; - // Check to see if the file is already on the list. - // If it is, then remove it from the list for(iter=App::get_recent_files().begin();iter!=App::get_recent_files().end();iter++) - recent_files_menu->items().push_back(Gtk::Menu_Helpers::MenuElem(basename(*iter), + { + string raw = basename(*iter), quoted; + size_t pos = 0, last_pos = 0; + + // replace _ in filenames by __ or it won't show up in the menu + for (pos = last_pos = 0; (pos = raw.find('_', pos)) != string::npos; last_pos = pos) + quoted += raw.substr(last_pos, ++pos - last_pos) + '_'; + quoted += raw.substr(last_pos); + + recent_files_menu->items().push_back(Gtk::Menu_Helpers::MenuElem(quoted, sigc::hide_return(sigc::bind(sigc::ptr_fun(&App::open),*iter)) )); + } // HACK show(); } void -Toolbox::on_drop_drag_data_received(const Glib::RefPtr& context, int x, int y, const Gtk::SelectionData& selection_data_, guint info, guint time) +Toolbox::on_drop_drag_data_received(const Glib::RefPtr& context, int /*x*/, int /*y*/, const Gtk::SelectionData& selection_data_, guint /*info*/, guint time) { // We will make this true once we have a solid drop bool success(false);