return BADGE_ERROR_OUT_OF_MEMORY;
}
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¶m_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(param_uid));
ret = send_notify(body, "insert_badge_notify", monitoring_list, PROVIDER_BADGE_INTERFACE_NAME);
g_variant_unref(body);
return BADGE_ERROR_OUT_OF_MEMORY;
}
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¶m_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(param_uid));
ret = send_notify(body, "delete_badge_notify", monitoring_list, PROVIDER_BADGE_INTERFACE_NAME);
g_variant_unref(body);
return BADGE_ERROR_OUT_OF_MEMORY;
}
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¶m_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(param_uid));
ret = send_notify(body, "set_badge_count_notify", monitoring_list, PROVIDER_BADGE_INTERFACE_NAME);
g_variant_unref(body);
return BADGE_ERROR_OUT_OF_MEMORY;
}
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¶m_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(param_uid));
ret = send_notify(body, "set_disp_option_notify", monitoring_list, PROVIDER_BADGE_INTERFACE_NAME);
g_variant_unref(body);
return BADGE_ERROR_OUT_OF_MEMORY;
}
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¶m_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(param_uid));
ret = send_notify(body, "set_disp_option_notify", monitoring_list, PROVIDER_BADGE_INTERFACE_NAME);
g_variant_unref(body);
if (ret != BADGE_ERROR_NONE) {
{
int result;
- _monitoring_hash = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, free_monitoring_list);
+ _monitoring_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_monitoring_list);
result = badge_db_init();
if (result != BADGE_ERROR_NONE) {
ErrPrint("badge db init fail %d", result);
if (ret != NOTIFICATION_ERROR_NONE)
return ret;
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¬i_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(noti_uid));
if (ret == NOTIFICATION_ERROR_NONE) {
ret = notification_noti_check_tag(noti);
if (ret == NOTIFICATION_ERROR_NOT_EXIST_ID)
if (ret != NOTIFICATION_ERROR_NONE)
return ret;
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¬i_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(noti_uid));
if (ret == NOTIFICATION_ERROR_NONE)
ret = _update_noti(reply_body, noti, monitoring_list);
if (ret != NOTIFICATION_ERROR_NONE)
return ret;
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¶m_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(param_uid));
ret = send_notify(parameters, "refresh_noti_notify", monitoring_list, PROVIDER_NOTI_INTERFACE_NAME);
if (ret != NOTIFICATION_ERROR_NONE) {
ErrPrint("failed to send notify:%d\n", ret);
ErrPrint("cannot make gvariant to noti");
return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¶m_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(param_uid));
ret = send_notify(body, "delete_single_notify", monitoring_list, PROVIDER_NOTI_INTERFACE_NAME);
g_variant_unref(body);
if (ret != NOTIFICATION_ERROR_NONE) {
g_variant_builder_add(builder, "(i)", *(list_deleted + i));
}
deleted_noti_list = g_variant_new("(a(i)i)", builder, param_uid);
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, ¶m_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(param_uid));
ret = send_notify(deleted_noti_list, "delete_multiple_notify", monitoring_list, PROVIDER_NOTI_INTERFACE_NAME);
g_variant_builder_unref(builder);
{
int ret;
- _monitoring_hash = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, free_monitoring_list);
+ _monitoring_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_monitoring_list);
ret = notification_db_init();
if (ret != NOTIFICATION_ERROR_NONE) {
ErrPrint("notification db init fail %d", ret);
monitoring_info_s *m_info = NULL;
uid_t request_uid = 0;
GList *monitoring_list = NULL;
- int *hash_key;
if (sender == NULL)
return SERVICE_COMMON_ERROR_IO_ERROR;
return SERVICE_COMMON_ERROR_IO_ERROR;
DbgPrint("service_register : uid %d , request_uid %d", uid, request_uid);
- monitoring_list = (GList *)g_hash_table_lookup(*monitoring_hash, &request_uid);
+ monitoring_list = (GList *)g_hash_table_lookup(*monitoring_hash, GUINT_TO_POINTER(request_uid));
added_list = g_list_find_custom(monitoring_list, bus_name,
(GCompareFunc)_monitoring_app_list_compare_cb);
monitoring_list = g_list_append(monitoring_list, strdup(bus_name));
DbgPrint("service_register : register success sender is %s , length : %d",
sender, g_list_length(monitoring_list));
- if (g_hash_table_lookup(*monitoring_hash, &request_uid) == NULL) {
- hash_key = (int *)calloc(1, sizeof(int));
- *hash_key = request_uid;
- g_hash_table_insert(*monitoring_hash, hash_key, monitoring_list);
+ if (g_hash_table_lookup(*monitoring_hash, GUINT_TO_POINTER(request_uid)) == NULL) {
+ g_hash_table_insert(*monitoring_hash, GUINT_TO_POINTER(request_uid), monitoring_list);
}
} else {
uid_t uid = get_sender_uid(sender);
GList *monitoring_list = NULL;
- monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, &uid);
+ monitoring_list = (GList *)g_hash_table_lookup(_monitoring_hash, GUINT_TO_POINTER(uid));
if (g_strcmp0(method_name, "shortcut_service_register") == 0)
ret = service_register(parameters, &reply_body, sender,
_on_name_appeared, _on_name_vanished, &_monitoring_hash, uid);
{
DbgPrint("Successfully initiated\n");
int result;
- _monitoring_hash = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, free_monitoring_list);
+ _monitoring_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, free_monitoring_list);
result = shortcut_register_dbus_interface();
if (result != SERVICE_COMMON_ERROR_NONE) {
ErrPrint("shortcut register dbus fail %d", result);