diff options
author | David Robillard <d@drobilla.net> | 2022-07-19 09:54:48 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-07-20 10:35:05 -0400 |
commit | c0ef025450cf1b7eec85ae8058e0a9e301e7cd16 (patch) | |
tree | 6914ea1a19f3cf656533b902cf823c4953bce5cb /src/UIFile.hpp | |
parent | 4f33eb5ba4e2c116b9413282e18508815ea73966 (diff) | |
download | patchage-c0ef025450cf1b7eec85ae8058e0a9e301e7cd16.tar.gz patchage-c0ef025450cf1b7eec85ae8058e0a9e301e7cd16.tar.bz2 patchage-c0ef025450cf1b7eec85ae8058e0a9e301e7cd16.zip |
Switch to meson build system
Diffstat (limited to 'src/UIFile.hpp')
-rw-r--r-- | src/UIFile.hpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/UIFile.hpp b/src/UIFile.hpp index d7f1e5c..28d7c82 100644 --- a/src/UIFile.hpp +++ b/src/UIFile.hpp @@ -47,25 +47,28 @@ public: static Glib::RefPtr<Gtk::Builder> open(const std::string& base_name) { - std::string ui_filename; + std::cout << "Base name: " << base_name << std::endl; + std::string ui_filename = base_name + ".ui"; + #ifdef PATCHAGE_BINLOC const std::string bundle = bundle_location(); if (!bundle.empty()) { - ui_filename = bundle + "/" + base_name + ".ui"; - if (is_readable(ui_filename)) { - std::cout << "Loading UI file " << ui_filename << std::endl; - return Gtk::Builder::create_from_file(ui_filename); + const std::string bundle_ui_filename = bundle + "/" + ui_filename; + if (is_readable(bundle_ui_filename)) { + std::cout << "Loading UI file " << bundle_ui_filename << std::endl; + return Gtk::Builder::create_from_file(bundle_ui_filename); } } #endif - ui_filename = std::string(PATCHAGE_DATA_DIR) + "/" + base_name + ".ui"; + + ui_filename = std::string(PATCHAGE_DATA_DIR) + "/" + ui_filename; if (is_readable(ui_filename)) { std::cout << "Loading UI file " << ui_filename << std::endl; return Gtk::Builder::create_from_file(ui_filename); } std::stringstream ss; - ss << "Unable to find " << base_name << std::endl; + ss << "Unable to find " << ui_filename << std::endl; throw std::runtime_error(ss.str()); return {}; } |