+void TaskManifestFile::stepCopyLiveboxFiles()
+{
+ LogDebug("Copy Livebox Files");
+
+ using namespace WrtDB;
+ ConfigParserData &data = m_context.widgetConfig.configInfo;
+ ConfigParserData::LiveboxList liveBoxList = data.m_livebox;
+
+ if (liveBoxList.size() <= 0) {
+ return;
+ }
+
+ std::ostringstream sourceFile;
+ std::ostringstream targetFile;
+
+ FOREACH (boxIt, liveBoxList) {
+ boxSizeType boxSizeList = (**boxIt).m_boxInfo.m_boxSize;
+ FOREACH (sizeIt, boxSizeList) {
+ std::string preview = DPL::ToUTF8String((*sizeIt).second);
+ if (preview.empty()) {
+ continue;
+ }
+ // copy preview image to shared directory
+ sourceFile << m_context.locations->getSourceDir() << "/";
+ sourceFile << preview;
+ targetFile << m_context.locations->getSharedDataDir() << "/";
+ targetFile << (**boxIt).m_liveboxId << ".";
+ targetFile << DPL::ToUTF8String((*sizeIt).first) << ".preview.png";
+
+ DPL::FileInput input(sourceFile.str());
+ DPL::FileOutput output(targetFile.str());
+ DPL::Copy(&input, &output);
+
+ // clear stream objects
+ sourceFile.str("");
+ targetFile.str("");
+ }
+ // check this livebox has icon element
+ std::string icon = DPL::ToUTF8String((**boxIt).m_icon);
+ if (icon.empty()) {
+ continue;
+ }
+ // copy icon to shared directory
+ sourceFile << m_context.locations->getSourceDir() << "/";
+ sourceFile << icon;
+ targetFile << m_context.locations->getSharedDataDir() << "/";
+ targetFile << (**boxIt).m_liveboxId << ".icon.png";
+
+ DPL::FileInput input(sourceFile.str());
+ DPL::FileOutput output(targetFile.str());
+ DPL::Copy(&input, &output);
+
+ // clear stream objects
+ sourceFile.str("");
+ targetFile.str("");
+ }
+
+ m_context.job->UpdateProgress(
+ InstallerContext::INSTALL_COPY_LIVEBOX_FILES,
+ "Livebox files copy Finished");
+}
+