Browse Source

commit for merge

master
tedjk 11 years ago
parent
commit
8b2698cfa5
  1. 5
      juci/config.cc

5
juci/config.cc

@ -4,6 +4,7 @@
MainConfig::MainConfig() : MainConfig::MainConfig() :
keybindings_cfg_(), source_cfg_() { keybindings_cfg_(), source_cfg_() {
boost::property_tree::json_parser::read_json("config.json", cfg_); boost::property_tree::json_parser::read_json("config.json", cfg_);
GenerateSource(); GenerateSource();
GenerateKeybindings(); GenerateKeybindings();
GenerateDirectoryFilter(); GenerateDirectoryFilter();
@ -28,11 +29,9 @@ void MainConfig::GenerateKeybindings() {
std::string line; std::string line;
std::ifstream menu_xml("menu.xml"); std::ifstream menu_xml("menu.xml");
if (menu_xml.is_open()) { if (menu_xml.is_open()) {
while (getline(menu_xml, line)) { while (getline(menu_xml, line))
keybindings_cfg_.AppendXml(line); keybindings_cfg_.AppendXml(line);
} }
}
boost::property_tree::ptree keys_json = cfg_.get_child("keybindings"); boost::property_tree::ptree keys_json = cfg_.get_child("keybindings");
for (auto &i : keys_json) for (auto &i : keys_json)
keybindings_cfg_.key_map()[i.first] = i.second.get_value<std::string>(); keybindings_cfg_.key_map()[i.first] = i.second.get_value<std::string>();

Loading…
Cancel
Save