From 606229cc79b2556654034b83ac999f5a3d8f68ce Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Wed, 27 Jun 2007 12:12:48 +0000 Subject: [PATCH] Use PBD::find_file_in_search_path and ardour/filesystem_paths.h to find icons git-svn-id: svn://localhost/ardour2/trunk@2064 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/utils.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index db93360984..e47be6a54b 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -516,14 +516,18 @@ get_icon (const char* cname) string name = cname; name += X_(".png"); - string path = ARDOUR::find_data_file (name, "icons"); + SearchPath spath(ARDOUR::ardour_search_path()); + spath += ARDOUR::system_data_search_path(); - if (path.empty()) { + spath.add_subdirectory_to_paths("icons"); + + sys::path data_file_path; + + if(!find_file_in_search_path (spath, name, data_file_path)) { fatal << string_compose (_("cannot find icon image for %1"), name) << endmsg; - /*NOTREACHED*/ } - return Gdk::Pixbuf::create_from_file (path); + return Gdk::Pixbuf::create_from_file (data_file_path.to_string()); } string