- //Find configuration file, based on its name
- for (return_code = readdir_r(dir, &ptr, &result);
- result != NULL && return_code == 0;
- return_code = readdir_r(dir, &ptr, &result))
- {
- if (ptr.d_type == DT_REG) {
- if (!strcmp(ptr.d_name, WRT_WIDGET_CONFIG_FILE_NAME)) {
- std::string dName(ptr.d_name);
- WrtUtilJoinPaths(cfgAbsPath, _currentPath, dName);
-
- //Parse widget configuration file
- LogDebug("Found config: " << cfgAbsPath);
-
- Try
- {
- parser.Parse(cfgAbsPath, ElementParserPtr(new
- RootParser<
- WidgetParser>(
- configInfo,
- DPL
- ::
- FromUTF32String(
- L"widget"))));
- }
- Catch(ElementParser::Exception::Base)
- {
- LogError("Invalid widget configuration file!");
- if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) {
- LogError(
- "Failed to close dir: " << _currentPath <<
- " with error: "
- << DPL::GetErrnoString());
- }
- return false;
- }