summaryrefslogtreecommitdiff
path: root/src/jobs/widget_install/task_manifest_file.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/jobs/widget_install/task_manifest_file.cpp')
-rw-r--r--src/jobs/widget_install/task_manifest_file.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/jobs/widget_install/task_manifest_file.cpp b/src/jobs/widget_install/task_manifest_file.cpp
index e6a8dce..d9104bf 100644
--- a/src/jobs/widget_install/task_manifest_file.cpp
+++ b/src/jobs/widget_install/task_manifest_file.cpp
@@ -131,10 +131,7 @@ void TaskManifestFile::stepCreateExecFile()
ThrowMsg(Exceptions::InternalError, "No Package name exists.");
}
- real_path << GlobalConfig::GetUserInstalledWidgetPath() << "/";
- real_path << pkgname << "/";
- real_path << GlobalConfig::GetUserWidgetExecPath() << "/" <<
- m_context.widgetHandle;
+ real_path << m_context.locations->getBinaryDir() << "/" << m_context.widgetHandle;
std::string clientExeStr = GlobalConfig::GetWrtClientExec();
LogInfo("link -s " << clientExeStr << " " << real_path.str());
@@ -175,14 +172,8 @@ void TaskManifestFile::stepCopyIconFiles()
std::ostringstream targetFile;
if (!!src) {
- if (m_context.browserRequest) {
- size_t pos = m_context.widgetSource.rfind("/");
- sourceFile << m_context.widgetSource.substr(0, pos+1);
- } else {
- sourceFile << GlobalConfig::GetUserInstalledWidgetPath() << "/";
- sourceFile << pkgname << "/";
- sourceFile << GlobalConfig::GetWidgetSrcPath() << "/";
- }
+
+ sourceFile << m_context.locations->getSourceDir() << "/";
if (!i.empty()) {
sourceFile << "locales/" << i << "/";
@@ -193,9 +184,11 @@ void TaskManifestFile::stepCopyIconFiles()
targetFile << GlobalConfig::GetUserWidgetDesktopIconPath() << "/";
targetFile << getIconTargetFilename(i);
- if (m_context.browserRequest) {
- m_context.installedIconPath = targetFile.str();
+ if (m_context.locations->browserRequest())
+ {
+ m_context.locations->setIconTargetFilenameForLocale(targetFile.str());
}
+
} else {
//Use WRT default (not from the widget) only if widget default (not
// localized) doesn't exist.
@@ -256,8 +249,7 @@ void TaskManifestFile::stepBackupIconFiles()
{
LogDebug("Backup Icon Files");
- backup_dir << GlobalConfig::GetUserInstalledWidgetPath();
- backup_dir << "/" << m_context.widgetConfig.pkgname;
+ backup_dir << m_context.locations->getPackageInstallationDir();
backup_dir << "/" << "backup" << "/";
backupIconFiles();
@@ -354,6 +346,7 @@ void TaskManifestFile::stepFinalize()
LogInfo("Finished ManifestFile step");
}
+
void TaskManifestFile::saveLocalizedKey(std::ofstream &file,
const DPL::String& key,
const DPL::String& languageTag)
@@ -593,8 +586,7 @@ void TaskManifestFile::setWidgetExecPath(UiApplication & uiApp)
}
std::ostringstream path;
- path << GlobalConfig::GetUserInstalledWidgetPath() << "/" << *pkgname << "/";
- path << GlobalConfig::GetUserWidgetExecPath() << "/" << *m_context.widgetHandle;
+ path << m_context.locations->getBinaryDir() << "/" << *m_context.widgetHandle;
uiApp.setExec(DPL::FromASCIIString(path.str()));
}
@@ -717,7 +709,9 @@ void TaskManifestFile::setWidgetIcons(UiApplication & uiApp)
}
}
-void TaskManifestFile::generateWidgetIcon(UiApplication & uiApp, const DPL::OptionalString& tag, const DPL::String& language, int iconId, const WrtDB::WidgetDAOReadOnly::WidgetIconList & list, bool & defaultIconSaved)
+void TaskManifestFile::generateWidgetIcon(UiApplication & uiApp, const DPL::OptionalString& tag,
+ const DPL::String& language, int iconId, const WrtDB::WidgetDAOReadOnly::WidgetIconList & list,
+ bool & defaultIconSaved)
{
DPL::String locale;
if (!!tag)
@@ -738,7 +732,8 @@ void TaskManifestFile::generateWidgetIcon(UiApplication & uiApp, const DPL::Opti
}
if (!!src) {
DPL::String iconText;
- iconText += /*DPL::FromASCIIString(GlobalConfig::GetUserWidgetDesktopIconPath()) + L"/" +*/ getIconTargetFilename(language);
+ iconText += getIconTargetFilename(language);
+
if(!locale.empty())
{
uiApp.addIcon(IconType(iconText,locale));
@@ -772,10 +767,11 @@ void TaskManifestFile::setWidgetManifest(Manifest & manifest)
void TaskManifestFile::setWidgetOtherInfo(UiApplication & uiApp)
{
uiApp.setNodisplay(false);
- //TODO(t.iwanek):
- //There is no "X-TIZEN-PackageType=wgt", there is not field in manifest
+ //TODO
+ //There is no "X-TIZEN-PackageType=wgt"
//There is no X-TIZEN-PackageID in manifest "X-TIZEN-PackageID=" << DPL::ToUTF8String(*widgetID).c_str()
//There is no Comment in pkgmgr "Comment=Widget application"
+ //that were in desktop file
}
void TaskManifestFile::setAppServiceInfo(UiApplication & uiApp)