diff options
Diffstat (limited to 'src/data/app.c')
-rw-r--r-- | src/data/app.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/data/app.c b/src/data/app.c index fb05b3a..7f6b00c 100644 --- a/src/data/app.c +++ b/src/data/app.c @@ -29,6 +29,7 @@ struct app_data { char *name; char *icon; char *pkgtype; + bool removable; struct color_data icon_bg; struct color_data text_bg; }; @@ -48,6 +49,7 @@ static int _get_app_data_foreach(pkgmgrinfo_appinfo_h handle, void *data) char *appid, *pkgid, *name, *icon, *pkgtype; pkgmgrinfo_pkginfo_h pkginfo_h; bool nodisplay; + bool removable = true; if (!data) return -1; @@ -76,6 +78,9 @@ static int _get_app_data_foreach(pkgmgrinfo_appinfo_h handle, void *data) &pkginfo_h) != PMINFO_R_OK) return 0; + if (pkgmgrinfo_pkginfo_is_removable(pkginfo_h, &removable) != PMINFO_R_OK) + return 0; + if (pkgmgrinfo_pkginfo_get_type(pkginfo_h, &pkgtype) != PMINFO_R_OK) { pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo_h); return 0; @@ -113,6 +118,8 @@ static int _get_app_data_foreach(pkgmgrinfo_appinfo_h handle, void *data) if (pkgtype) adata->pkgtype = strdup(pkgtype); + adata->removable = removable; + *list = eina_list_append(*list, adata); OUT: @@ -181,6 +188,16 @@ char *get_pkg_type(struct app_data *adata) return adata->pkgtype; } +bool get_app_removable(struct app_data *adata) +{ + if (!adata) { + _ERR("Invalid argument."); + return NULL; + } + + return adata->removable; +} + bool get_app_favorite(struct app_data *adata, bool *isfavorite) { int r; |