diff options
author | David Robillard <d@drobilla.net> | 2021-01-02 14:02:44 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2021-01-02 14:02:44 +0100 |
commit | 663a5d01b1931b97370ed8feff3ae229a9cc7ea4 (patch) | |
tree | aba74794cb45f06734bd80bbf53d79f947008e54 /src/UIFile.hpp | |
parent | 1936aace80b5594078d874e9b661a9a91e461279 (diff) | |
download | patchage-663a5d01b1931b97370ed8feff3ae229a9cc7ea4.tar.gz patchage-663a5d01b1931b97370ed8feff3ae229a9cc7ea4.tar.bz2 patchage-663a5d01b1931b97370ed8feff3ae229a9cc7ea4.zip |
Format all code with clang-format
Diffstat (limited to 'src/UIFile.hpp')
-rw-r--r-- | src/UIFile.hpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/UIFile.hpp b/src/UIFile.hpp index 08c2b42..ee0c4b7 100644 --- a/src/UIFile.hpp +++ b/src/UIFile.hpp @@ -20,7 +20,7 @@ #include "patchage_config.h" #ifdef PATCHAGE_BINLOC -# include "binary_location.h" +# include "binary_location.h" #endif #include <glibmm/refptr.h> @@ -37,38 +37,38 @@ namespace patchage { class UIFile { public: - inline static bool is_readable(const std::string& filename) - { - std::ifstream fs(filename.c_str()); - const bool fail = fs.fail(); - fs.close(); - return !fail; - } + inline static bool is_readable(const std::string& filename) + { + std::ifstream fs(filename.c_str()); + const bool fail = fs.fail(); + fs.close(); + return !fail; + } - static Glib::RefPtr<Gtk::Builder> open(const std::string& base_name) - { - std::string ui_filename; + static Glib::RefPtr<Gtk::Builder> open(const std::string& base_name) + { + std::string ui_filename; #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 = 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); + } + } #endif - ui_filename = std::string(PATCHAGE_DATA_DIR) + "/" + 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); - } + ui_filename = std::string(PATCHAGE_DATA_DIR) + "/" + 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); + } - std::stringstream ss; - ss << "Unable to find " << base_name << std::endl; - throw std::runtime_error(ss.str()); - return Glib::RefPtr<Gtk::Builder>(); - } + std::stringstream ss; + ss << "Unable to find " << base_name << std::endl; + throw std::runtime_error(ss.str()); + return Glib::RefPtr<Gtk::Builder>(); + } }; } // namespace patchage |