From a075a1c3cbb0b7fe5546ee1f92a6bde42b049a6d Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Wed, 27 Jun 2007 12:12:44 +0000 Subject: [PATCH] Use PBD::find_file_in_search_path and ardour/filesystem_paths.h to find pixmaps git-svn-id: svn://localhost/ardour2/trunk@2063 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/utils.cc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index d574ece427..db93360984 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -28,8 +28,12 @@ #include #include +#include + #include -#include +//#include + +#include #include "ardour_ui.h" #include "keyboard.h" @@ -488,7 +492,19 @@ Glib::RefPtr get_xpm (std::string name) { if (!xpm_map[name]) { - xpm_map[name] = Gdk::Pixbuf::create_from_file (ARDOUR::find_data_file(name, "pixmaps")); + + SearchPath spath(ARDOUR::ardour_search_path()); + spath += ARDOUR::system_data_search_path(); + + spath.add_subdirectory_to_paths("pixmaps"); + + sys::path data_file_path; + + if(!find_file_in_search_path (spath, name, data_file_path)) { + fatal << string_compose (_("cannot find pixmap %1"), name) << endmsg; + } + + xpm_map[name] = Gdk::Pixbuf::create_from_file (data_file_path.to_string()); } return (xpm_map[name]);