|
|
|
|
@ -29,7 +29,6 @@ open_folder(const boost::filesystem::path& dir_path) {
|
|
|
|
|
bool Directories::Controller::IsIgnored(std::string path) { |
|
|
|
|
DEBUG("Checking if file-/directory is filtered"); |
|
|
|
|
std::transform(path.begin(), path.end(), path.begin(), ::tolower); |
|
|
|
|
// std::cout << "ignored?: " << path << std::endl;
|
|
|
|
|
if (config().IsException(path)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
@ -48,7 +47,7 @@ list_dirs(const boost::filesystem::path& dir_path,
|
|
|
|
|
unsigned file_counter = 0; |
|
|
|
|
Gtk::TreeModel::Row child; |
|
|
|
|
Gtk::TreeModel::Row row; |
|
|
|
|
DEBUG_VAR(dir_path); |
|
|
|
|
DEBUG(""); |
|
|
|
|
// Fill the treeview
|
|
|
|
|
for ( boost::filesystem::directory_iterator itr( dir_path ); |
|
|
|
|
itr != end_itr; |
|
|
|
|
@ -80,15 +79,17 @@ list_dirs(const boost::filesystem::path& dir_path,
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int Directories::Controller::count(const std::string path) { |
|
|
|
|
int count = 0; |
|
|
|
|
for (int i = 0; i < path.size(); i++) |
|
|
|
|
if (path[i] == '/') count++; |
|
|
|
|
if (path[i] == '/') |
|
|
|
|
count++; |
|
|
|
|
return count; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
std::string Directories::Controller:: |
|
|
|
|
GetCmakeVarValue(const boost::filesystem::path& dir_path, std::string command_name) { |
|
|
|
|
std::string Directories::Controller:: |
|
|
|
|
GetCmakeVarValue(const boost::filesystem::path& dir_path, std::string command_name) { |
|
|
|
|
INFO("fetches cmake variable value for: "+command_name); |
|
|
|
|
std::string project_name; |
|
|
|
|
std::string project_name_var; |
|
|
|
|
@ -155,32 +156,32 @@ int Directories::Controller::count(const std::string path) {
|
|
|
|
|
} |
|
|
|
|
INFO("Couldn't find value in CMakeLists.txt"); |
|
|
|
|
return "no project name"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Directories::Config::Config() { |
|
|
|
|
} |
|
|
|
|
Directories::Config::Config(Directories::Config& cfg) : |
|
|
|
|
Directories::Config::Config() { |
|
|
|
|
} |
|
|
|
|
Directories::Config::Config(Directories::Config& cfg) : |
|
|
|
|
ignore_list_(cfg.ignore_list()), exception_list_(cfg.exception_list()) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Directories::Config::AddIgnore(std::string filter) { |
|
|
|
|
void Directories::Config::AddIgnore(std::string filter) { |
|
|
|
|
ignore_list_.push_back(filter); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Directories::Config::AddException(std::string filter) { |
|
|
|
|
void Directories::Config::AddException(std::string filter) { |
|
|
|
|
exception_list_.push_back(filter); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Directories::Config::IsIgnored(std::string str) { |
|
|
|
|
bool Directories::Config::IsIgnored(std::string str) { |
|
|
|
|
for ( auto &i : ignore_list() ) |
|
|
|
|
if (str.find(i, 0) != std::string::npos) |
|
|
|
|
return true; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool Directories::Config::IsException(std::string str) { |
|
|
|
|
bool Directories::Config::IsException(std::string str) { |
|
|
|
|
for ( std::string &i : exception_list() ) |
|
|
|
|
if (i == str) |
|
|
|
|
return true; |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|