MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / Load

Method Load

DSView/pv/ui/langresource.cpp:87–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87bool LangResource::Load(int lang)
88{
89 std::lock_guard<std::mutex> lock(_mutex);
90
91 int num = sizeof(lang_id_keys) / sizeof(lang_key_item);
92 const char *lan_name = get_lang_key(lang);
93
94 if (lan_name == NULL)
95 {
96 dsv_err("Can't find language key,lang:%d", lang);
97 return false;
98 }
99
100 _cur_lang = lang;
101 _query_decoders.clear();
102 release_self();
103
104 num = sizeof(lange_page_keys) / sizeof(lang_page_item);
105
106 for (int i = 0; i < num; i++)
107 {
108 Lang_resource_page *p = new Lang_resource_page();
109 p->_id = lange_page_keys[i].id;
110 p->_source = lange_page_keys[i].source;
111 p->_is_dynamic = lange_page_keys[i].is_dynamic;
112 _pages.push_back(p);
113 }
114
115 return true;
116}
117
118void LangResource::Release()
119{

Callers 2

mainFunction · 0.80
switchLanguageMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected