timeFormat24H = NULL;
}
-int DateUtil::getDiffDays(time_t nowTime,time_t refTime)
+int DateUtil::getDiffDays(time_t nowTime, time_t refTime)
{
int diffDays = 0;
int nowYear = 0;
struct tm nowDate;
- if(localtime_r(&nowTime,&nowDate)==NULL){
+ if(localtime_r(&nowTime, &nowDate) == NULL){
DM_LOGE("Error localtime_r");
return -1;
}
struct tm finishedDate;
- if(localtime_r(&refTime,&finishedDate)==NULL){
+ if (localtime_r(&refTime, &finishedDate) == NULL) {
DM_LOGE("Error localtime_r");
return -1;
}
DM_LOGV("nowDate[%d/%d/%d]",
(nowDate.tm_year + 1900), (nowDate.tm_mon + 1),
nowDate.tm_mday);
- if ((nowYear-refYear)>0 && diffDays < 0) {
+ if ((nowYear-refYear) > 0 && diffDays < 0) {
int year = nowDate.tm_year;
diffDays = diffDays + 365;
/* leap year */
if ((year%4 == 0 && year%100 != 0) || year%400 == 0)
diffDays++;
}
- DM_LOGD("diffDays[%d]",diffDays);
+ DM_LOGD("diffDays[%d]", diffDays);
return diffDays;
}
{
int ret = I18N_ERROR_NONE;
i18n_udate_format_h format = NULL;
- i18n_uchar uchCustomFormat[MAX_SKELETON_BUFFER_LEN] = {0,};
- i18n_uchar bestPattern[MAX_PATTERN_BUFFER_LEN] = {0,};
+ i18n_uchar uchCustomFormat[MAX_SKELETON_BUFFER_LEN] = { 0, };
+ i18n_uchar bestPattern[MAX_PATTERN_BUFFER_LEN] = { 0, };
int pattrenLength;
int bestPatternLength;
const char *locale = NULL;
i18n_udatepg_h patternGenerator = NULL;
locale = getenv("LC_TIME");
- if (strlen(locale) > MAX_STR_LEN) {
+ if (locale && (strlen(locale) > MAX_STR_LEN)) {
DM_LOGE("Size of locale is greater than MAX STR LEN");
return;
}
}
if (format) {
int formattedLength;
- i18n_uchar formatted[MAX_BUF_LEN] = {0,};
- char result[MAX_BUF_LEN] = {0,};
+ i18n_uchar formatted[MAX_BUF_LEN] = { 0, };
+ char result[MAX_BUF_LEN] = { 0, };
ret = i18n_udate_format_date(format, (finishTime * 1000), formatted,
MAX_BUF_LEN, NULL, &formattedLength);
if (ret != I18N_ERROR_NONE)
, eoDldList(NULL)
, eoPopup(NULL)
#ifdef _TIZEN_2_3_UX
- , m_theme(NULL)
, eoMoreMenu(NULL)
, eoSelectAllLayout(NULL)
, m_isEditMode(false)
DateUtil &inst = DateUtil::getInstance();
inst.updateLocale();
#ifdef _TIZEN_2_3_UX
- m_theme = elm_theme_new();
- elm_theme_ref_set(m_theme, NULL);
- elm_theme_extension_add(m_theme, EDJEDIR"/download-manager-view.edj");
+ elm_theme_extension_add(NULL, EDJEDIR"/download-manager-view.edj");
#endif
}
{
DM_LOGD("");
#ifdef _TIZEN_2_3_UX
- elm_theme_extension_del(m_theme, EDJEDIR"/download-manager-view.edj");
- elm_theme_free(m_theme);
+ elm_theme_extension_del(NULL, EDJEDIR"/download-manager-view.edj");
#endif
}
// one more check if the vconf value of lock state has not been changed due to some error
m_activatedLockScreen = false;
DateUtil &util = DateUtil::getInstance();
- int diffDays = util.getDiffDays(time(NULL),(time_t)m_viewLastRefreshTime);
+ int diffDays = util.getDiffDays(time(NULL), (time_t)m_viewLastRefreshTime);
if (diffDays > 0) {
if (m_viewItemCount > 0)
update(diffDays);
eext_naviframe_back_cb, NULL);
createBox();
eoNaviBarItem = elm_naviframe_item_push(eoNaviBar,
- DM_HEADER_DOWNLOAD_MANAGER ,NULL, NULL, eoBox, NULL);
+ DM_HEADER_DOWNLOAD_MANAGER, NULL, NULL, eoBox, NULL);
if (!eoNaviBarItem)
DM_LOGE("Null Check:eoNaviBarItem");
#ifdef _TIZEN_2_3_UX
{
Evas_Object *btn1 = NULL;
Evas_Object *btn2 = NULL;
- char buff[MAX_BUF_LEN] = {0,};
+ char buff[MAX_BUF_LEN] = { 0, };
DM_LOGI("");
void DownloadView::createList()
{
eoDldList = elm_genlist_add(eoLayout);
- DM_LOGTEST("CREATE:eoDldList[%p]",eoDldList);
+ DM_LOGTEST("CREATE:eoDldList[%p]", eoDldList);
/* When using ELM_LIST_LIMIT, the window size is broken at the landscape mode */
evas_object_smart_callback_add(eoDldList, "language,changed", changedGenlistLanguage, NULL);
evas_object_size_hint_weight_set(eoDldList, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_smart_callback_add(eoDldList, "realized", realizedCB, NULL);
elm_genlist_homogeneous_set(eoDldList, EINA_TRUE);
elm_genlist_mode_set(eoDldList, ELM_LIST_COMPRESS);
-#ifdef _TIZEN_2_3_UX
- elm_object_theme_set(eoDldList, m_theme);
-#endif
- elm_genlist_block_count_set(eoDldList,8);
+ elm_genlist_block_count_set(eoDldList, 8);
elm_box_pack_end(eoBox, eoDldList);
evas_object_show(eoDldList);
}
void DownloadView::detachViewItem(ViewItem *viewItem)
{
- DM_LOGI("delete viewItem[%p]",viewItem);
+ DM_LOGI("delete viewItem[%p]", viewItem);
if (viewItem && viewItem->isGroupTitle() == false) {
groupTitleType &groupTitleItem = m_groupTitle[viewItem->getItemGroup()];
m_viewItemCount--;
it = elm_genlist_first_item_get(eoDldList);
while (it) {
- DM_LOGD("glItem[%p]",it);
+ DM_LOGD("glItem[%p]", it);
elm_genlist_item_update(it);
it = elm_genlist_item_next_get(it);
}
}
if (yesterdayGroupTitle.viewItem) {
itemsCount += yesterdayGroupTitle.subItemsCount;
- if (flag)
+ if (flag) {
elm_object_item_del(yesterdayGroupTitle.viewItem->genlistItem());
- else {
+ } else {
if (olderGroupTitle.viewItem)
elm_object_item_del(olderGroupTitle.viewItem->genlistItem());
olderGroupTitle.viewItem = yesterdayGroupTitle.viewItem;
Elm_Object_Item *glItem = NULL;
VIEWITEM_GROUP::GROUP group;
double finishedTime = viewItem->getFinishedTime();
- if (finishedTime == 0)
+ if (finishedTime == 0) {
diffDays = 0;
- else {
+ } else {
DateUtil &inst = DateUtil::getInstance();
- diffDays = inst.getDiffDays(time(NULL),(time_t)finishedTime);
+ diffDays = inst.getDiffDays(time(NULL), (time_t)finishedTime);
}
if (diffDays < 1)
genlistClickCB,
static_cast<const void*>(viewItem));
}
- if (!glItem)
+ if (!glItem) {
DM_LOGE("Fail to add a genlist item");
- else {
+ } else {
viewItem->setItemGroup(group);
viewItem->setGenlistItem(glItem);
groupTitleItem.subItemsCount++;
#endif
elm_layout_signal_emit(eoEmptyNoContent, "align.center", "elm");
if (eoDldList) {
- elm_box_unpack(eoBox,eoDldList);
+ elm_box_unpack(eoBox, eoDldList);
/* Detection code */
- DM_LOGI("del::eoDldList[%p]",eoDldList);
+ DM_LOGI("del::eoDldList[%p]", eoDldList);
evas_object_del(eoDldList);
eoDldList = NULL;
}
void DownloadView::showSelectedNotify(int selectedCount)
{
- char buff[MAX_BUF_LEN] = {0,};
+ char buff[MAX_BUF_LEN] = { 0, };
DM_LOGD("");
#ifndef _TIZEN_2_3_UX
{
Evas_Object *btn1 = NULL;
Evas_Object *btn2 = NULL;
- char buff[MAX_BUF_LEN] = {0,};
+ char buff[MAX_BUF_LEN] = { 0, };
DM_LOGI("");