- if (appType == APP_TYPE_WAC20) {
- Try
- {
- // Search widget handle by GUID
- WidgetDAOReadOnly dao(widgetGUID);
- return WidgetUpdateInfo(
- widgetGUID,
- widgetVersion,
- WidgetUpdateInfo::ExistingWidgetInfo(
- dao.getTzAppId(), dao.getVersion()));
- }
- Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
- {
- // GUID isn't installed
- return WidgetUpdateInfo(
- widgetGUID,
- widgetVersion,
- WidgetUpdateInfo::ExistingWidgetInfo());
- }
- } else {
- Try
- {
- // Search widget handle by appId
- WidgetDAOReadOnly dao(tizenId);
- return WidgetUpdateInfo(
- widgetGUID,
- widgetVersion,
- WidgetUpdateInfo::ExistingWidgetInfo(
- dao.getTzAppId(), dao.getVersion()));
- }
- Catch(WidgetDAOReadOnly::Exception::WidgetNotExist)
- {
- // GUID isn't installed
- return WidgetUpdateInfo(
- widgetGUID,
- widgetVersion,
- WidgetUpdateInfo::ExistingWidgetInfo());
- }
- }
+ WidgetDAOReadOnly dao(tizenId);
+ return WidgetUpdateInfo(
+ dao.getTzAppId(),
+ WidgetVersion(*dao.getVersion()),
+ incomingVersion);