[TSAM-8695] Updated sel list on mediadb update CB 53/91553/1
authorRahul Dadhich <r.dadhich@samsung.com>
Mon, 10 Oct 2016 07:07:08 +0000 (12:37 +0530)
committerRahul Dadhich <r.dadhich@samsung.com>
Mon, 10 Oct 2016 07:07:08 +0000 (12:37 +0530)
Change-Id: I3ecc170a8777cf30f38d98a02b712440753afc5e
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
src/2dview/gl-timeline.c

index e2d7c230edf68a7455a3127985df5ba7cfb71e5a..92ab0ff65b550c262789b8bc32ebebe7b7b2a028 100644 (file)
@@ -2340,6 +2340,38 @@ bool _gl_check_no_content_view(void *data)
        return false;
 }
 
+static void _gl_timeline_update_selected_info(void *data)
+{
+       GL_CHECK(data);
+       gl_appdata *ad = (gl_appdata *)data;
+       GL_CHECK(ad->tlinfo);
+       GL_CHECK(ad->tlinfo->sel_d);
+       char *item = NULL;
+       gl_media_s *item1 = NULL;
+       bool in_list = false;
+       Eina_List *l;
+       int i;
+       EINA_LIST_FOREACH(ad->tlinfo->sel_d->sel_list, l, item) {
+               if (!item) {
+                       continue;
+               }
+               in_list = false;
+               for (i = 0; i < eina_list_count(ad->tlinfo->data_list); i++) {
+                       item1 = eina_list_nth(ad->tlinfo->data_list, i);
+                       if (!item) {
+                               continue;
+                       }
+                       if (!strcmp(item1->uuid, item)) {
+                               in_list = true;
+                               break;
+                       }
+               }
+               if (!in_list) {
+                               __gl_timeline_sel_remove_item(ad->tlinfo, item);
+               }
+       }
+}
+
 int _gl_timeline_update_view(void *data)
 {
        GL_CHECK_VAL(data, -1);
@@ -2364,6 +2396,10 @@ int _gl_timeline_update_view(void *data)
                        __gl_timeline_change_mode(data, GL_TL_VIEW_NORMAL);
                _gl_del_popup(data);
        }
+       if (ad->tlinfo->view_m != GL_TL_VIEW_NORMAL)
+       {
+               _gl_timeline_update_selected_info(data);
+       }
        /* Update buttons state */
        __gl_timeline_reset_btns(data);
        /* Update naviframe item title */