Add filter prop for package privilege 24/46124/1
authorSangyoon Jang <s89.jang@samsung.com>
Mon, 17 Aug 2015 05:51:22 +0000 (14:51 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Mon, 17 Aug 2015 05:51:22 +0000 (14:51 +0900)
Change-Id: I5eb7b3de1e1d0a44f39080ed4d04f5601a6641b4
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
include/pkgmgr-info.h
include/pkgmgrinfo_private.h
src/pkgmgrinfo_pkginfo.c
src/pkgmgrinfo_private.c

index aefee02..42f5909 100644 (file)
@@ -90,6 +90,8 @@ extern "C" {
 #define        PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL                "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL"
  /** String property for filtering based on package info*/
 #define        PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF         "PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF"
+ /** String property for filtering based on package info*/
+#define        PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE           "PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE"
 
  /** Boolean property for filtering based on package info*/
 #define        PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE           "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"
index 3dd795f..c228545 100644 (file)
@@ -84,7 +84,8 @@ typedef enum _pkgmgrinfo_pkginfo_filter_prop_str {
        E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME,
        E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL,
        E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF,
-       E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_STR = E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF
+       E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE,
+       E_PMINFO_PKGINFO_PROP_PACKAGE_MAX_STR = E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE
 } pkgmgrinfo_pkginfo_filter_prop_str;
 
 /*Boolean properties for filtering based on package info*/
index 3a970e1..566a685 100644 (file)
@@ -199,7 +199,9 @@ static GSList *_pkginfo_get_filtered_list(const char *locale,
                "SELECT DISTINCT package_info.package FROM package_info"
                " LEFT OUTER JOIN package_localized_info"
                "  ON package_info.package=package_localized_info.package"
-               "  AND package_localized_info.package_locale=%Q ";
+               "  AND package_localized_info.package_locale=%Q "
+               " LEFT OUTER JOIN package_privilege_info"
+               "  ON package_info.package=package_privilege_info.package";
        int ret;
        char *query;
        char *query_localized;
index 32d8597..9c1cd11 100644 (file)
@@ -47,7 +47,8 @@ static struct _pkginfo_str_map_t pkginfo_str_prop_map[] = {
        {E_PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE,PMINFO_PKGINFO_PROP_PACKAGE_INSTALLED_STORAGE},
        {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME,     PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_NAME},
        {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL,    PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL},
-       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF,     PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF}
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF,     PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_HREF},
+       {E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE,       PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE}
 };
 
 struct _pkginfo_int_map_t {
@@ -255,6 +256,9 @@ void __get_filter_condition(gpointer data, char **condition)
        case E_PMINFO_PKGINFO_PROP_PACKAGE_AUTHOR_EMAIL:
                snprintf(buf, MAX_QUERY_LEN, "package_info.author_email='%s'", node->value);
                break;
+       case E_PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE:
+               snprintf(buf, MAX_QUERY_LEN, "package_privilege_info.privilege='%s'", node->value);
+               break;
        case E_PMINFO_PKGINFO_PROP_PACKAGE_SIZE:
                snprintf(buf, MAX_QUERY_LEN, "package_info.package_size='%s'", node->value);
                break;