From 7111af69a59fcfebeef7248b96f76c6e8f0a1eac Mon Sep 17 00:00:00 2001 From: Dongeup Ham Date: Wed, 26 Dec 2012 17:35:41 +0900 Subject: change icons path to shared-res Change-Id: Ia4648369b5d61b1ae36b2ac6bfe9ffd87d2df201 Signed-off-by: Dongeup Ham --- src/Installer/PreloadedInstaller.cpp | 9 ++- src/Manager/ConfigurationManager.cpp | 118 +++++++++++++++++------------------ src/Manager/ConfigurationManager.h | 2 +- src/Manager/PermissionManager.cpp | 7 ++- src/XmlHandler/ManifestGenerator.cpp | 6 +- 5 files changed, 76 insertions(+), 66 deletions(-) mode change 100644 => 100755 src/Installer/PreloadedInstaller.cpp mode change 100644 => 100755 src/Manager/PermissionManager.cpp (limited to 'src') diff --git a/src/Installer/PreloadedInstaller.cpp b/src/Installer/PreloadedInstaller.cpp old mode 100644 new mode 100755 index dc83311..5e3679d --- a/src/Installer/PreloadedInstaller.cpp +++ b/src/Installer/PreloadedInstaller.cpp @@ -21,6 +21,7 @@ #include #include +#include #include "PreloadedInstaller.h" #include "InstallerUtil.h" @@ -91,8 +92,12 @@ PreloadedInstaller::OnInit(void) destPath = destRootPath + DIR_LIB; InstallerUtil::CreateSymlink(srcPath, destPath); - srcPath = path + DIR_ICONS; - destPath = destRootPath + DIR_ICONS; + srcPath = path + DIR_SHARED_RES; + destPath = destRootPath + DIR_SHARED_RES; + if (File::IsFileExist(srcPath) == false) + { + srcPath = path + DIR_ICONS; + } InstallerUtil::CreateSymlink(srcPath, destPath); srcPath = path + DIR_SETTING; diff --git a/src/Manager/ConfigurationManager.cpp b/src/Manager/ConfigurationManager.cpp index 203d51b..65bf975 100755 --- a/src/Manager/ConfigurationManager.cpp +++ b/src/Manager/ConfigurationManager.cpp @@ -578,65 +578,65 @@ ConfigurationManager::CreateSystemXmlFile(InstallationContext* pContext) return ret; } -bool -ConfigurationManager::CreateHybridServiceDesktopFile(InstallationContext* pContext) -{ - AppLogTag(OSP_INSTALLER, "HybridServiceDesktopFile - START"); - - bool ret = true; - _PackageInfoImpl *pPackageInfoImpl = pContext->GetPackageInfoImpl(); - _PackageAppInfoImpl* pAppInfoImpl = null; - ArrayList* pAppList = null; - pAppList = pPackageInfoImpl->GetAppInfoList(); - - for (int i = 0 ; i < pAppList->GetCount(); i++) - { - pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i)); - - if (pAppInfoImpl) - { - String name; - name.Format(1024, L"%ls", pPackageInfoImpl->GetAppName().GetPointer()); - - String binaryPath; - binaryPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, pAppInfoImpl->GetName().GetPointer()); - - String iconPath; - iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pAppInfoImpl->GetMainmenuIcon().GetPointer()); - - String version; - version.Format(1024, L"%ls", pPackageInfoImpl->GetAppVersion().GetPointer()); - - String desktop; - desktop.Format(1024, L"[Desktop Entry]\n" - "Name=%ls\n" - "Name[en_GB]=%ls\n" - "Type=Application\n" - "Exec=%ls\n" - "Icon=%ls\n" - "Version=%ls\n" - "NoDisplay=true\n" - "X-TIZEN-TaskManage=False\n" - "X-TIZEN-PackageType=tpk\n", - name.GetPointer(), name.GetPointer(), binaryPath.GetPointer(), iconPath.GetPointer(), version.GetPointer()); - - String desktopPath; - desktopPath.Format(1024, L"/opt/share/applications/%ls.desktop", pAppInfoImpl->GetPackageName().GetPointer()); - - if (File::IsFileExist(desktopPath) == true) - { - AppLogTag(OSP_INSTALLER, "removing desktop filePath=[%ls]", desktopPath.GetPointer()); - InstallerUtil::Remove(desktopPath); - } - - CreateInfoFile(desktopPath, &desktop); - } - } - - AppLogTag(OSP_INSTALLER, "HybridServiceDesktopFile - END"); - - return ret; -} +//bool +//ConfigurationManager::CreateHybridServiceDesktopFile(InstallationContext* pContext) +//{ +// AppLogTag(OSP_INSTALLER, "HybridServiceDesktopFile - START"); +// +// bool ret = true; +// _PackageInfoImpl *pPackageInfoImpl = pContext->GetPackageInfoImpl(); +// _PackageAppInfoImpl* pAppInfoImpl = null; +// ArrayList* pAppList = null; +// pAppList = pPackageInfoImpl->GetAppInfoList(); +// +// for (int i = 0 ; i < pAppList->GetCount(); i++) +// { +// pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i)); +// +// if (pAppInfoImpl) +// { +// String name; +// name.Format(1024, L"%ls", pPackageInfoImpl->GetAppName().GetPointer()); +// +// String binaryPath; +// binaryPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, pAppInfoImpl->GetName().GetPointer()); +// +// String iconPath; +// iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pAppInfoImpl->GetMainmenuIcon().GetPointer()); +// +// String version; +// version.Format(1024, L"%ls", pPackageInfoImpl->GetAppVersion().GetPointer()); +// +// String desktop; +// desktop.Format(1024, L"[Desktop Entry]\n" +// "Name=%ls\n" +// "Name[en_GB]=%ls\n" +// "Type=Application\n" +// "Exec=%ls\n" +// "Icon=%ls\n" +// "Version=%ls\n" +// "NoDisplay=true\n" +// "X-TIZEN-TaskManage=False\n" +// "X-TIZEN-PackageType=tpk\n", +// name.GetPointer(), name.GetPointer(), binaryPath.GetPointer(), iconPath.GetPointer(), version.GetPointer()); +// +// String desktopPath; +// desktopPath.Format(1024, L"/opt/share/applications/%ls.desktop", pAppInfoImpl->GetPackageName().GetPointer()); +// +// if (File::IsFileExist(desktopPath) == true) +// { +// AppLogTag(OSP_INSTALLER, "removing desktop filePath=[%ls]", desktopPath.GetPointer()); +// InstallerUtil::Remove(desktopPath); +// } +// +// CreateInfoFile(desktopPath, &desktop); +// } +// } +// +// AppLogTag(OSP_INSTALLER, "HybridServiceDesktopFile - END"); +// +// return ret; +//} bool ConfigurationManager::MergeToSystemXmlFile(const String& systemXmlPath, const String& webXmlPath, const String& serviceXmlPath) diff --git a/src/Manager/ConfigurationManager.h b/src/Manager/ConfigurationManager.h index 3f409e8..f17aa4c 100755 --- a/src/Manager/ConfigurationManager.h +++ b/src/Manager/ConfigurationManager.h @@ -53,7 +53,7 @@ public: private: bool CreateSystemXmlFile(InstallationContext* pContext); - bool CreateHybridServiceDesktopFile(InstallationContext* pContext); + // bool CreateHybridServiceDesktopFile(InstallationContext* pContext); bool MergeToSystemXmlFile(const Tizen::Base::String& systemXmlPath, const Tizen::Base::String& webXmlPath,const Tizen::Base::String& serviceXmlPath); bool CreateInfoFile(const Tizen::Base::String& filePath, const Tizen::Base::String* pContext); diff --git a/src/Manager/PermissionManager.cpp b/src/Manager/PermissionManager.cpp old mode 100644 new mode 100755 index c021719..e5efd97 --- a/src/Manager/PermissionManager.cpp +++ b/src/Manager/PermissionManager.cpp @@ -83,7 +83,12 @@ PermissionManager::SetDirectory(InstallationContext* pContext) InstallerUtil::ChangeDirectoryPermission(destPath, S_IRUSR | S_IXUSR); // appRoot/icons(rx for app) - destPath = appRootPath + DIR_ICONS; + destPath = appRootPath + DIR_SHARED_RES; + if (File::IsFileExist(destPath) == false) + { + String iconPath = appRootPath + DIR_ICONS; + InstallerUtil::CreateSymlink(iconPath, destPath); + } InstallerUtil::ChangeDirectoryPermission(destPath, S_IRUSR | S_IXUSR); // appRoot/contents(rx for app) diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp index db6714c..1c7250c 100755 --- a/src/XmlHandler/ManifestGenerator.cpp +++ b/src/XmlHandler/ManifestGenerator.cpp @@ -277,7 +277,7 @@ ManifestGenerator::WriteLiveboxes(_PackageAppInfoImpl* pAppInfoImpl) const if (pLiveboxInfo->GetIcon().IsEmpty() == false) { String liveboxIcon; - liveboxIcon.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pLiveboxInfo->GetIcon().GetPointer()); + liveboxIcon.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pLiveboxInfo->GetIcon().GetPointer()); __pWriter->StartElement("icon"); __pWriter->WriteString(liveboxIcon); @@ -471,7 +471,7 @@ ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl* if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false) { String iconPath; - iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pAppInfoImpl->GetMainmenuIcon().GetPointer()); + iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetMainmenuIcon().GetPointer()); __pWriter->StartElement("icon"); __pWriter->WriteString(iconPath); @@ -575,7 +575,7 @@ ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl* if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false) { String iconPath; - iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pAppInfoImpl->GetMainmenuIcon().GetPointer()); + iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_SHARED_RES, pAppInfoImpl->GetMainmenuIcon().GetPointer()); __pWriter->StartElement("icon"); __pWriter->WriteString(iconPath); -- cgit v1.2.3