|
|
|
|
@ -11,21 +11,26 @@ MainConfig::MainConfig() :
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainConfig::GenerateSource() { |
|
|
|
|
INFO("Generating source cfg"); |
|
|
|
|
DEBUG("Fetching 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"); |
|
|
|
|
boost::property_tree::ptree extensions_json = source_json.get_child("extensions"); |
|
|
|
|
for (auto &i : colors_json) { |
|
|
|
|
source_cfg_.InsertTag(i.first, i.second.get_value<std::string>()); |
|
|
|
|
} |
|
|
|
|
for (auto &i : syntax_json) { |
|
|
|
|
source_cfg_.InsertType(i.first, i.second.get_value<std::string>()); |
|
|
|
|
} |
|
|
|
|
INFO("Source cfg generated"); |
|
|
|
|
for (auto &i : extensions_json) { |
|
|
|
|
source_cfg_.InsertExtension(i.second.get_value<std::string>()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DEBUG("Source cfg fetched"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainConfig::GenerateKeybindings() { |
|
|
|
|
INFO("Generating keybindings"); |
|
|
|
|
DEBUG("Fetching keybindings"); |
|
|
|
|
std::string line; |
|
|
|
|
std::ifstream menu_xml("menu.xml"); |
|
|
|
|
if (menu_xml.is_open()) { |
|
|
|
|
@ -35,10 +40,11 @@ void MainConfig::GenerateKeybindings() {
|
|
|
|
|
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<std::string>(); |
|
|
|
|
INFO("Keybindings generated"); |
|
|
|
|
DEBUG("Keybindings fetched"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void MainConfig::GenerateDirectoryFilter() { |
|
|
|
|
DEBUG("Fetching directory filter"); |
|
|
|
|
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"); |
|
|
|
|
@ -46,6 +52,5 @@ void MainConfig::GenerateDirectoryFilter() {
|
|
|
|
|
dir_cfg_.AddException(i.second.get_value<std::string>()); |
|
|
|
|
for ( auto &i : ignore_json ) |
|
|
|
|
dir_cfg_.AddIgnore(i.second.get_value<std::string>()); |
|
|
|
|
DEBUG("Directory filter fetched"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|