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
This commit is contained in:
Tim Mayberry 2007-06-27 12:12:48 +00:00
parent a075a1c3cb
commit 606229cc79

View File

@ -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