From e49aa2e635aacdd474181abd19bff47ac1785f8c Mon Sep 17 00:00:00 2001 From: tedjk Date: Tue, 12 May 2015 12:56:34 +0200 Subject: [PATCH] added some logging --- juci/api.cc | 3 +-- juci/config.cc | 6 ++++++ juci/config.json | 1 + juci/directories.cc | 7 +++++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/juci/api.cc b/juci/api.cc index 0ae1587..989bd3e 100644 --- a/juci/api.cc +++ b/juci/api.cc @@ -1,4 +1,5 @@ #include "api.h" +#include "logging.h" Menu::Controller* PluginApi::menu_; Notebook::Controller* PluginApi::notebook_; @@ -13,8 +14,6 @@ PluginApi::PluginApi(Menu::Controller& menu_ctl_, } PluginApi::~PluginApi() { - delete menu_; - delete notebook_; menu_ = NULL; notebook_ = NULL; } diff --git a/juci/config.cc b/juci/config.cc index 49de901..22dbffb 100644 --- a/juci/config.cc +++ b/juci/config.cc @@ -1,4 +1,5 @@ #include "config.h" +#include "logging.h" MainConfig::MainConfig() : keybindings_cfg_(), source_cfg_() { @@ -9,6 +10,7 @@ MainConfig::MainConfig() : } void MainConfig::GenerateSource() { + INFO("Generating source cfg"); boost::property_tree::ptree source_json = cfg_.get_child("source"); boost::property_tree::ptree syntax_json = source_json.get_child("syntax"); boost::property_tree::ptree colors_json = source_json.get_child("colors"); @@ -18,19 +20,23 @@ void MainConfig::GenerateSource() { for (auto &i : syntax_json) { source_cfg_.InsertType(i.first, i.second.get_value()); } + INFO("Source cfg generated"); } void MainConfig::GenerateKeybindings() { + INFO("Generating keybindings"); std::string line; std::ifstream menu_xml("menu.xml"); if (menu_xml.is_open()) { while (getline(menu_xml, line)) { keybindings_cfg_.AppendXml(line); } + } boost::property_tree::ptree keys_json = cfg_.get_child("keybindings"); for (auto &i : keys_json) keybindings_cfg_.key_map()[i.first] = i.second.get_value(); + INFO("Keybindings generated"); } void MainConfig::GenerateDirectoryFilter() { diff --git a/juci/config.json b/juci/config.json index 3305cf8..9344fbb 100644 --- a/juci/config.json +++ b/juci/config.json @@ -36,6 +36,7 @@ "#", "~", ".idea", + ".so", "in-lowercase.pls" ], "exceptions": [ diff --git a/juci/directories.cc b/juci/directories.cc index fd86611..c54ba0e 100644 --- a/juci/directories.cc +++ b/juci/directories.cc @@ -1,4 +1,5 @@ #include "directories.h" +#include "logging.h" Directories::Controller::Controller(Directories::Config& cfg) : config_(cfg) { @@ -8,6 +9,7 @@ Directories::Controller::Controller(Directories::Config& cfg) : void Directories::Controller:: open_folder(const boost::filesystem::path& dir_path) { + INFO("Open folder"); m_refTreeModel = Gtk::TreeStore::create(view()); m_TreeView.set_model(m_refTreeModel); m_TreeView.remove_all_columns(); @@ -17,6 +19,7 @@ open_folder(const boost::filesystem::path& dir_path) { Gtk::TreeModel::Row row; list_dirs(dir_path, row, row_id); m_refTreeModel->set_sort_column(0, Gtk::SortType::SORT_ASCENDING); + INFO("Folder opened"); } bool Directories::Controller::IsIgnored(std::string path) { @@ -80,6 +83,7 @@ int Directories::Controller::count(const std::string path) { 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; boost::filesystem::directory_iterator end_itr; @@ -100,6 +104,7 @@ int Directories::Controller::count(const std::string path) { if (variable_start == std::string::npos) { // not a variable variable_start = line.find("(", 0); variable_end = line.find(")", variable_start); + INFO("Wasn't a variable, returning value"); return line.substr(variable_start+1, (variable_end)-variable_start-1); } @@ -117,6 +122,7 @@ int Directories::Controller::count(const std::string path) { project_name = line.substr(variable_start+1, variable_end-variable_start-1); boost::algorithm::trim(project_name); + INFO("found variable, returning value"); return project_name; } } @@ -124,6 +130,7 @@ int Directories::Controller::count(const std::string path) { break; } } + INFO("Couldn't find value in CMakeLists.txt"); return "no project name"; }