#include <dpl/sstream.h>
#include <dpl/file_input.h>
#include <dpl/utils/wrt_utility.h>
+#include <dpl/utils/path.h>
#include <dpl/wrt-dao-ro/common_dao_types.h>
#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
#include <dpl/wrt-dao-ro/global_config.h>
// Parse config
ParserRunner parser;
ConfigParserData configInfo;
-
Try
{
if (pkgType == PKG_TYPE_HOSTED_WEB_APP) {
configInfo,
DPL::FromUTF32String(L"widget"))));
} else {
- std::string configFile;
+ DPL::Utils::Path configFile;
if (pkgType == PKG_TYPE_HYBRID_WEB_APP) {
- configFile = tempPath + "/" + WITH_OSP_XML;
+ configFile = DPL::Utils::Path(tempPath);
+ configFile /= WITH_OSP_XML;
} else {
- configFile = tempPath + "/" + CONFIG_XML;
+ configFile = DPL::Utils::Path(tempPath);
+ configFile /= CONFIG_XML;
+ if(!configFile.Exists()){
+ Throw(Exceptions::WidgetConfigFileNotFound);
+ }
}
-
- parser.Parse(configFile,
+ parser.Parse(configFile.Fullpath(),
ElementParserPtr(
new RootParser<WidgetParser>(configInfo,
DPL::
LogError("Failed to find installed widget - give proper tizenId");
return ConfigParserData();
}
+ Catch(Exceptions::WidgetConfigFileNotFound){
+ LogError("Failed to find config.xml");
+ return ConfigParserData();
+ }
return configInfo;
}
if (WrtUtilFileExists(configFile)) {
return PKG_TYPE_HYBRID_WEB_APP;
}
-
return PKG_TYPE_UNKNOWN;
}