summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Radomskiy <Stanislav.Radomskiy@ixonos.com>2013-05-02 10:35:30 (GMT)
committerStanislav Radomskiy <Stanislavx.Radomskiy@intel.com>2013-06-12 06:13:09 (GMT)
commit58c16db3e887362eca251a1f99d9db7afdb21e66 (patch)
tree72df46a4b8da172837097ef9429341e83905978f
parent2dd3506e5f3faa6443230b7425d783c2939bc3ae (diff)
downloadphone-contacts-58c16db3e887362eca251a1f99d9db7afdb21e66.zip
phone-contacts-58c16db3e887362eca251a1f99d9db7afdb21e66.tar.gz
phone-contacts-58c16db3e887362eca251a1f99d9db7afdb21e66.tar.bz2
Fixing call history dialer crash
Adding NULL pointer checks. UI content was not properly updated after applying a filter. Fixing TREL-395 https://tz.otcshare.org/jira/browse/TZSP-5218 Change-Id: I4adef9034d3276ee065252cb12ba4feec9e284c3
-rwxr-xr-xlib/log/ph-log-detail-view.c4
-rwxr-xr-xlib/log/ph-log-main-view.c25
2 files changed, 26 insertions, 3 deletions
diff --git a/lib/log/ph-log-detail-view.c b/lib/log/ph-log-detail-view.c
index 3fb38c0..bb997ec 100755
--- a/lib/log/ph-log-detail-view.c
+++ b/lib/log/ph-log-detail-view.c
@@ -716,6 +716,10 @@ static char* log_detail_gl_sep_date_label_get(void *data, Evas_Object *obj, cons
ph_log_detail_info * l_detail_info = (ph_log_detail_info*)data;
const char *when;
+ if (data == NULL) {
+ PH_DBG("WARNING: data is NULL");
+ return NULL;
+ }
int index =log_detail_get_group_index(l_detail_info);
diff --git a/lib/log/ph-log-main-view.c b/lib/log/ph-log-main-view.c
index 75769c2..5600b31 100755
--- a/lib/log/ph-log-main-view.c
+++ b/lib/log/ph-log-main-view.c
@@ -30,6 +30,7 @@
#define NO_CONTENTS_ICON_POSITION 0.35
static Elm_Genlist_Item_Class itc, itc_one, itc_date, itc_viewby_list;
+static Evas_Object* log_fill_layout(void *data);
enum {
PH_LIST_ALL_CALL_MESSAGE_LOG,
@@ -353,7 +354,7 @@ static void log_fill_genlist(ph_log_data * log_d)
static void log_free_log_list(ph_log_data *log_d)
{
- ph_log_info *l_info;
+ ph_log_info *l_info = NULL;
if(log_d->log_list) {
@@ -648,7 +649,7 @@ static void log_load_list(ph_log_data * log_d)
//all_log_count for dim
if(log_d->all_log_list_count == -1)
log_d->all_log_list_count = get_cts_log_list(PH_LIST_ALL_CALL_MESSAGE_LOG, NULL);
- }
+}
static void log_update_db_result_cb(int err, void *user_data)
{
@@ -978,6 +979,12 @@ static char* log_gl_label_get(void *data, Evas_Object *obj, const char *part)
{
char buf[PH_TEXT_MAX_LEN]={0};
ph_log_info *l_info = data;
+
+ if (data == NULL) {
+ PH_DBG("WARNING: data is NULL");
+ return NULL;
+ }
+
if (0 == strcmp(part, "elm.text.1") || 0 == strcmp(part, "elm.slide.text.1")) {
if (NULL == l_info->plog_number || '\0' == l_info->plog_number[0]) {
snprintf(buf, sizeof(buf), "%s (%d)", S_(PH_SYS_BODY_UNKNOWN), l_info->grouped_count);
@@ -1254,7 +1261,6 @@ static Evas_Object* log_fill_layout(void *data)
else {
Evas_Object *noc;
noc = phone_create_nocontents(log_d->box, T_(PH_GET_TEXT_BASIC, PHTEXT_NO_LOGS));
-
p_retvm_if(NULL == noc, NULL, "phone_create_nocontents() return NULL");
evas_object_size_hint_weight_set(noc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(noc, EVAS_HINT_FILL, NO_CONTENTS_ICON_POSITION);
@@ -1467,6 +1473,7 @@ static void viewby_gl_sel(void *data, Evas_Object *obj, void *event_info)
viewby_list_item *popup_i;
Elm_Object_Item *item = (Elm_Object_Item *) event_info;
ph_log_data *log_d = data;
+ Evas_Object *content = NULL;
Evas_Object * delete_button = NULL;
p_retm_if(NULL == log_d, "log_d is NULL");
p_retm_if(NULL == item, "item is null");
@@ -1505,6 +1512,18 @@ static void viewby_gl_sel(void *data, Evas_Object *obj, void *event_info)
log_load_list(log_d);
+ elm_box_unpack(log_d->box, log_d->content);
+ evas_object_del(log_d->content);
+ log_d->content = NULL;
+ if (log_d->genlist) {
+ log_d->genlist = NULL;
+ log_d->pre_date_type = 0;
+ }
+ content = log_fill_layout(log_d);
+ p_retvm_if(NULL == content, ECORE_CALLBACK_CANCEL, "log_fill_layout() return NULL");
+ log_d->content = content;
+ elm_box_pack_end(log_d->box, log_d->content);
+
log_list_ctxpopup_hide_cb(log_d, NULL, NULL);
delete_button = elm_object_item_part_content_get(log_d->navi_item, "toolbar_button1");