From 955c64efcf30e87ab3d4bdb1520745c1997f0953 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 20 Oct 2008 02:02:27 +0000 Subject: Make Ingen and Patchage relocatable binaries when built as a bundle. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1690 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/GladeFactory.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/gui/GladeFactory.cpp') diff --git a/src/gui/GladeFactory.cpp b/src/gui/GladeFactory.cpp index 81640d57..792e67ac 100644 --- a/src/gui/GladeFactory.cpp +++ b/src/gui/GladeFactory.cpp @@ -19,6 +19,7 @@ #include #include #include "config.h" +#include "shared/runtime_paths.hpp" using namespace std; @@ -36,21 +37,15 @@ GladeFactory::find_glade_file() if (env_path) glade_filename = env_path; else - glade_filename = "./ingen_gui.glade"; + glade_filename = Shared::data_file_path("ingen_gui.glade"); ifstream fs(glade_filename.c_str()); - if (fs.fail()) { // didn't find it, check INGEN_DATA_DIR - fs.clear(); - glade_filename = INGEN_DATA_DIR; - glade_filename += "/ingen_gui.glade"; - - fs.open(glade_filename.c_str()); - if (fs.fail()) { - cerr << "[GladeFactory] Unable to find ingen_gui.glade in current directory or " << INGEN_DATA_DIR << "." << endl; - throw; - } - fs.close(); + if (fs.fail()) { + cerr << "Unable to find ingen_gui.glade in " << INGEN_DATA_DIR << endl; + throw; } + + fs.close(); cerr << "[GladeFactory] Loading widgets from " << glade_filename.c_str() << endl; } -- cgit v1.2.1