From 34d08da015358e09229ebd7f01744432901bdc47 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sun, 22 Jul 2018 00:19:53 +0200 Subject: Fixing coding style --- src/io/resource.cpp | 13 +++++++------ src/io/resource.h | 14 +++++--------- 2 files changed, 12 insertions(+), 15 deletions(-) (limited to 'src/io') diff --git a/src/io/resource.cpp b/src/io/resource.cpp index 127b92b76..65fd01d0e 100644 --- a/src/io/resource.cpp +++ b/src/io/resource.cpp @@ -318,27 +318,28 @@ void get_filenames_from_path(std::vector &files, Glib::ustring pa * path - The directory to parse, will add nothing if directory doesn't exist * exclusions - Exclude files that exactly match these names. */ -void get_foldernames_from_path(std::vector &folders, Glib::ustring path, std::vector exclusions) +void get_foldernames_from_path(std::vector &folders, Glib::ustring path, + std::vector exclusions) { - if(!Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) { + if (!Glib::file_test(path, Glib::FILE_TEST_IS_DIR)) { return; } Glib::Dir dir(path); std::string file = dir.read_name(); - while (!file.empty()){ + while (!file.empty()) { // If not extensions are specified, don't reject ANY files. bool reject = false; // Reject any file which matches the exclusions. - for (auto &exc: exclusions) { - reject |= Glib::str_has_prefix(file, exc); + for (auto &exc : exclusions) { + reject |= Glib::str_has_prefix(file, exc); } // Reject any filename which isn't a regular file Glib::ustring filename = Glib::build_filename(path, file); - if(Glib::file_test(filename, Glib::FILE_TEST_IS_DIR) && !reject) { + if (Glib::file_test(filename, Glib::FILE_TEST_IS_DIR) && !reject) { folders.push_back(filename); } file = dir.read_name(); diff --git a/src/io/resource.h b/src/io/resource.h index f70e55447..d86eda51a 100644 --- a/src/io/resource.h +++ b/src/io/resource.h @@ -79,23 +79,19 @@ std::vector get_filenames(Glib::ustring path, std::vector extensions={}, std::vector exclusions={}); -std::vector get_foldernames(Type type, - std::vector exclusions={}); +std::vector get_foldernames(Type type, std::vector exclusions = {}); -std::vector get_foldernames(Domain domain, Type type, - std::vector exclusions={}); +std::vector get_foldernames(Domain domain, Type type, std::vector exclusions = {}); -std::vector get_foldernames(Glib::ustring path, - std::vector exclusions={}); +std::vector get_foldernames(Glib::ustring path, std::vector exclusions = {}); void get_filenames_from_path(std::vector &files, Glib::ustring path, std::vector extensions={}, std::vector exclusions={}); -void get_foldernames_from_path(std::vector &files, - Glib::ustring path, - std::vector exclusions={}); +void get_foldernames_from_path(std::vector &files, Glib::ustring path, + std::vector exclusions = {}); char *profile_path(const char *filename); -- cgit v1.2.3