*/
void app_icon_remove(Evas_Object *icon_layout);
+/**
+ * @brief Removes application icon and data.
+ * @param icon_layout Pointer to app_icon layout.
+ */
+void app_icon_uninstall(void *data);
+
+
#endif /* APP_ICON_H_ */
extern void data_model_detach_from_folder(Tree_node_t *folder_node,
Tree_node_t *node);
+/**
+ * @brief Search node with package name.
+ *
+ * @param package name
+ * @return node or NULL
+ */
+Tree_node_t *data_model_search_package(const char* pkg_str);
+
#endif /* DATA_MODEL_H_ */
static void __app_icon_uncheck_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
static Evas_Object *__app_icon_load(Evas_Object *parent, const char *icon_path);
static void __app_icon_uninstall_button_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
-
-static void __app_icon_uninstall(void *data);
static void __app_icon_highlight_folder_icon_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
static void __app_icon_unhighlight_folder_icon_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
static void __app_icon_higlight_impossible_folder_icon_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
p_data->popup_confirm_text = strdup(_("IDS_ST_BUTTON_REMOVE_ABB2"));
p_data->popup_cancel_text = strdup(_("IDS_CAM_SK_CANCEL"));
p_data->orientation = ELM_POPUP_ORIENT_CENTER;
- popup_show(p_data, __app_icon_uninstall, NULL, (void *) obj);
+ popup_show(p_data, app_icon_uninstall, NULL, (void *) obj);
} else if (app_node->data->type == APP_ITEM_ICON) {
snprintf(buf, sizeof(buf), _("IDS_HS_POP_PS_WILL_BE_UNINSTALLED"), app_node->data->label);
p_data->type = POPUP_TWO_BUTTONS;
p_data->popup_confirm_text = strdup(_("IDS_AT_BODY_UNINSTALL"));
p_data->popup_cancel_text = strdup(_("IDS_CAM_SK_CANCEL"));
p_data->orientation = ELM_POPUP_ORIENT_CENTER;
- popup_show(p_data, __app_icon_uninstall, NULL, (void *) obj);
+ popup_show(p_data, app_icon_uninstall, NULL, (void *) obj);
} else {
- __app_icon_uninstall((void *) obj);
+ app_icon_uninstall((void *) obj);
popup_data_free(p_data);
}
}
-static void __app_icon_uninstall(void *data)
+void app_icon_uninstall(void *data)
{
Tree_node_t *app_node = NULL;
Evas_Object *icon = NULL;
}
if (PACKAGE_MANAGER_EVENT_TYPE_UNINSTALL == event_type && progress == 100)
+ {
LOGI("%s", package);
+ Tree_node_t *it = data_model_search_package(package);
+ Tree_node_t *parent_folder = NULL;
+
+ if (it != NULL) {
+ if (it->parent && it->parent->parent
+ && (it->parent->parent->data->type == APP_ITEM_FOLDER))
+ parent_folder = it->parent->parent;
+
+ app_icon_uninstall(it->data->layout);
+
+ if (parent_folder != NULL)
+ app_icon_update_folder_icon(parent_folder);
+ }
+ }
}
static bool __app_info_cb(app_info_h ai, void *ud)
.home = NULL,
};
+typedef struct {
+ Tree_node_t *data;
+ char *search;
+} search_package_t;
+
static bool __data_model_get_empty_page(Tree_node_t *nothing, Tree_node_t *page, void *data);
static void __data_model_load_item(Tree_node_t *parent, Tree_node_t **item, db_item_t* db_item, Eina_List* apps_db);
static void __data_model_free_subtree(Tree_node_t *root_node);
static void __add_default_widget(widget_info_t *widget);
static Eina_Bool __data_model_reattach_children(const void *container, void *node, void *fdata);
+static bool __data_model_search_package_cb(Tree_node_t *parent, Tree_node_t *node, void *data);
+
HAPI Tree_node_t *data_model_get_data(void)
{
}
}
+Tree_node_t *data_model_search_package(const char* pkg_str)
+{
+ search_package_t search;
+ search.data = NULL;
+ search.search = pkg_str;
+
+ tree_in_depth_browse(s_info.all_apps, __data_model_search_package_cb, &search);
+
+ return search.data;
+}
+
+static bool __data_model_search_package_cb(Tree_node_t *parent, Tree_node_t *node, void *data)
+{
+ search_package_t *search_data = (search_package_t *)data;
+
+ if (node->data->appid && strcmp(search_data->search, node->data->appid) == 0)
+ search_data->data = node;
+
+ return true;
+}
+
static bool __data_model_get_empty_page(Tree_node_t *nothing, Tree_node_t *page, void *data)
{
Tree_node_t **empty_page = (Tree_node_t **)data;