From 7d69ca85abfd7eb5d8de528a7c1ab7a1ccde9e71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 28 Oct 2015 20:28:28 +0100 Subject: [PATCH 1/7] Now updates directory filters in real time --- src/config.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/config.cc b/src/config.cc index a50ade1..e030f32 100644 --- a/src/config.cc +++ b/src/config.cc @@ -162,10 +162,15 @@ void MainConfig::GenerateDirectoryFilter() { boost::property_tree::ptree dir_json = cfg.get_child("directoryfilter"); boost::property_tree::ptree ignore_json = dir_json.get_child("ignore"); boost::property_tree::ptree except_json = dir_json.get_child("exceptions"); + dir_cfg->exceptions.clear(); + dir_cfg->ignored.clear(); for ( auto &i : except_json ) dir_cfg->exceptions.emplace_back(i.second.get_value()); for ( auto &i : ignore_json ) dir_cfg->ignored.emplace_back(i.second.get_value()); + if(Singleton::directories() != nullptr) { + Singleton::directories()->update(); + } } void MainConfig::init_home_path(){ From 785f4ef1232a47d6216f6845c9ecadb2c58c6224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 28 Oct 2015 20:38:45 +0100 Subject: [PATCH 2/7] Add clang-format command to configuration. I use clang-format-3.7 for instance. --- src/config.cc | 1 + src/files.h | 1 + src/source_clang.cc | 2 +- src/terminal.h | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config.cc b/src/config.cc index e030f32..01e81b2 100644 --- a/src/config.cc +++ b/src/config.cc @@ -71,6 +71,7 @@ void MainConfig::retrieve_config() { Singleton::Config::window()->default_size = {cfg.get("default_window_size.width"), cfg.get("default_window_size.height")}; Singleton::Config::terminal()->make_command=cfg.get("project.make_command"); Singleton::Config::terminal()->cmake_command=cfg.get("project.cmake_command"); + Singleton::Config::terminal()->clang_format_commad=cfg.get("project.clang_format_command"); Singleton::Config::terminal()->history_size=cfg.get("terminal_history_size"); } diff --git a/src/files.h b/src/files.h index eee5f0d..45f68ca 100644 --- a/src/files.h +++ b/src/files.h @@ -105,6 +105,7 @@ const std::string configjson = " \"cmake_command\": \"cmake\",\n" #endif " \"make_command\": \"make\"\n" +" \"clang_format_command\": \"clang-format\"\n" " },\n" " \"documentation_searches\": {\n" " \"clang\": {\n" diff --git a/src/source_clang.cc b/src/source_clang.cc index 533d7e7..b47a7ac 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -924,7 +924,7 @@ Source::ClangViewAutocomplete(file_path, project_path, language) { }); auto_indent=[this]() { - std::string command="clang-format"; + auto command=Singleton::Config::terminal()->clang_format_command; unsigned indent_width; std::string tab_style; if(tab_char=='\t') { diff --git a/src/terminal.h b/src/terminal.h index dcd0da9..526fa3f 100644 --- a/src/terminal.h +++ b/src/terminal.h @@ -16,6 +16,7 @@ public: public: std::string cmake_command; std::string make_command; + std::string clang_format_command; int history_size; }; From 64124dff76ca990374be9eb9a4220d76df263bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 28 Oct 2015 20:39:47 +0100 Subject: [PATCH 3/7] Version bump due to config update --- src/files.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/files.h b/src/files.h index 45f68ca..41ef6fb 100644 --- a/src/files.h +++ b/src/files.h @@ -1,6 +1,6 @@ #include -#define JUCI_VERSION "0.9.4" +#define JUCI_VERSION "0.9.41" #define JUCI_ENV_SEARCH_LOCATIONS {"AppData", "HOME", "JUCI_HOME"} From f53d3086df283901af02062739e9c877be58d22a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 28 Oct 2015 20:53:08 +0100 Subject: [PATCH 4/7] Fix typos --- src/config.cc | 2 +- src/files.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config.cc b/src/config.cc index 01e81b2..bacee9e 100644 --- a/src/config.cc +++ b/src/config.cc @@ -71,7 +71,7 @@ void MainConfig::retrieve_config() { Singleton::Config::window()->default_size = {cfg.get("default_window_size.width"), cfg.get("default_window_size.height")}; Singleton::Config::terminal()->make_command=cfg.get("project.make_command"); Singleton::Config::terminal()->cmake_command=cfg.get("project.cmake_command"); - Singleton::Config::terminal()->clang_format_commad=cfg.get("project.clang_format_command"); + Singleton::Config::terminal()->clang_format_command=cfg.get("project.clang_format_command"); Singleton::Config::terminal()->history_size=cfg.get("terminal_history_size"); } diff --git a/src/files.h b/src/files.h index 41ef6fb..0b3196e 100644 --- a/src/files.h +++ b/src/files.h @@ -104,7 +104,7 @@ const std::string configjson = #else " \"cmake_command\": \"cmake\",\n" #endif -" \"make_command\": \"make\"\n" +" \"make_command\": \"make\",\n" " \"clang_format_command\": \"clang-format\"\n" " },\n" " \"documentation_searches\": {\n" From a2018ef0d7547057e7dadea82f2e568413033195 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Wed, 28 Oct 2015 20:54:23 +0100 Subject: [PATCH 5/7] fixes print of config.json two times --- src/config.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.cc b/src/config.cc index bacee9e..c4bef50 100644 --- a/src/config.cc +++ b/src/config.cc @@ -20,7 +20,7 @@ void MainConfig::read() { retrieve_config(); } catch(const std::exception &e) { - Singleton::terminal()->print("Error reading "+config_json + "config.json: "+e.what()+"\n"); + Singleton::terminal()->print("Error reading "+config_json+": "+e.what()+"\n"); std::stringstream ss; ss << configjson; boost::property_tree::read_json(ss, cfg); From 51904924d2b6caf43e310aa82fe09ea1278546b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Thu, 29 Oct 2015 17:34:12 +0100 Subject: [PATCH 6/7] Remove clang-format option --- src/config.cc | 2 +- src/files.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/config.cc b/src/config.cc index c4bef50..c424ba2 100644 --- a/src/config.cc +++ b/src/config.cc @@ -71,7 +71,7 @@ void MainConfig::retrieve_config() { Singleton::Config::window()->default_size = {cfg.get("default_window_size.width"), cfg.get("default_window_size.height")}; Singleton::Config::terminal()->make_command=cfg.get("project.make_command"); Singleton::Config::terminal()->cmake_command=cfg.get("project.cmake_command"); - Singleton::Config::terminal()->clang_format_command=cfg.get("project.clang_format_command"); + Singleton::Config::terminal()->clang_format_command=cfg.get("project.clang_format_command", "clang-format"); Singleton::Config::terminal()->history_size=cfg.get("terminal_history_size"); } diff --git a/src/files.h b/src/files.h index 0b3196e..5ddf8c2 100644 --- a/src/files.h +++ b/src/files.h @@ -104,8 +104,7 @@ const std::string configjson = #else " \"cmake_command\": \"cmake\",\n" #endif -" \"make_command\": \"make\",\n" -" \"clang_format_command\": \"clang-format\"\n" +" \"make_command\": \"make\"\n" " },\n" " \"documentation_searches\": {\n" " \"clang\": {\n" From f1b3e8757b3c9304a5e02a4b32498b47a2045538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lien=20Sell=C3=A6g?= Date: Thu, 29 Oct 2015 17:34:42 +0100 Subject: [PATCH 7/7] Reset version and move of directories update --- src/config.cc | 3 --- src/files.h | 2 +- src/window.cc | 4 +++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/config.cc b/src/config.cc index c424ba2..422e567 100644 --- a/src/config.cc +++ b/src/config.cc @@ -169,9 +169,6 @@ void MainConfig::GenerateDirectoryFilter() { dir_cfg->exceptions.emplace_back(i.second.get_value()); for ( auto &i : ignore_json ) dir_cfg->ignored.emplace_back(i.second.get_value()); - if(Singleton::directories() != nullptr) { - Singleton::directories()->update(); - } } void MainConfig::init_home_path(){ diff --git a/src/files.h b/src/files.h index 5ddf8c2..eee5f0d 100644 --- a/src/files.h +++ b/src/files.h @@ -1,6 +1,6 @@ #include -#define JUCI_VERSION "0.9.41" +#define JUCI_VERSION "0.9.4" #define JUCI_ENV_SEARCH_LOCATIONS {"AppData", "HOME", "JUCI_HOME"} diff --git a/src/window.cc b/src/window.cc index c1a4d56..993e942 100644 --- a/src/window.cc +++ b/src/window.cc @@ -132,7 +132,9 @@ void Window::configure() { auto css_provider = Gtk::CssProvider::get_named(Singleton::Config::window()->theme_name, Singleton::Config::window()->theme_variant); //TODO: add check if theme exists, or else write error to Singleton::terminal() style_context->add_provider_for_screen(screen, css_provider, GTK_STYLE_PROVIDER_PRIORITY_SETTINGS); - + if(Singleton::directories() != nullptr) { + Singleton::directories()->update(); + } Singleton::menu()->set_keys(); }