set title of recent gallery item to media content time 96/45596/1
authorSoohye Shin <soohye.shin@samsung.com>
Sat, 8 Aug 2015 06:03:41 +0000 (15:03 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Sat, 8 Aug 2015 06:03:41 +0000 (15:03 +0900)
Change-Id: I07b477c253b6c71884a9be4a29628d9dd320779e
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
src/data/data_recent.c

index 5cce6cb..a540a0f 100644 (file)
@@ -25,6 +25,7 @@
 #include <media_content.h>
 #include <app_media.h>
 #include <time.h>
+#include <ctype.h>
 
 #include "data_recent.h"
 #include "datamgr.h"
@@ -188,6 +189,14 @@ static void _channel_list_foreach(gpointer data, gpointer user_data)
                dm->list = eina_list_append(dm->list, di);
 }
 
+static void _set_up_string(char *str)
+{
+       while (*str) {
+               *str = toupper(*str);
+               str++;
+       }
+}
+
 static void _gallery_list_foreach(gpointer data, gpointer user_data)
 {
        struct recent_data *rdata;
@@ -197,6 +206,7 @@ static void _gallery_list_foreach(gpointer data, gpointer user_data)
        app_media_info *aminfo;
        media_info_h media;
        int r;
+       char buf[BUF_TITLE_MAX], day[BUF_TITLE_MAX], date[BUF_TITLE_MAX];
 
        if (!data || !user_data) {
                _ERR("Invalid arguement");
@@ -227,7 +237,12 @@ static void _gallery_list_foreach(gpointer data, gpointer user_data)
                return;
        }
 
-       di = _new_datamgr_item(aminfo->title, aminfo->thumbnail_path, NULL,
+       strftime(date, sizeof(date), "%d %b, %Y", aminfo->content_time);
+       strftime(day, sizeof(day), "%a", aminfo->content_time);
+       _set_up_string(day);
+       snprintf(buf, sizeof(buf), "%s, %s", day, date);
+
+       di = _new_datamgr_item(buf, aminfo->thumbnail_path, NULL,
                        PACKAGE_MEDIAHUB, KEY_MEDIA, rdata->id,
                        IMAGE_RECENT_ICON_GALLERY, 1, rdata->time);
        if (di)