From c2d0d3798f6f3ae62d8796693616686333986394 Mon Sep 17 00:00:00 2001 From: Frank Ueberschar Date: Tue, 11 Sep 2018 15:33:37 +0200 Subject: [PATCH] traymon: implemented callback when config is ready - load local resource types map --- core/src/qt-tray-monitor/tray_conf.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/qt-tray-monitor/tray_conf.cc b/core/src/qt-tray-monitor/tray_conf.cc index a20bf44d860..6130bf007a3 100644 --- a/core/src/qt-tray-monitor/tray_conf.cc +++ b/core/src/qt-tray-monitor/tray_conf.cc @@ -385,11 +385,21 @@ static bool SaveResource(int type, ResourceItem *items, int pass) return (error == 0); } +static void ConfigReadyCallback(ConfigurationParser &my_config) +{ + std::map map{{R_MONITOR, "R_MONITOR"}, + {R_DIRECTOR, "R_DIRECTOR"}, + {R_CLIENT, "R_CLIENT"}, + {R_STORAGE, "R_STORAGE"}, + {R_CONSOLE_FONT, "R_CONSOLE_FONT"}}; + my_config.InitializeQualifiedResourceNameTypeConverter(map); +} + ConfigurationParser *InitTmonConfig(const char *configfile, int exit_code) { return new ConfigurationParser(configfile, nullptr, nullptr, nullptr, nullptr, nullptr, exit_code, (void *)&res_all, res_all_size, R_FIRST, R_LAST, resources, res_head, - default_config_filename.c_str(), "tray-monitor.d", nullptr, + default_config_filename.c_str(), "tray-monitor.d", ConfigReadyCallback, SaveResource, DumpResource, FreeResource); }