WidgetHandle removal - part 2. Task order change
[framework/web/wrt-installer.git] / src / jobs / widget_install / task_update_files.cpp
index 0ba0a07..30589a9 100644 (file)
@@ -37,7 +37,6 @@
 #include <widget_install/widget_install_errors.h>
 #include <widget_install/job_widget_install.h>
 
-#include <dpl/wrt-dao-rw/widget_dao.h>
 #include <dpl/wrt-dao-ro/global_config.h>
 #include <dpl/exception.h>
 #include <dpl/errno_string.h>
@@ -62,7 +61,6 @@ TaskUpdateFiles::TaskUpdateFiles(InstallerContext& context) :
     AddStep(&TaskUpdateFiles::StepCreateBackupFolder);
     AddStep(&TaskUpdateFiles::StepResourceFilesBackup);
     AddStep(&TaskUpdateFiles::StepExecFileBackup);
-    AddStep(&TaskUpdateFiles::StepUpdateExternalFiles);
 
     AddAbortStep(&TaskUpdateFiles::StepAbortCreateBackupFolder);
     AddAbortStep(&TaskUpdateFiles::StepAbortExecFileBackup);
@@ -282,43 +280,5 @@ void TaskUpdateFiles::StepAbortCreateBackupFolder()
     }
 }
 
-void TaskUpdateFiles::StepUpdateExternalFiles()
-{
-    WidgetDAO dao(m_context.locations->getPkgname());
-    WrtDB::ExternalLocationList externalLocationsUpdate = m_context.locations->listExternalLocations();
-    WrtDB::ExternalLocationList externalLocationsDB = dao.getWidgetExternalLocations();
-    LogDebug("Removing external files:");
-    FOREACH(file, externalLocationsDB)
-    {
-        if(std::find(externalLocationsUpdate.begin(), externalLocationsUpdate.end(), *file) == externalLocationsUpdate.end())
-        {
-            if(WrtUtilFileExists(*file))
-            {
-                LogDebug("  -> " << *file);
-                remove(file->c_str());
-            }
-            else if(WrtUtilDirExists(*file))
-            {
-                LogDebug("  -> " << *file);
-                if(!WrtUtilRemove(*file)){
-                    ThrowMsg(Exceptions::RemovingFolderFailure,
-                            "Failed to remove external directory");
-                }
-            }
-            else
-            {
-                LogWarning("  -> " << *file << "(no such a path)");
-            }
-        }
-    }
-    dao.unregisterAllExternalLocations();
-    LogDebug("Registering(update) external files:");
-    FOREACH(file, externalLocationsUpdate)
-    {
-        LogDebug("  -> " << *file);
-    }
-    dao.registerExternalLocations(externalLocationsUpdate);
-}
-
 } //namespace WidgetInstall
 } //namespace Jobs