[Release] wrt-installer_0.1.85
[platform/framework/web/wrt-installer.git] / src / misc / widget_location.cpp
index 4c93057..71f8b28 100644 (file)
@@ -62,12 +62,14 @@ WidgetLocation::~WidgetLocation()
 WidgetLocation::WidgetLocation(const std::string & widgetname,
                                std::string sourcePath,
                                WrtDB::PackagingType t,
-                               bool isReadonly) :
+                               bool isReadonly,
+                               InstallMode::ExtensionType eType) :
     m_pkgid(widgetname),
     m_widgetSource(sourcePath),
     m_type(t),
     m_temp(
-        new WidgetLocation::DirectoryDeletor(isReadonly))
+        new WidgetLocation::DirectoryDeletor(isReadonly)),
+    m_extensionType(eType)
 {
     if (isReadonly) {
         m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath();
@@ -84,11 +86,13 @@ WidgetLocation::WidgetLocation(const std::string & widgetname,
                                std::string sourcePath,
                                std::string dirPath,
                                WrtDB::PackagingType t,
-                               bool isReadonly) :
+                               bool isReadonly,
+                               InstallMode::ExtensionType eType) :
     m_pkgid(widgetname),
     m_widgetSource(sourcePath),
     m_type(t),
-    m_temp(new WidgetLocation::DirectoryDeletor(dirPath))
+    m_temp(new WidgetLocation::DirectoryDeletor(dirPath)),
+    m_extensionType(eType)
 {
     if (isReadonly) {
         m_installedPath += WrtDB::GlobalConfig::GetUserPreloadedWidgetPath();
@@ -187,7 +191,7 @@ std::string WidgetLocation::getTemporaryPackageDir() const
 
 std::string WidgetLocation::getTemporaryRootDir() const
 {
-    if (m_type == WrtDB::PKG_TYPE_DIRECTORY_WEB_APP) {
+    if (m_extensionType == InstallMode::ExtensionType::DIR) {
         return getWidgetSource() + WrtDB::GlobalConfig::GetWidgetSrcPath();
     }
     if (m_type == WrtDB::PKG_TYPE_HYBRID_WEB_APP) {
@@ -206,8 +210,6 @@ std::string WidgetLocation::getConfigurationDir() const
             path = m_widgetSource.substr(0, index);
         }
         return path;
-    } else if (m_type == WrtDB::PKG_TYPE_DIRECTORY_WEB_APP) {
-        return getWidgetSource() + WrtDB::GlobalConfig::GetWidgetSrcPath();
     } else {
         return getTemporaryRootDir();
     }