#include <widget_install/task_commons.h>
-WidgetLocation::DirectoryDeletor::DirectoryDeletor() :
- m_dirpath(Jobs::WidgetInstall::createTempPath())
+WidgetLocation::DirectoryDeletor::DirectoryDeletor(bool isPreload) :
+ m_dirpath(Jobs::WidgetInstall::createTempPath(isPreload))
{}
WidgetLocation::DirectoryDeletor::DirectoryDeletor(std::string tempPath) :
m_pkgid(widgetname),
m_widgetSource(sourcePath),
m_type(t),
- m_temp(new WidgetLocation::DirectoryDeletor())
+ m_temp(
+ new WidgetLocation::DirectoryDeletor(
+ INSTALL_LOCATION_TYPE_PRELOAD == locationType))
{
if (INSTALL_LOCATION_TYPE_PRELOAD == locationType) {
m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath();
} else {
m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
}
+ // TODO clean-up
+ if (access(m_widgetSource.c_str(), F_OK) != 0) {
+ m_widgetSource = m_installedPath + "/" + m_pkgid;
+ }
}
WidgetLocation::WidgetLocation(const std::string & widgetname,
} else {
m_installedPath += WrtDB::GlobalConfig::GetUserInstalledWidgetPath();
}
+ // TODO clean-up
+ if (access(m_widgetSource.c_str(), F_OK) != 0) {
+ m_widgetSource = m_installedPath + "/" + m_pkgid;
+ }
}
// TODO cache all these paths