Fixed failed to uninstall preload webapp.
authorSoyoung Kim <sy037.kim@samsung.com>
Mon, 29 Apr 2013 12:05:05 +0000 (21:05 +0900)
committerGerrit Code Review <gerrit2@kim11>
Mon, 29 Apr 2013 12:07:37 +0000 (21:07 +0900)
[Issue#] N/A
[Problem] failed to uninstall preload webapp.
[Cause] check preload webapp during uninstall.
[Solution] remove check logic.
[SCMRequest] N/A

Change-Id: Ib290277ff2aaabbabba0f5bb074f4797e4bd16db

src/jobs/widget_uninstall/job_widget_uninstall.cpp
src/jobs/widget_uninstall/task_remove_files.cpp
src/jobs/widget_uninstall/uninstaller_context.h

index 322d66c..986ee29 100644 (file)
@@ -105,6 +105,8 @@ JobWidgetUninstall::JobWidgetUninstall(
             m_context.tzPkgid = DPL::ToUTF8String(dao.getTizenPkgId());
             m_context.locations = WidgetLocation(m_context.tzPkgid);
             m_context.locations->registerAppid(m_context.tzAppid);
+            m_context.installedPath =
+                DPL::ToUTF8String(*dao.getWidgetInstalledPath());
 
             LogInfo("Widget model exists. App id : " << m_context.tzAppid);
 
@@ -171,8 +173,7 @@ WidgetStatus JobWidgetUninstall::getWidgetStatus(const std::string &id)
 
         if (0 == installPath.compare(0, PRELOAD_INSTALLED_PATH.length(),
                     PRELOAD_INSTALLED_PATH)) {
-            LogError("This widget is prealoaded. So it cann't be removed");
-            return WidgetStatus::PREALOAD;
+            LogDebug("This widget is prealoded.");
         }
     } Catch(WidgetDAOReadOnly::Exception::WidgetNotExist) {
         LogDebug("package id : " << pkgId);
index 47ae2ff..2cd9538 100644 (file)
@@ -69,10 +69,9 @@ void TaskRemoveFiles::StepRemoveInstallationDirectory()
         {
             LogDebug("Removing directory");
             m_context.removeStarted = true;
-            std::string widgetDir =
-                m_context.locations->getPackageInstallationDir();
-            if (!WrtUtilRemove(widgetDir)) {
-                LogError("Removing widget installation directory failed");
+            if (!WrtUtilRemove(m_context.installedPath)) {
+                LogError("Removing widget installation directory failed : " <<
+                        m_context.installedPath);
             }
             std::string dataDir = m_context.locations->getUserDataRootDir();
             if (!WrtUtilRemove(dataDir)) {
index f705b78..f3eb7c1 100644 (file)
@@ -62,6 +62,7 @@ struct UninstallerContext
     std::string tzAppid;
     std::string tzPkgid;
     bool removeAbnormal;
+    std::string installedPath;
 };
 
 #endif // WRT_SRC_INSTALLER_CORE_UNINSTALLER_TASKS_UNINSTALLER_CONTEXT_H_