summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2007-06-27 12:12:44 +0000
committerTim Mayberry <mojofunk@gmail.com>2007-06-27 12:12:44 +0000
commita075a1c3cbb0b7fe5546ee1f92a6bde42b049a6d (patch)
tree004821109da2bdb84ac6f9862b6b166cedb37888 /gtk2_ardour
parente6986c036059c9f9d5608f0b33f8c6d6ca1664ad (diff)
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
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/utils.cc20
1 files 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 <gtkmm/paned.h>
#include <gtk/gtkpaned.h>
+#include <pbd/file_utils.h>
+
#include <gtkmm2ext/utils.h>
-#include <ardour/ardour.h>
+//#include <ardour/ardour.h>
+
+#include <ardour/filesystem_paths.h>
#include "ardour_ui.h"
#include "keyboard.h"
@@ -488,7 +492,19 @@ Glib::RefPtr<Gdk::Pixbuf>
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]);