Browse Source

Merge branch 'zalox-master'

merge-requests/365/head
eidheim 10 years ago
parent
commit
9fd09abd67
  1. 5
      src/config.cc
  2. 2
      src/source_clang.cc
  3. 1
      src/terminal.h
  4. 4
      src/window.cc

5
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);
@ -71,6 +71,7 @@ void MainConfig::retrieve_config() {
Singleton::Config::window()->default_size = {cfg.get<int>("default_window_size.width"), cfg.get<int>("default_window_size.height")};
Singleton::Config::terminal()->make_command=cfg.get<std::string>("project.make_command");
Singleton::Config::terminal()->cmake_command=cfg.get<std::string>("project.cmake_command");
Singleton::Config::terminal()->clang_format_command=cfg.get<std::string>("project.clang_format_command", "clang-format");
Singleton::Config::terminal()->history_size=cfg.get<int>("terminal_history_size");
}
@ -162,6 +163,8 @@ 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<std::string>());
for ( auto &i : ignore_json )

2
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') {

1
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;
};

4
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();
}

Loading…
Cancel
Save