mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
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:
parent
a075a1c3cb
commit
606229cc79
1 changed files with 8 additions and 4 deletions
|
|
@ -516,14 +516,18 @@ get_icon (const char* cname)
|
||||||
string name = cname;
|
string name = cname;
|
||||||
name += X_(".png");
|
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;
|
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
|
string
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue