X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Flogic%2Finstaller_logic.cpp;h=df67764dc5642a7ccce13b4b7a8c7fcd3c736d3d;hb=7a182e91c2ce7bbc7b325ddddee182f2b2909482;hp=a7927cef1d58d23737c54b2869303ee08b8d971b;hpb=3072306199bad8fb07529d273167f39550cf4577;p=framework%2Fweb%2Fwrt-installer.git diff --git a/src/logic/installer_logic.cpp b/src/logic/installer_logic.cpp index a7927ce..df67764 100644 --- a/src/logic/installer_logic.cpp +++ b/src/logic/installer_logic.cpp @@ -24,12 +24,14 @@ #include #include #include +#include using namespace WrtDB; namespace Logic { InstallerLogic::InstallerLogic() : - m_NextHandle(0),m_job(0) + m_job(0), + m_NextHandle(0) {} InstallerLogic::~InstallerLogic() @@ -40,7 +42,7 @@ InstallerLogic::~InstallerLogic() void InstallerLogic::Initialize() { - LogDebug("Done"); + _D("Done"); } void InstallerLogic::Terminate() @@ -49,7 +51,7 @@ void InstallerLogic::Terminate() if(m_job) m_job->SetPaused(true); - LogDebug("Done"); + _D("Done"); } Jobs::JobHandle InstallerLogic::AddAndStartJob() @@ -67,20 +69,19 @@ Jobs::JobHandle InstallerLogic::AddAndStartJob() // But each Job has different constructor, so creating new Job is specific Jobs::JobHandle InstallerLogic::InstallWidget( const std::string & widgetPath, - const WidgetInstallationStruct & + const std::string & pkgId, + const Jobs::WidgetInstall::WidgetInstallationStruct & installerStruct) { if(m_job) { - LogError("Job is in progress. It is impossible to add new job"); + _E("Job is in progress. It is impossible to add new job"); return -1; } - LogDebug("New Widget Installation:"); - - m_job = - new Jobs::WidgetInstall::JobWidgetInstall(widgetPath, installerStruct); + _D("New Widget Installation:"); + m_job = new Jobs::WidgetInstall::JobWidgetInstall(widgetPath, pkgId, installerStruct); return AddAndStartJob(); } @@ -92,11 +93,11 @@ Jobs::JobHandle InstallerLogic::UninstallWidget( { if(m_job) { - LogError("Job is in progress. It is impossible to add new job"); + _E("Job is in progress. It is impossible to add new job"); return -1; } - LogDebug("New Widget Uninstallation"); + _D("New Widget Uninstallation"); m_job = new Jobs::WidgetUninstall::JobWidgetUninstall(widgetPkgName, @@ -112,11 +113,11 @@ Jobs::JobHandle InstallerLogic::InstallPlugin( { if(m_job) { - LogError("Job is in progress. It is impossible to add new job"); + _E("Job is in progress. It is impossible to add new job"); return -1; } - LogDebug("New Plugin Installation"); + _D("New Plugin Installation"); // TODO Conversion to PluginPath is temporary m_job = @@ -145,7 +146,7 @@ bool InstallerLogic::NextStep(Jobs::Job *job) return !job->IsPaused(); } - if (!job->GetUndoType()) { + if (!job->GetAbortStarted()) { //job successfully finished //send finished callback @@ -153,7 +154,6 @@ bool InstallerLogic::NextStep(Jobs::Job *job) switch (job->GetInstallationType()) { case Jobs::PluginInstallation: - //todo move it somewhere InstallWaitingPlugins(); break; default: //because of warning @@ -171,10 +171,9 @@ bool InstallerLogic::NextStep(Jobs::Job *job) return false; } catch (Jobs::JobExceptionBase &exc) { //start revert job - LogDebug("Exception occured: " << exc.getParam() << - ". Reverting job..."); + _D("Exception occured: %d. Reverting job...", exc.getParam()); bool hasAbortSteps = job->Abort(); - job->SetUndoType(true); + job->SetAbortStarted(true); job->SaveExceptionData(exc); if (!hasAbortSteps) { @@ -237,8 +236,7 @@ bool InstallerLogic::resolvePluginDependencies(PluginHandle handle) if (depHandle == Jobs::PluginInstall::JobPluginInstall::INVALID_HANDLE) { - LogError("Library implementing: " << - *requiredObject << " NOT FOUND"); + _E("Library implementing: %s NOT FOUND", (*requiredObject).c_str()); //PluginDAO::SetPluginInstallationStatus(INSTALLATION_WAITING); return false;