From 663a5d01b1931b97370ed8feff3ae229a9cc7ea4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 2 Jan 2021 14:02:44 +0100 Subject: Format all code with clang-format --- src/UIFile.hpp | 58 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) (limited to 'src/UIFile.hpp') 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 @@ -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 open(const std::string& base_name) - { - std::string ui_filename; + static Glib::RefPtr 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(); - } + std::stringstream ss; + ss << "Unable to find " << base_name << std::endl; + throw std::runtime_error(ss.str()); + return Glib::RefPtr(); + } }; } // namespace patchage -- cgit v1.2.1