}
bool WidgetConfigurationManager::locateAndParseConfigurationFile(
- const std::string& _currentPath,
- WrtDB::WidgetRegisterInfo& pWidgetConfigInfo,
- const std::string& baseFolder,
- int* pErrCode)
+ const std::string& _currentPath,
+ WrtDB::WidgetRegisterInfo& pWidgetConfigInfo,
+ const std::string& baseFolder,
+ int* pErrCode)
{
using namespace WrtDB;
// check if this installation from browser, or not.
size_t pos = _currentPath.rfind("/");
std::ostringstream infoPath;
- infoPath << _currentPath.substr(pos+1);
+ infoPath << _currentPath.substr(pos + 1);
ParserRunner parser;
std::string language = "";
//TODO why don't we use fopen here
bool has_config_xml = false;
errno = 0;
- while ((ptr = readdir(dir)) != NULL) { //Find configuration file, based on its name
+ while ((ptr = readdir(dir)) != NULL) { //Find configuration file, based
+ // on its name
if (ptr->d_type == DT_REG) {
if (!strcmp(ptr->d_name, WRT_WIDGET_CONFIG_FILE_NAME)) {
_WrtUtilSetAbsolutePath(cfgAbsPath,
}
//
- // WidgetConfigurationParser & parser = WidgetConfigurationParserSingleton::Instance();
- // if (!parser.parseConfigurationFile(cfgAbsPath, configInfo, baseFolder.c_str(), pWidgetConfigInfo.signature_type)) {
- // LogDebug("Invalid widget configuration file!");
- // *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
+ // WidgetConfigurationParser & parser =
+ // WidgetConfigurationParserSingleton::Instance();
+ // if
+ // (!parser.parseConfigurationFile(cfgAbsPath, configInfo,
+ // baseFolder.c_str(), pWidgetConfigInfo.signature_type)) {
+ // LogDebug("Invalid widget configuration
+ // file!");
+ // *pErrCode =
+ // WRT_WM_ERR_INVALID_ARCHIVE;
// closedir(dir);
// return false;
// }
Try
{
parser.Parse(_currentPath, ElementParserPtr(new
- RootParser<
- WidgetParser>(
- configInfo,
- DPL::FromUTF32String(
- L"widget"))));
+ RootParser<
+ WidgetParser>(
+ configInfo,
+ DPL::
+ FromUTF32String(
+ L"widget"))));
}
Catch(ElementParser::Exception::Base)
{
}
}
-
char *tmp_language;
if (!_WrtUtilStringToLower(baseFolder.c_str(), &tmp_language)) {
*pErrCode = WRT_ERR_UNKNOWN;
}
if (!!configInfo.tizenId) {
- if (!pWidgetConfigInfo.pkgname) {
- pWidgetConfigInfo.pkgname = configInfo.tizenId;
- } else {
- if (pWidgetConfigInfo.pkgname != configInfo.tizenId) {
- *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
- LogDebug("Invalid archive - Tizen ID not same error");
- return false;
- }
+ if (pWidgetConfigInfo.pkgName != *configInfo.tizenId) {
+ *pErrCode = WRT_WM_ERR_INVALID_ARCHIVE;
+ LogDebug("Invalid archive - Tizen ID not same error");
+ return false;
}
}
return true;
}
-void WidgetConfigurationManager::processFile(const std::string& path,
- WrtDB::WidgetRegisterInfo &widgetConfiguration)
+void WidgetConfigurationManager::processFile(
+ const std::string& path,
+ WrtDB::WidgetRegisterInfo &
+ widgetConfiguration)
{
int pErrCode;
if (!locateAndParseConfigurationFile(path, widgetConfiguration,
- DEFAULT_LANGUAGE, &pErrCode)) {
+ DEFAULT_LANGUAGE, &pErrCode))
+ {
LogWarning("Widget archive: Failed while parsing config file");
ThrowMsg(Exception::ProcessFailed, path);
}