From 50d68e32060a52996e17b541817224a2c7a0b108 Mon Sep 17 00:00:00 2001 From: Duyoung Jang Date: Tue, 16 Oct 2012 16:17:17 +0900 Subject: Remove symlink for IME Change-Id: Ib71c22bdab600458939d6e42c048a956917afee7 --- src/Context/InstallationContext.cpp | 12 ------ src/Context/InstallationContext.h | 4 -- src/Manager/ConfigurationManager.cpp | 11 +++-- src/Manager/InstallerManager.cpp | 4 +- src/Step/UninstallStep.cpp | 7 ++++ src/Util/InstallerUtil.cpp | 42 +++++++++++++++++++ src/Util/InstallerUtil.h | 3 ++ src/XmlHandler/ManifestGenerator.cpp | 7 +++- src/XmlHandler/ManifestHandler.cpp | 78 +++--------------------------------- 9 files changed, 71 insertions(+), 97 deletions(-) (limited to 'src') diff --git a/src/Context/InstallationContext.cpp b/src/Context/InstallationContext.cpp index 3351cf8..7b34d70 100755 --- a/src/Context/InstallationContext.cpp +++ b/src/Context/InstallationContext.cpp @@ -353,18 +353,6 @@ InstallationContext::SetAppVersion(const String& appVersion) __appVersion = appVersion; } -const String& -InstallationContext::GetCategory(void) const -{ - return __category; -} - -void -InstallationContext::SetCategory(const String& category) -{ - __category = category; -} - String InstallationContext::GetManifestXmlPath(void) { diff --git a/src/Context/InstallationContext.h b/src/Context/InstallationContext.h index b87fd8e..a030b4e 100755 --- a/src/Context/InstallationContext.h +++ b/src/Context/InstallationContext.h @@ -105,9 +105,6 @@ public: const Osp::Base::String& GetAppVersion(void) const; void SetAppVersion(const Osp::Base::String& appVersion); - const Osp::Base::String& GetCategory(void) const; - void SetCategory(const Osp::Base::String& category); - Osp::Base::String GetManifestXmlPath(void); Osp::Base::String GetSignatureXmlPath(void); @@ -149,7 +146,6 @@ private: Osp::Base::String __appId; Osp::Base::String __appVersion; Osp::Base::String __appRootPath; - Osp::Base::String __category; Osp::Base::Collection::ArrayList* __pPrivilegeList; RootCertificateType __rootCertType; diff --git a/src/Manager/ConfigurationManager.cpp b/src/Manager/ConfigurationManager.cpp index d5378ef..4f44f05 100755 --- a/src/Manager/ConfigurationManager.cpp +++ b/src/Manager/ConfigurationManager.cpp @@ -159,9 +159,10 @@ ConfigurationManager::CreateFile(InstallationContext* pContext) CreateInfoFile(uiScalabilityInfoFile, &uiScalability); - if (pContext->GetCategory().IsEmpty() == false) + int categoryType = pAppInfoImpl->GetAppFeature(); + if (categoryType != CATEGORY_TYPE_NONE) { - String category = pContext->GetCategory(); + String category = InstallerUtil::GetCategory(categoryType); category.ToLowerCase(); int type = _Aul::GetAppType(category); @@ -241,9 +242,11 @@ ConfigurationManager::CreateFile(InstallationContext* pContext) if (hybridService == false) { AppLogTag(OSP_INSTALLER, "pkgmgr_parser_parse_manifest_for_installation() START"); - if (pkgmgr_parser_parse_manifest_for_installation(pXmlPath, null) != 0) + err = pkgmgr_parser_parse_manifest_for_installation(pXmlPath, null); + if (err != 0) { - AppLogTag(OSP_INSTALLER, "pkgmgr_parser_parse_manifest_for_installation() is failed.[%s]", pXmlPath); + AppLogTag(OSP_INSTALLER, "pkgmgr_parser_parse_manifest_for_installation() is failed. error = [%d][%s]", err, pXmlPath); + fprintf(stderr, "pkgmgr_parser_parse_manifest_for_installation is failed. error = [%d][%s]\n", err, pXmlPath); } AppLogTag(OSP_INSTALLER, "pkgmgr_parser_parse_manifest_for_installation() END"); } diff --git a/src/Manager/InstallerManager.cpp b/src/Manager/InstallerManager.cpp index 1265522..2461095 100755 --- a/src/Manager/InstallerManager.cpp +++ b/src/Manager/InstallerManager.cpp @@ -726,10 +726,10 @@ InstallerManager::ReqeustByTest(void) result r = E_SUCCESS; char readBuf[512] = {0}; - r = File::GetAttributes(L"/opt/apps/org.tizen.cmtamb4mtv/data/configuration", attr); + r = File::GetAttributes(L"/opt/apps/cmtamb4mtv/data/configuration", attr); TryCatch(!IsFailed(r), errorType = INSTALLER_ERROR_INVALID_PACKAGE, "[osp-installer] file not found"); - r = file.Construct(L"/opt/apps/org.tizen.cmtamb4mtv/data/configuration", L"r"); + r = file.Construct(L"/opt/apps/cmtamb4mtv/data/configuration", L"r"); TryCatch(!IsFailed(r), errorType = INSTALLER_ERROR_INVALID_PACKAGE, "[osp-installer] file.Construct failed"); if (file.Read(readBuf, sizeof(readBuf)-1) > 1) diff --git a/src/Step/UninstallStep.cpp b/src/Step/UninstallStep.cpp index bd1022a..5030369 100755 --- a/src/Step/UninstallStep.cpp +++ b/src/Step/UninstallStep.cpp @@ -224,6 +224,13 @@ UninstallStep::OnStateRemoveDir(void) AppLogTag(OSP_INSTALLER, "destPath[%ls]", destPath.GetPointer()); InstallerUtil::Remove(destPath); + + if (pAppInfoImpl->GetAppFeature() == CATEGORY_TYPE_IME) + { + String symlinkPath; + symlinkPath.Format(1024, L"%s/%ls.so", IME_PATH, packageName.GetPointer()); + InstallerUtil::Remove(symlinkPath); + } } } AppLogTag(OSP_INSTALLER, "Directory::Remove - END"); diff --git a/src/Util/InstallerUtil.cpp b/src/Util/InstallerUtil.cpp index d059812..0f69c61 100755 --- a/src/Util/InstallerUtil.cpp +++ b/src/Util/InstallerUtil.cpp @@ -84,3 +84,45 @@ CATCH: delete [] pFilePath; return res; } + +String +InstallerUtil::GetCategory(int categoryType) +{ + String category; + + if (categoryType == CATEGORY_TYPE_IME) + { + category = L"Ime"; + } + else if (categoryType == CATEGORY_TYPE_HOME_SCREEN) + { + category = L"home-screen"; + } + else if (categoryType == CATEGORY_TYPE_LOCK_SCREEN) + { + category = L"lock-screen"; + } + + return category; +} + +CategoryType +InstallerUtil::GetCategoryType(char* pCategory) +{ + CategoryType category = CATEGORY_TYPE_NONE; + + if (strcasecmp(pCategory, "Ime") == 0) + { + category = CATEGORY_TYPE_IME; + } + else if (strcasecmp(pCategory, "home-screen") == 0) + { + category = CATEGORY_TYPE_HOME_SCREEN; + } + else if (strcasecmp(pCategory, "lock-screen") == 0) + { + category = CATEGORY_TYPE_LOCK_SCREEN; + } + + return category; +} diff --git a/src/Util/InstallerUtil.h b/src/Util/InstallerUtil.h index e3c9e58..c553c28 100755 --- a/src/Util/InstallerUtil.h +++ b/src/Util/InstallerUtil.h @@ -44,6 +44,9 @@ public: static bool Remove(const Osp::Base::String& filePath); + static Osp::Base::String GetCategory(int categoryType); + static CategoryType GetCategoryType(char* pCategory); + private: InstallerUtil(const InstallerUtil& value); InstallerUtil& operator =(const InstallerUtil& source); diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp index 1c381bb..3a65650 100755 --- a/src/XmlHandler/ManifestGenerator.cpp +++ b/src/XmlHandler/ManifestGenerator.cpp @@ -24,6 +24,7 @@ #include #include "ManifestGenerator.h" +#include "InstallerUtil.h" using namespace Osp::Base; using namespace Osp::Base::Collection; @@ -148,9 +149,11 @@ ManifestGenerator::Write() nodisplay = L"true"; } - if (__pContext->GetCategory().IsEmpty() == false) + int categoryType = pAppInfoImpl->GetAppFeature(); + + if (categoryType != CATEGORY_TYPE_NONE) { - category.Format(1024, L"%ls", __pContext->GetCategory().GetPointer()); + category = InstallerUtil::GetCategory(categoryType); category.ToLowerCase(); if (_Aul::GetAppType(category) != 0) diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp index a56896d..f155b45 100755 --- a/src/XmlHandler/ManifestHandler.cpp +++ b/src/XmlHandler/ManifestHandler.cpp @@ -26,6 +26,7 @@ #include "ManifestHandler.h" #include "PrivilegeHandler.h" +#include "InstallerUtil.h" using namespace Osp::Base; @@ -559,7 +560,6 @@ ManifestHandler::OnIconValue(const char *pCharacters) { XmlAttribute *pAttr = 0; char *pAttrValue1 = 0; - char *pAttrValue2 = 0; char *pTypeValue = 0; pAttr = GetAttribute(); @@ -568,11 +568,8 @@ ManifestHandler::OnIconValue(const char *pCharacters) pAttrValue1 = pAttr->Find("Section"); TryReturn(pAttrValue1, true, "[osp-installer] pAttrValue1 is null"); - pAttrValue2 = pAttr->Find("Size"); - //TryReturn(pAttrValue2, true, "[osp-installer] pAttrValue2 is null"); - pTypeValue = pAttr->Find("Type"); - //TryReturn(pTypeValue, true, "[osp-installer] pTypeValue is null"); + TryReturn(pTypeValue, true, "[osp-installer] pTypeValue is null"); if (pTypeValue != null) { @@ -631,73 +628,6 @@ ManifestHandler::OnIconValue(const char *pCharacters) AppLogTag(OSP_INSTALLER, "%s", pAttrValue1, pTypeValue, pCharacters); } - else if (pAttrValue2 != null) - { - AppLogTag(OSP_INSTALLER, "Old Spec!! Icon spec is changed."); - - if (strcasecmp(pAttrValue1, "MainMenu") == 0) - { - if (__isDefaultMainmenu == false) - { - __pPackageAppInfoImpl->SetMainmenuIcon(pCharacters); - } - - if (strcasecmp(pAttrValue2, "type4") == 0) - { - __isDefaultMainmenu = true; - } - } - else if (strcasecmp(pAttrValue1, "Setting") == 0) - { - if (__isDefaultSetting == false) - { - __pPackageAppInfoImpl->SetSettingIcon(pCharacters); - } - - if (strcasecmp(pAttrValue2, "type4") == 0) - { - __isDefaultSetting = true; - } - } - else if (strcasecmp(pAttrValue1, "Ticker") == 0) - { - if (__isDefaultTicker == false) - { - __pPackageAppInfoImpl->SetTickerIcon(pCharacters); - } - - if (strcasecmp(pAttrValue2, "type4") == 0) - { - __isDefaultTicker = true; - } - } - else if (strcasecmp(pAttrValue1, "QuickPanel") == 0) - { - if (__isDefaultQuickpanel == false) - { - __pPackageAppInfoImpl->SetQuickpanelIcon(pCharacters); - } - - if (strcasecmp(pAttrValue2, "type4") == 0) - { - __isDefaultQuickpanel = true; - } - } - else if (strcasecmp(pAttrValue1, "LaunchImage") == 0) - { - if (__isDefaultLaunchImage == false) - { - __pPackageAppInfoImpl->SetLaunchImageIcon(pCharacters); - } - - if (strcasecmp(pAttrValue2, "type4") == 0) - { - __isDefaultLaunchImage = true; - } - } - - AppLogTag(OSP_INSTALLER, "%s", pAttrValue1, pAttrValue2, pCharacters); - } return true; } @@ -1043,7 +973,9 @@ ManifestHandler::OnUiAppElement(void) if (pCategory) { AppLogTag(OSP_INSTALLER, "", pCategory); - __pContext->SetCategory(pCategory); + + CategoryType categoryType = InstallerUtil::GetCategoryType(pCategory); + __pPackageAppInfoImpl->SetAppFeature(categoryType); } AppLogTag(OSP_INSTALLER, "app_id = %S", app_id.GetPointer()); -- cgit v1.2.3