Update curly-braces code style to reduce code line count. 90/82990/1
authorEugene Kurzberg <i.kurtsberg@samsung.com>
Mon, 8 Aug 2016 12:06:47 +0000 (15:06 +0300)
committerEugene Kurzberg <i.kurtsberg@samsung.com>
Mon, 8 Aug 2016 12:06:47 +0000 (15:06 +0300)
Change-Id: I22c50ff276c11827e6e19f678a99e0160f77afa6
Signed-off-by: Eugene Kurzberg <i.kurtsberg@samsung.com>
95 files changed:
app-assist-efl/src/WApp.cpp
app-assist-efl/src/WAppEventHandler.cpp
app-assist-efl/src/WControl.cpp
app-assist-efl/src/WGenlistItem.cpp
app-assist-efl/src/WMenuPopup.cpp
app-assist-efl/src/WNaviframe.cpp
app-assist-efl/src/WPopup.cpp
app-assist-efl/src/WUiTimer.cpp
app-assist-efl/src/WView.cpp
app-assist-efl/src/WWindow.cpp
app-control/alert/CalAlertApp.cpp
app-control/alert/CalAlertData.cpp
app-control/alert/CalAlertItem.cpp
app-control/alert/CalAlertModel.cpp
app-control/alert/CalAlertNotificationItem.cpp
app-control/alert/CalAlertView.cpp
app-control/alert/CalNotificationsSelectAllItem.cpp
app-control/alert/CalNotificationsView.cpp
app-control/alert/CalStatusBarManager.cpp
app-control/edit/CalEditApp.cpp
app-control/pick/CalPickApp.cpp
app-control/pick/CalPickView.cpp
app-control/view/CalViewApp.cpp
common/fw/CalAppControlLauncher.cpp
common/fw/CalDialogControl.cpp
common/fw/CalDragRecognizer.cpp
common/fw/CalEvent.cpp
common/fw/CalEventManager.cpp
common/fw/CalNaviframe.cpp
common/fw/CalPath.cpp
common/fw/CalSlideAnimator.cpp
common/fw/CalTapRecognizer.cpp
common/fw/CalTouchInputRecognizer.cpp
common/fw/CalView.cpp
common/fw/CalWorker.cpp
common/model/CalBook.cpp
common/model/CalBookManager.cpp
common/model/CalComplexListProvider.cpp
common/model/CalCustomListModel.cpp
common/model/CalDataManager.cpp
common/model/CalDate.cpp
common/model/CalDateTime.cpp
common/model/CalEditModel.cpp
common/model/CalInstanceSchedule.cpp
common/model/CalLocaleManager.cpp
common/model/CalOriginalSchedule.cpp
common/model/CalSchedule.cpp
common/model/CalScheduleReminder.cpp
common/model/CalScheduleRepeat.cpp
common/model/CalSettingsManager.cpp
common/model/CalSimpleListProvider.cpp
common/model/CalTimeZone.cpp
main-app/src/CalApp.cpp
main-app/src/book/CalBookView.cpp
main-app/src/book/CalDialogBookLocalItem.cpp
main-app/src/common/CalDialogSimpleTitleItem.cpp
main-app/src/common/CalFilterView.cpp
main-app/src/common/CalTimePickerPopup.cpp
main-app/src/common/CalUnderlineEditField.cpp
main-app/src/detail/CalDialogDetailDescriptionItem.cpp
main-app/src/detail/CalDialogDetailEventTimeItem.cpp
main-app/src/detail/CalDialogDetailReminderItem.cpp
main-app/src/edit/CalDatePickerPopup.cpp
main-app/src/edit/CalDialogEditDateTimeItem.cpp
main-app/src/edit/CalDialogEditMoreItem.cpp
main-app/src/edit/CalDialogEditMoreMenuItem.cpp
main-app/src/edit/CalDialogEditOneTextRemoveIconItem.cpp
main-app/src/edit/CalDialogEditOptionalTextFieldItem.cpp
main-app/src/edit/CalDialogEditReminderRadioItem.cpp
main-app/src/edit/CalDialogEditRepeatMonthUnitItem.cpp
main-app/src/edit/CalDialogEditRepeatRadioItem.cpp
main-app/src/edit/CalDialogEditRepeatUnitItem.cpp
main-app/src/edit/CalDialogEditRepeatUntilDueDateItem.cpp
main-app/src/edit/CalDialogEditRepeatUntilForeverItem.cpp
main-app/src/edit/CalDialogEditRepeatUntilTimesItem.cpp
main-app/src/edit/CalDialogEditRepeatWeeklyUnitInfoItem.cpp
main-app/src/edit/CalDialogEditTextFieldItem.cpp
main-app/src/edit/CalDialogEditTwoTextRemoveIconItem.cpp
main-app/src/edit/CalEditDialogControl.cpp
main-app/src/edit/CalEditField.cpp
main-app/src/edit/CalEditReminderPopup.cpp
main-app/src/edit/CalEditRepeatMonthlyView.cpp
main-app/src/edit/CalEditRepeatPopup.cpp
main-app/src/edit/CalEditRepeatWeeklyView.cpp
main-app/src/edit/CalEditView.cpp
main-app/src/list/CalScheduleListControl.cpp
main-app/src/main/CalMainView.cpp
main-app/src/search/CalSearchView.cpp
main-app/src/setting/CalDialogSettingsMultilSubItem.cpp
main-app/src/setting/CalDialogSettingsOneTextOneIconItem.cpp
main-app/src/setting/CalDialogSettingsRadioItem.cpp
main-app/src/setting/CalDialogSettingsTwoTextItem.cpp
main-app/src/setting/CalSettingsView.cpp
widget/CalWidget.cpp
widget/CalWidgetApp.cpp

index d8552e5..315a4d6 100644 (file)
@@ -134,8 +134,7 @@ bool WApp::attachWindow(WWindow* win)
 void WApp::onAppControl(app_control_h request, bool firstLaunch)
 {
        Evas_Object* win = getWindow()->getEvasObj();
-       if( win )
-       {
+       if( win ) {
                elm_win_activate( win);
                evas_object_show( win);
        }
index 10cbe5f..77028de 100644 (file)
@@ -59,8 +59,7 @@ void __WAppEventHandlerImpl::__eventCb( app_event_info_h eventInfo, void* userDa
 
 void __WAppEventHandlerImpl::__removeEventHandler()
 {
-       if( __handle )
-       {
+       if( __handle ) {
                ui_app_remove_event_handler( __handle );
                __handle = NULL;
                __userData = NULL;
index 48101f5..83e96b9 100644 (file)
@@ -56,10 +56,8 @@ __WControlImpl::~__WControlImpl()
        if(__name)
                free(__name);
 
-       if( __popupMonitor )
-       {
-               if( auto p = __popupMonitor->lock() )
-               {
+       if( __popupMonitor ) {
+               if( auto p = __popupMonitor->lock() ) {
                        p->destroy();
                }
        }
@@ -81,12 +79,9 @@ WControl::WControl()
 
 WControl::~WControl()
 {
-       if( __pv->__name)
-       {
+       if( __pv->__name) {
                WDEBUG( "name=%s", __pv->__name );
-       }
-       else
-       {
+       } else {
                WHIT();
        }
        //
@@ -104,8 +99,7 @@ bool WControl::create( Evas_Object* parent, void* param )
        else
                WHIT();
 
-       if( __pv->__obj )
-       {
+       if( __pv->__obj ) {
                WDEBUG("Already created!");
                return true;
        }
@@ -131,15 +125,12 @@ bool WControl::create( Evas_Object* parent, void* param )
 
 void WControl::destroy()
 {
-       if(__pv->__obj)
-       {
+       if(__pv->__obj) {
                evas_object_del(__pv->__obj);
                // Do not leave any code here.
                // After executing upper statement "evas_object_del", this object will be deleted at evas object deletion callback!
 
-       }
-       else
-       {
+       } else {
                onDestroy();
                delete this;
        }
@@ -157,13 +148,11 @@ const Evas_Object* WControl::getConstEvasObj() const
 
 void WControl::setName(const char* name)
 {
-       if( __pv->__name)
-       {
+       if( __pv->__name) {
                free( __pv->__name);
                __pv->__name = NULL;
        }
-       if( name )
-       {
+       if( name ) {
                size_t len = strlen(name) + 1;
                __pv->__name = (char*)malloc(len);
                strncpy( __pv->__name, name, len);
@@ -177,8 +166,7 @@ const char* WControl::getName()
 
 std::weak_ptr<IWUiObject> WControl::getWeakPtr()
 {
-       if( __pv->__selfPtr )
-       {
+       if( __pv->__selfPtr ) {
                return std::weak_ptr<IWUiObject>(*__pv->__selfPtr);
        }
        __pv->__selfPtr = new std::shared_ptr<IWUiObject>( this,[](IWUiObject* p){} );
@@ -189,24 +177,19 @@ void WControl::attachPopup( WControl* popup )
 {
        Evas_Object* parent = NULL;
        Evas_Object* obj = getEvasObj();
-       while( (obj = elm_object_parent_widget_get( obj )) != NULL )
-       {
+       while( (obj = elm_object_parent_widget_get( obj )) != NULL ) {
                WView* view = WView_getInstanceFromEvasObj( obj );
-               if( view != NULL )
-               {
+               if( view != NULL ) {
                        parent = WView_getWindowBaseLayoutEvasObj( view );
                        break;
                }
        }
 
-       if( parent == NULL )
-       {
+       if( parent == NULL ) {
                WERROR("Cannot find parent View!");
                // If the pop-up has been already created, the following statement will just return without creating pop-up.
                popup->create( elm_object_top_widget_get( getEvasObj() ), NULL);
-       }
-       else
-       {
+       } else {
                // If the pop-up has been already created, the following statement will just return without creating pop-up.
                popup->create( parent, NULL );
        }
@@ -223,8 +206,7 @@ void WControl::destroyPopup()
 {
        if( __pv->__popupMonitor == NULL ) return;
 
-       if( auto p = __pv->__popupMonitor->lock() )
-       {
+       if( auto p = __pv->__popupMonitor->lock() ) {
                p->destroy();
                __pv->__popupMonitor->reset();
        }
index 2dbe658..442399e 100644 (file)
@@ -83,18 +83,15 @@ void WGenlistItem::selectCb(void *data, Evas_Object *obj, void *event_info)
 
 bool WGenlistItem::attachToView( WControl* popup )
 {
-       if( __pv->__objectItem == NULL )
-       {
+       if( __pv->__objectItem == NULL ) {
                WERROR("object item is not created!");
                return false;
        }
 
        Evas_Object* obj = elm_object_item_widget_get( __pv->__objectItem );
-       while( (obj = elm_object_parent_widget_get( obj )) != NULL )
-       {
+       while( (obj = elm_object_parent_widget_get( obj )) != NULL ) {
                WView* view = WView_getInstanceFromEvasObj( obj );
-               if( view != NULL )
-               {
+               if( view != NULL ) {
                        view->attachPopup( popup );
                        return true;
                }
index 04df3a9..f4d492c 100644 (file)
@@ -80,8 +80,7 @@ void __WMenuPopupImpl::__popupSelectCb( void* data, Evas_Object* obj, void* even
        WENTER();
        auto p = (WMenuPopup*)WControl_getInstanceFromEvasObj(obj);
        const unsigned int itemIndex = reinterpret_cast<unsigned long long>(data);
-       if (p && p->__pv)
-       {
+       if (p && p->__pv) {
            p->__pv->__vSelectItemCb[itemIndex]();
        }
        evas_object_del(obj);
@@ -117,8 +116,7 @@ WMenuPopup::WMenuPopup() : __pv( new __WMenuPopupImpl() )
 WMenuPopup::~WMenuPopup()
 {
        WHIT();
-       if (__pv->__popup)
-       {
+       if (__pv->__popup) {
                evas_object_event_callback_del(__pv->__navi, EVAS_CALLBACK_RESIZE, __WMenuPopupImpl::__popupResizeCb);
                evas_object_smart_callback_del(__pv->__win, "rotation,changed",  __WMenuPopupImpl::__popupWinRotateCb);
        }
@@ -161,8 +159,7 @@ void WMenuPopup::createMenu()
 
 Evas_Object* WMenuPopup::onCreate(Evas_Object* parent, void* param)
 {
-       if(__pv->__popup == NULL)
-       {
+       if(__pv->__popup == NULL) {
                WERROR("Not initialized!");
                return NULL;
        }
index 2bd9a31..b75b27f 100644 (file)
@@ -91,8 +91,7 @@ const char* WNaviframe::getClassName()
 
 bool WNaviframe::create( Evas_Object* parent, void* param )
 {
-       if( __pv->__evasObj )
-       {
+       if( __pv->__evasObj ) {
                WDEBUG("Already created!");
                return true;
        }
@@ -102,8 +101,7 @@ bool WNaviframe::create( Evas_Object* parent, void* param )
        else
                __pv->__evasObj = onCreate(parent, param);
 
-       if(__pv->__evasObj ==  NULL)
-       {
+       if(__pv->__evasObj ==  NULL) {
                WERROR("No frame object created!");
                return false;
        }
@@ -120,15 +118,12 @@ bool WNaviframe::create( Evas_Object* parent, void* param )
 void WNaviframe::destroy()
 {
        WHIT();
-       if(__pv->__evasObj)
-       {
+       if(__pv->__evasObj) {
                destroyAllViews();
                evas_object_del(__pv->__evasObj);
                // Do not leave any code here.
                // After executing upper statement "evas_object_del", this object will be deleted at evas object deletion callback!
-       }
-       else
-       {
+       } else {
                onDestroy();
                delete this;
        }
@@ -141,13 +136,11 @@ Evas_Object* WNaviframe::getEvasObj()
 
 void WNaviframe::setName(const char* name)
 {
-       if( __pv->__name)
-       {
+       if( __pv->__name) {
                free(__pv->__name);
                __pv->__name = NULL;
        }
-       if( name )
-       {
+       if( name ) {
                size_t len = strlen(name) + 1;
                __pv->__name = (char*)malloc(len);
                strncpy( __pv->__name, name, len);
@@ -183,8 +176,7 @@ void WNaviframe::destroyAllViews()
        Eina_List* list = elm_naviframe_items_get( getEvasObj());
        Eina_List* temp = NULL;
        void* it = NULL;
-       EINA_LIST_FOREACH( list, temp, it)
-       {
+       EINA_LIST_FOREACH( list, temp, it) {
                elm_object_item_del( (Elm_Object_Item*)it);
        }
 }
@@ -223,11 +215,9 @@ void WNaviframe::onLastItemPop(bool* popOut)
        WHIT();
        *popOut = false;
        WWindow* window = getWindow();
-       if (window != NULL)
-       {
+       if (window != NULL) {
                Evas_Object* evasObj = window->getEvasObj();
-               if (evasObj != NULL)
-               {
+               if (evasObj != NULL) {
                        elm_win_lower(evasObj);
                }
        }
@@ -260,8 +250,7 @@ bool WNaviframe::onItemPop( WView* view, Elm_Object_Item* item )
 {
        WNaviframe* nf = view->getNaviframe();
 
-       if( item == elm_naviframe_bottom_item_get( nf->getEvasObj() ))
-       {
+       if( item == elm_naviframe_bottom_item_get( nf->getEvasObj() )) {
                bool ret = view->onPop();
                if( ret == false )
                        return EINA_FALSE;
@@ -273,9 +262,7 @@ bool WNaviframe::onItemPop( WView* view, Elm_Object_Item* item )
                else
                        nf->onLastItemPop(&popOut);
                return popOut;
-       }
-       else
-       {
+       } else {
                return view->onPop();
        }
 }
index 9b95332..6ae1004 100644 (file)
@@ -52,16 +52,14 @@ __WPopupImpl::__WPopupImpl()
 {
        __content = NULL;
        __count = 0;
-       for( int i=0; i< __MAX_BUTTON_NUM; i++)
-       {
+       for( int i=0; i< __MAX_BUTTON_NUM; i++) {
                buttonPropertyCb[i] = NULL;
        }
 }
 
 __WPopupImpl::~__WPopupImpl()
 {
-       for( int i=0; i< __MAX_BUTTON_NUM; i++)
-       {
+       for( int i=0; i< __MAX_BUTTON_NUM; i++) {
                delete buttonPropertyCb[i];
        }
 }
@@ -99,8 +97,7 @@ void WPopup::setContent( const char* text )
                __pv->__text = text;
        else
                __pv->__text.clear();
-       if( __pv->__content )
-       {
+       if( __pv->__content ) {
                __pv->__content->destroy();
                __pv->__content = NULL;
        }
@@ -115,8 +112,7 @@ void WPopup::setContent( WControl* control )
 void WPopup::setContent( const std::function<Evas_Object* (Evas_Object* parent)> contentCreateCb )
 {
        __pv->__text = "";
-       if( __pv->__content )
-       {
+       if( __pv->__content ) {
                __pv->__content->destroy();
                __pv->__content = NULL;
        }
@@ -146,8 +142,7 @@ void WPopup::setTextTranslatable( const char* textDomain )
 
 bool WPopup::addButton(const char* buttonText, const std::function<void (bool* destroyPopup)> buttonCb, const std::function<void (Evas_Object* button)> setPropertyCb )
 {
-       if( __pv->__count >= __MAX_BUTTON_NUM )
-       {
+       if( __pv->__count >= __MAX_BUTTON_NUM ) {
                WERROR("Over the max button number! =%d", __pv->__count);
                return false;
        }
@@ -184,8 +179,7 @@ Evas_Object* WPopup::onCreate(Evas_Object* parent, void* param)
                        WPopup* p = (WPopup*)data;
                        bool destroyPopup = true;
                        p->__pv->__backCb( &destroyPopup );
-                       if( destroyPopup )
-                       {
+                       if( destroyPopup ) {
                                p->destroy();
                        }
                }, this);
@@ -195,34 +189,27 @@ Evas_Object* WPopup::onCreate(Evas_Object* parent, void* param)
        if( __pv->__morePropertiesCb )
                __pv->__morePropertiesCb( popup );
 
-       if (!__pv->__title.empty())
-       {
+       if (!__pv->__title.empty()) {
                if (!__pv->__textDomain.empty())
                        elm_object_domain_translatable_part_text_set(popup, "title,text", __pv->__textDomain.c_str(), __pv->__title.c_str());
                else
                        elm_object_part_text_set(popup, "title,text", __pv->__title.c_str() );
        }
 
-       if (!__pv->__text.empty())
-       {
+       if (!__pv->__text.empty()) {
                if (!__pv->__textDomain.empty())
                        elm_object_domain_translatable_part_text_set(popup, NULL, __pv->__textDomain.c_str(), __pv->__text.c_str());
                else
                        elm_object_text_set(popup, __pv->__text.c_str());
-       }
-       else if( __pv->__content)
-       {
+       } else if( __pv->__content) {
                __pv->__content->create(popup, NULL);
                elm_object_content_set(popup, __pv->__content->getEvasObj());
-       }
-       else if( __pv->__contentCreateCb )
-       {
+       } else if( __pv->__contentCreateCb ) {
                Evas_Object* obj = __pv->__contentCreateCb( popup );
                elm_object_content_set(popup, obj);
        }
 
-       for( int i=0; i< __pv->__count; i++ )
-       {
+       for( int i=0; i< __pv->__count; i++ ) {
                Evas_Object* button = elm_button_add(popup);
                elm_object_style_set(button, "popup");
                if (!__pv->__textDomain.empty())
@@ -248,8 +235,7 @@ Evas_Object* WPopup::onCreate(Evas_Object* parent, void* param)
                                break;
                }
 
-               if( __pv->buttonPropertyCb[i] )
-               {
+               if( __pv->buttonPropertyCb[i] ) {
                        (*__pv->buttonPropertyCb[i])( button );
                }
                evas_object_show( button);
index 59ce8d5..2e47422 100644 (file)
@@ -60,10 +60,8 @@ __WUiTimerImpl::~__WUiTimerImpl()
 
 void __WUiTimerImpl::__deleteTimer()
 {
-       if( __timer )
-       {
-               switch( __type )
-               {
+       if( __timer ) {
+               switch( __type ) {
                case WUiTimer::IDLER:
                        ecore_idler_del( (Ecore_Idler*)__timer);
                        break;
@@ -87,15 +85,13 @@ Eina_Bool __WUiTimerImpl::__timerCb( void* data )
 {
        auto p = (WUiTimer*)data;
 
-       if( p->__pv->__uiObjMonitor && p->__pv->__uiObjMonitor->expired() )
-       {
+       if( p->__pv->__uiObjMonitor && p->__pv->__uiObjMonitor->expired() ) {
                p->__pv->__timer = NULL;
                delete p;
                return ECORE_CALLBACK_CANCEL;
        }
        Eina_Bool ret = p->__pv->__timerFunc( p->__pv->__userData );
-       if( ret == ECORE_CALLBACK_CANCEL )
-       {
+       if( ret == ECORE_CALLBACK_CANCEL ) {
                p->__pv->__timer = NULL;
                delete p;
        }
@@ -106,8 +102,7 @@ void __WUiTimerImpl::__jobCb( void* data )
 {
        auto p = (WUiTimer*)data;
 
-       if( p->__pv->__uiObjMonitor && p->__pv->__uiObjMonitor->expired())
-       {
+       if( p->__pv->__uiObjMonitor && p->__pv->__uiObjMonitor->expired()) {
                p->__pv->__timer = NULL;
                delete p;
                return;
@@ -143,21 +138,17 @@ WUiTimer* WUiTimer::addIdler( const std::function<Eina_Bool (void*)>& timerFunc,
 {
        WUiTimer* timer = new WUiTimer();
        timer->__pv->__type = WUiTimer::IDLER;
-       if( !monitorObj.expired() )
-       {
+       if( !monitorObj.expired() ) {
                timer->__pv->__uiObjMonitor = new std::weak_ptr<IWUiObject>;
                *timer->__pv->__uiObjMonitor = monitorObj;
-       }
-       else
-       {
+       } else {
                WDEBUG( "No monitored object is set!");
        }
 
        timer->__pv->__timerFunc = timerFunc;
        timer->__pv->__userData = userData;
        Ecore_Idler* ecoreIdler = ecore_idler_add( __WUiTimerImpl::__timerCb, timer );
-       if( ecoreIdler == NULL )
-       {
+       if( ecoreIdler == NULL ) {
                WERROR("failed to add ecore idler!");
                delete timer;
                return NULL;
@@ -169,20 +160,16 @@ WUiTimer* WUiTimer::addAnimator( const std::function<Eina_Bool (void*)>& timerFu
 {
        WUiTimer* timer = new WUiTimer();
        timer->__pv->__type = WUiTimer::ANIMATOR;
-       if( !monitorObj.expired() )
-       {
+       if( !monitorObj.expired() ) {
                timer->__pv->__uiObjMonitor = new std::weak_ptr<IWUiObject>;
                *timer->__pv->__uiObjMonitor = monitorObj;
-       }
-       else
-       {
+       } else {
                WDEBUG( "No monitored object is set!");
        }
        timer->__pv->__timerFunc = timerFunc;
        timer->__pv->__userData = userData;
        Ecore_Animator* ecoreAnimator = ecore_animator_add( __WUiTimerImpl::__timerCb, timer );
-       if( ecoreAnimator == NULL )
-       {
+       if( ecoreAnimator == NULL ) {
                WERROR("failed to add ecore animator!");
                delete timer;
                return NULL;
@@ -194,20 +181,16 @@ WUiTimer* WUiTimer::addTimer( double interval, const std::function<Eina_Bool (vo
 {
        WUiTimer* timer = new WUiTimer();
        timer->__pv->__type = WUiTimer::TIMER;
-       if( !monitorObj.expired() )
-       {
+       if( !monitorObj.expired() ) {
                timer->__pv->__uiObjMonitor = new std::weak_ptr<IWUiObject>;
                *timer->__pv->__uiObjMonitor = monitorObj;
-       }
-       else
-       {
+       } else {
                WDEBUG( "No monitored object is set!");
        }
        timer->__pv->__timerFunc = timerFunc;
        timer->__pv->__userData = userData;
        Ecore_Timer* ecoreTimer = ecore_timer_add( interval, __WUiTimerImpl::__timerCb, timer );
-       if( ecoreTimer == NULL )
-       {
+       if( ecoreTimer == NULL ) {
                WERROR("failed to add ecore timer!");
                delete timer;
                return NULL;
@@ -220,20 +203,16 @@ WUiTimer* WUiTimer::addJob( const std::function<void (void*)>& timerFunc, void*
 {
        WUiTimer* timer = new WUiTimer();
        timer->__pv->__type = WUiTimer::JOB;
-       if( !monitorObj.expired() )
-       {
+       if( !monitorObj.expired() ) {
                timer->__pv->__uiObjMonitor = new std::weak_ptr<IWUiObject>;
                *timer->__pv->__uiObjMonitor = monitorObj;
-       }
-       else
-       {
+       } else {
                WDEBUG( "No monitored object is set!");
        }
        timer->__pv->__jobFunc = timerFunc;
        timer->__pv->__userData = userData;
        Ecore_Job* ecoreJob = ecore_job_add( __WUiTimerImpl::__jobCb, timer );
-       if( ecoreJob == NULL )
-       {
+       if( ecoreJob == NULL ) {
                WERROR("failed to add ecore job!");
                delete timer;
                return NULL;
index 656f67c..7a0f432 100644 (file)
@@ -76,10 +76,8 @@ __WViewImpl::~__WViewImpl()
                free(__title);
 
        //
-       if( __popupMonitor )
-       {
-               if( auto p = __popupMonitor->lock() )
-               {
+       if( __popupMonitor ) {
+               if( auto p = __popupMonitor->lock() ) {
                        p->destroy();
                }
        }
@@ -110,12 +108,9 @@ WView::WView( const char* name ) : __pv( new __WViewImpl() )
 
 WView::~WView()
 {
-       if( __pv->__name)
-       {
+       if( __pv->__name) {
                WDEBUG( "name=%s", __pv->__name );
-       }
-       else
-       {
+       } else {
                WHIT();
        }
 
@@ -132,8 +127,7 @@ bool WView::create( Evas_Object* parent, void* viewParam )
 {
        WHIT();
 
-       if( __pv->__obj )
-       {
+       if( __pv->__obj ) {
                WDEBUG("Already created!");
                return true;
        }
@@ -162,21 +156,15 @@ bool WView::create( Evas_Object* parent, void* viewParam )
 
 void WView::destroy()
 {
-       if(__pv->__obj)
-       {
-               if( getNaviframe() )
-               {
+       if(__pv->__obj) {
+               if( getNaviframe() ) {
                        elm_object_item_del( __pv->__naviItem );
-               }
-               else
-               {
+               } else {
                        evas_object_del(__pv->__obj);
                }
                // Do not leave any code here.
                // After executing upper statement "evas_object_del", this object will be deleted at evas object deletion callback!
-       }
-       else
-       {
+       } else {
                __destroy();
        }
 }
@@ -188,13 +176,11 @@ Evas_Object* WView::getEvasObj()
 
 void WView::setName(const char* name)
 {
-       if( __pv->__name)
-       {
+       if( __pv->__name) {
                free( __pv->__name);
                __pv->__name = NULL;
        }
-       if( name )
-       {
+       if( name ) {
                size_t len = strlen(name) + 1;
                __pv->__name = (char*)malloc(len);
                strncpy( __pv->__name, name, len);
@@ -208,13 +194,11 @@ const char* WView::getName()
 
 void WView::setTitle( const char* title )
 {
-       if( __pv->__title)
-       {
+       if( __pv->__title) {
                free( __pv->__title);
                __pv->__title = NULL;
        }
-       if( title )
-       {
+       if( title ) {
                size_t len = strlen(title) + 1;
                __pv->__title = (char*)malloc(len);
                strncpy( __pv->__title, title, len);
@@ -227,8 +211,7 @@ const char* WView::getTitle()
 
 std::weak_ptr<IWUiObject> WView::getWeakPtr()
 {
-       if( __pv->__selfPtr )
-       {
+       if( __pv->__selfPtr ) {
                return std::weak_ptr<IWUiObject>(*__pv->__selfPtr);
        }
        __pv->__selfPtr = new std::shared_ptr<IWUiObject>( this,[](IWUiObject* p){} );
@@ -247,21 +230,18 @@ void WView::setOnPushed( const std::function<void (Elm_Object_Item*)>& handlerFu
 
 bool WView::popOut()
 {
-       if( getEvasObj() == NULL)
-       {
+       if( getEvasObj() == NULL) {
                WWARNING("Not created view! No Evas Object!");
                return false;
        }
-       if( getNaviframe() == NULL)
-       {
+       if( getNaviframe() == NULL) {
                WWARNING("Not pushed to naviframe!");
                return false;
        }
 
        destroyPopup(); // Before popping out view, pop-up is destroyed, if it has.Because pop-up is disappeared too late.
 
-       if( __pv->__naviItem != elm_naviframe_top_item_get(getNaviframe()->getEvasObj()) )
-       {
+       if( __pv->__naviItem != elm_naviframe_top_item_get(getNaviframe()->getEvasObj()) ) {
                elm_object_item_del(__pv->__naviItem);
                return true;
        }
@@ -283,8 +263,7 @@ bool WView::onPop()
 
 WNaviframe* WView::getNaviframe()
 {
-       if( __pv->__naviframe == NULL)
-       {
+       if( __pv->__naviframe == NULL) {
                WWARNING("naviframe does not exist!");
        }
 
@@ -293,8 +272,7 @@ WNaviframe* WView::getNaviframe()
 
 Elm_Object_Item* WView::getNaviItem()
 {
-       if( __pv->__naviItem == NULL)
-       {
+       if( __pv->__naviItem == NULL) {
                WWARNING("naviItem does not exist!");
        }
 
@@ -318,8 +296,7 @@ Evas_Object* WView::onCreate( Evas_Object* parent, void* viewParam )
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        char* path = app_get_resource_path();
-       if( path == NULL )
-       {
+       if( path == NULL ) {
                WERROR("Failed to get resource path=NULL");
                return layout;
        }
@@ -327,8 +304,7 @@ Evas_Object* WView::onCreate( Evas_Object* parent, void* viewParam )
        free(path);
        edjPath += "edje/app-assist-efl.edj";
 
-       if( elm_layout_file_set(layout, edjPath.c_str(), "default-view") == EINA_TRUE)
-       {
+       if( elm_layout_file_set(layout, edjPath.c_str(), "default-view") == EINA_TRUE) {
                Evas_Object* rect = evas_object_rectangle_add(evas_object_evas_get(layout));
                evas_object_color_set(rect, rand() % 256, rand() % 256, rand() % 256, 255);
                evas_object_size_hint_weight_set(rect, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -338,9 +314,7 @@ Evas_Object* WView::onCreate( Evas_Object* parent, void* viewParam )
                if( getName() != NULL )
                        elm_object_part_text_set(layout, "name", getName());
 
-       }
-       else
-       {
+       } else {
                WERROR("Fail to set layout. Check EDJ file(%s)", edjPath.c_str());
        }
 
@@ -356,8 +330,7 @@ void WView::onDestroy()
 
 bool WView::enableMoreButton( Elm_Object_Item* naviItem, Evas_Smart_Cb clickedCb, void* userData )
 {
-       if( getNaviframe() == NULL )
-       {
+       if( getNaviframe() == NULL ) {
                WERROR("naviframe is not set");
                return false;
        }
@@ -374,8 +347,7 @@ void WView::attachPopup( WControl* popup )
 {
        // If the pop-up has been already created, the following statement will just return without creating pop-up.
        Evas_Object* parent = WView_getWindowBaseLayoutEvasObj( this );
-       if( parent == NULL )
-       {
+       if( parent == NULL ) {
                WERROR("Parent is NULL! Fail to attach popup");
                return;
        }
@@ -395,8 +367,7 @@ void WView::destroyPopup()
 {
        if( __pv->__popupMonitor == NULL ) return;
 
-       if( auto p = __pv->__popupMonitor->lock() )
-       {
+       if( auto p = __pv->__popupMonitor->lock() ) {
                p->destroy();
                __pv->__popupMonitor->reset();
        }
@@ -404,8 +375,7 @@ void WView::destroyPopup()
 
 bool WView::__callPushedHandlerFunc(Elm_Object_Item* naviItem)
 {
-       if( __pv->__pushedHandler )
-       {
+       if( __pv->__pushedHandler ) {
                __pv->__pushedHandler(naviItem);
                return true;
        }
@@ -425,12 +395,9 @@ WView* WView_getInstanceFromEvasObj(Evas_Object* obj)
 
 Evas_Object* WView_getWindowBaseLayoutEvasObj( WView* view )
 {
-       if( view->getWindow() )
-       {
+       if( view->getWindow() ) {
                return view->getWindow()->getBaseLayoutEvasObj();
-       }
-       else
-       {
+       } else {
                WERROR("Fail to get base layout");
                return NULL;
        }
@@ -438,12 +405,9 @@ Evas_Object* WView_getWindowBaseLayoutEvasObj( WView* view )
 
 Evas_Object* WView_getWindowEvasObj( WView* view )
 {
-       if( view->getWindow() )
-       {
+       if( view->getWindow() ) {
                return view->getWindow()->getEvasObj();
-       }
-       else
-       {
+       } else {
                WERROR("Fail to get window evas object");
                return NULL;
        }
index 1668f04..92a5a93 100644 (file)
@@ -75,8 +75,7 @@ __WWindowImpl::__WWindowImpl(Evas_Object* win, Evas_Object* conform, Evas_Object
        __createBaseLayoutHandler(NULL),
        __owner(false)
 {
-       if(win)
-       {
+       if(win) {
                __winType = elm_win_type_get(win);
                const char *title = elm_win_title_get(win);
                if(title)
@@ -131,8 +130,7 @@ const char* WWindow::getClassName()
 
 bool WWindow::create()
 {
-       if(__pv->__win || !__pv->__owner)
-       {
+       if(__pv->__win || !__pv->__owner) {
                WDEBUG("Already created!");
                return true;
        }
@@ -143,8 +141,7 @@ bool WWindow::create()
        else
                win = onCreateWin();
        __pv->__win = win;
-       if( win )
-       {
+       if( win ) {
                Evas_Object* cf = NULL;
                if(__pv->__createBaseLayoutHandler)
                        __pv->__baseLayout = __pv->__createBaseLayoutHandler(win,&cf);
@@ -158,31 +155,23 @@ bool WWindow::create()
                evas_object_show( win );
 
                return true;
-       }
-       else
-       {
+       } else {
                return false;
        }
 }
 
 void WWindow::destroy()
 {
-       if(__pv->__owner)
-       {
-               if( __pv->__win)
-               {
+       if(__pv->__owner) {
+               if( __pv->__win) {
                        evas_object_del(__pv->__win);
                        // Do not leave any code here.
                        // After executing upper statement "evas_object_del", this object will be deleted at evas object deletion callback!
-               }
-               else
-               {
+               } else {
                        onDestroy();
                        delete this;
                }
-       }
-       else
-       {
+       } else {
                delete this;
        }
 }
@@ -212,8 +201,7 @@ bool WWindow::attachBaseUiObject( IWUiObject* baseObj, void* creationParam )
 
        WASSERT( __pv->__baseObj == NULL);
 
-       if( baseObj->create( __pv->__baseLayout, creationParam) == false )
-       {
+       if( baseObj->create( __pv->__baseLayout, creationParam) == false ) {
                return false;
        }
 
@@ -266,8 +254,7 @@ void WWindow::setOnCreateBaseLayout( const std::function<Evas_Object* (Evas_Obje
 Evas_Object* WWindow::onCreateWin()
 {
        Evas_Object* win = elm_win_add( NULL, getName(), getWinType() );
-       if( win == NULL)
-       {
+       if( win == NULL) {
                WERROR("Fail to create win!");
                return NULL;
        }
@@ -275,8 +262,7 @@ Evas_Object* WWindow::onCreateWin()
        elm_win_title_set( win, getName() );
        elm_win_conformant_set( win, EINA_TRUE);
        elm_win_autodel_set( win, EINA_TRUE);
-       if( elm_win_wm_rotation_supported_get(win))
-       {
+       if( elm_win_wm_rotation_supported_get(win)) {
                int rotation[4] = {0,90,180,270};
                elm_win_wm_rotation_available_rotations_set( win, (const int*)(&rotation), 4);
 
index 50af0dc..c1df7e9 100644 (file)
@@ -45,8 +45,7 @@ CalAlertApp::CalAlertApp() :
 CalAlertApp::~CalAlertApp()
 {
        WENTER();
-       if(__timer)
-       {
+       if(__timer) {
                ecore_timer_del(__timer);
        }
 
@@ -120,8 +119,7 @@ void CalAlertApp::onAppControl(app_control_h request, bool firstLaunch)
 {
        WENTER();
        Mode mode = __getMode(request);
-       switch (mode)
-       {
+       switch (mode) {
        case CALALERT_VIEW:
                WDEBUG("Show Alert");
                __createWindowSafe(firstLaunch, true);
@@ -162,8 +160,7 @@ void CalAlertApp::onAppControl(app_control_h request, bool firstLaunch)
                break;
        }
 
-       if(getWindow())
-       {
+       if(getWindow()) {
                WApp::onAppControl(request, firstLaunch);
        }
 
@@ -171,15 +168,11 @@ void CalAlertApp::onAppControl(app_control_h request, bool firstLaunch)
 }
 void CalAlertApp::__createWindowSafe(bool isFirstLaunch, bool isAlertPopup)
 {
-       if (isFirstLaunch)
-       {
+       if (isFirstLaunch) {
                __createWindow(isAlertPopup);
-       }
-       else
-       {
+       } else {
                WWindow* win = getWindow();
-               if (win == NULL)
-               {
+               if (win == NULL) {
                        __stopExit();
                        __createWindow(isAlertPopup);
                }
@@ -187,25 +180,21 @@ void CalAlertApp::__createWindowSafe(bool isFirstLaunch, bool isAlertPopup)
 }
 void CalAlertApp::__createWindow(bool isAlertPopup)
 {
-       if (isAlertPopup)
-       {
+       if (isAlertPopup) {
                device_power_wakeup(false);
                device_display_change_state(DISPLAY_STATE_NORMAL);
 
                attachWindow(new WWindow("Calendar", ELM_WIN_NOTIFICATION));
 
                efl_util_set_notification_window_level(getWindow()->getEvasObj(), EFL_UTIL_NOTIFICATION_LEVEL_TOP);
-       }
-       else
-       {
+       } else {
                attachWindow(new WWindow("Calendar", ELM_WIN_BASIC));
        }
 
        elm_win_indicator_mode_set(getWindow()->getEvasObj(), ELM_WIN_INDICATOR_SHOW);
 
        CalNaviframe* naviframe = new CalNaviframe();
-       if (!isAlertPopup)
-       {
+       if (!isAlertPopup) {
                naviframe->setOnLastItemPop([] (bool* popOut) {
                                *popOut = false;
                                elm_exit();
@@ -229,31 +218,21 @@ CalAlertApp::Mode CalAlertApp::__getMode(const app_control_h request)
        char *caller = NULL;
        app_control_get_extra_data(request, CAL_APPSVC_PARAM_CALLER, &caller);
 
-       if (caller != NULL)
-       {
+       if (caller != NULL) {
                WDEBUG("caller [%s]", caller);
-               if(!strcmp(caller, CAL_APPSVC_PARAM_CALLER_NOTIFICATION))
-               {
+               if(!strcmp(caller, CAL_APPSVC_PARAM_CALLER_NOTIFICATION)) {
                        char *action = NULL;
                        app_control_get_extra_data(request, CAL_APPALERT_PARAM_ACTION, &action);
 
-                       if (action != NULL)
-                       {
+                       if (action != NULL) {
                                WDEBUG("action [%s]", action);
-                               if (!strcmp(action, CAL_APPALERT_ACTION_DISMISS))
-                               {
+                               if (!strcmp(action, CAL_APPALERT_ACTION_DISMISS)) {
                                        mode = CALALERT_DISMISS;
-                               }
-                               else if (!strcmp(action, CAL_APPALERT_ACTION_SNOOZE))
-                               {
+                               } else if (!strcmp(action, CAL_APPALERT_ACTION_SNOOZE)) {
                                        mode = CALALERT_SNOOZE;
-                               }
-                               else if (!strcmp(action, CAL_APPALERT_ACTION_SHOW_NOTIFICATION_LIST))
-                               {
+                               } else if (!strcmp(action, CAL_APPALERT_ACTION_SHOW_NOTIFICATION_LIST)) {
                                        mode = CALALERT_SHOW_NOTIFICATION_LIST;
-                               }
-                               else
-                               {
+                               } else {
                                        WERROR("Wrong action");
                                }
                                free(action);
@@ -261,18 +240,13 @@ CalAlertApp::Mode CalAlertApp::__getMode(const app_control_h request)
 
                        __alertData = std::make_shared<CalAlertData>();
                        __model = std::make_shared<CalAlertModel>(__alertData);
-               }
-               else if(!strcmp(caller, CAL_APPSVC_PARAM_CALLER_CALENDAR))
-               {
+               } else if(!strcmp(caller, CAL_APPSVC_PARAM_CALLER_CALENDAR)) {
                        mode = CALALERT_UPDATE_STATUSBAR;
                }
                free(caller);
-       }
-       else
-       {
+       } else {
                __alertData = std::make_shared<CalAlertData>(request);
-               if(__alertData->getCount())
-               {
+               if(__alertData->getCount()) {
                        mode = CalAlertModel::isDeviceLocked() ? CALALERT_VIEW :
                                        CALALERT_ACTIVE_NOTIFICATION;
                }
@@ -284,12 +258,9 @@ void CalAlertApp::__launchAlertView(std::shared_ptr<CalAlertData> alertData)
 {
        WENTER();
        CalNaviframe* frame = (CalNaviframe*)getWindow()->getBaseUiObject();
-       if (auto view = __alertView.lock())
-       {
+       if (auto view = __alertView.lock()) {
                static_cast<CalAlertView *>(view.get())->replaceAlertData(alertData);
-       }
-       else
-       {
+       } else {
                CalAlertView *newView = new CalAlertView(alertData);
                frame->push(newView);
                __alertView = newView->getWeakPtr();
@@ -300,12 +271,9 @@ void CalAlertApp::__launchNotificationView(std::shared_ptr<CalAlertData> alertDa
 {
        WENTER();
        CalNaviframe* frame = (CalNaviframe*)getWindow()->getBaseUiObject();
-       if (auto view = __notificationsView.lock())
-       {
+       if (auto view = __notificationsView.lock()) {
                static_cast<CalNotificationsView *>(view.get())->replaceAlertData(alertData);
-       }
-       else
-       {
+       } else {
                CalNotificationsView *newView = new CalNotificationsView(alertData);
                frame->push(newView);
                __notificationsView = newView->getWeakPtr();
@@ -323,8 +291,7 @@ void CalAlertApp::__setStatusBar(std::shared_ptr<CalAlertData> alertData)
 
 void CalAlertApp::__exit()
 {
-       if (__timer)
-       {
+       if (__timer) {
                return;
        }
 
@@ -337,8 +304,7 @@ void CalAlertApp::__exit()
 
 void CalAlertApp::__stopExit()
 {
-       if(__timer)
-       {
+       if(__timer) {
                ecore_timer_del(__timer);
        }
 
index 99fd435..c2edf90 100644 (file)
@@ -29,15 +29,13 @@ CalAlertData::CalAlertData(app_control_h request) :
        WENTER();
        char *value = NULL;
        app_control_get_extra_data(request, CAL_APPCALSVC_PARAM_TICK, &value);
-       if (value)
-       {
+       if (value) {
                __tick = atoi(value);
                free(value);
                value = NULL;
        }
        app_control_get_extra_data(request, CAL_APPCALSVC_PARAM_UNIT, &value);
-       if (value)
-       {
+       if (value) {
                __unit = atoi(value);
                free(value);
                value = NULL;
@@ -48,60 +46,51 @@ CalAlertData::CalAlertData(app_control_h request) :
        int len = 0;
        app_control_get_extra_data_array(request, CAL_APPCALSVC_PARAM_IDS, &ids, &len);
        WDEBUG("len(%d)", len);
-       if (len > 0)
-       {
+       if (len > 0) {
                // calendar-service
-               for (int i = 0; i < len; i++)
-               {
+               for (int i = 0; i < len; i++) {
                        int recordIndex = atoi(ids[i]);
                        __addRecord(recordIndex, false);
                        WDEBUG("alert index[%d]",recordIndex);
                }
 
-               if (ids)
-               {
+               if (ids) {
                        free(ids);
                }
 
                return;
        }
 
-       if (ids)
-       {
+       if (ids) {
                free(ids);
        }
 
        app_control_get_extra_data(request, CAL_APPSVC_PARAM_COUNT, &value);
-       if (value)
-       {
+       if (value) {
                free(value);
                value = NULL;
        }
 
        WDEBUG("alert count[%d]",getCount());
-       if (getCount() > 1)
-       {
+       if (getCount() > 1) {
                char key[ID_LENGTH] = {0};
                char snoozedKey[ID_LENGTH] = {0};
                int index = 0;
                char *snoozed = NULL;
                bool isSnoozed = false;
 
-               while (getCount() != index)
-               {
+               while (getCount() != index) {
                        snprintf(key, sizeof(key), "%d", index);
                        app_control_get_extra_data(request, key, &value);
 
                        snprintf(snoozedKey, sizeof(snoozedKey), "%d.%s", index, CAL_APPALERT_PARAM_IS_SNOOZED);
 
-                       if(APP_CONTROL_ERROR_NONE == app_control_get_extra_data(request, snoozedKey, &snoozed))
-                       {
+                       if(APP_CONTROL_ERROR_NONE == app_control_get_extra_data(request, snoozedKey, &snoozed)) {
                                isSnoozed = snoozed && !strcmp(snoozed, CAL_APPALERT_IS_SNOOZED);
                                free(snoozed);
                        }
 
-                       if (value)
-                       {
+                       if (value) {
                                int recordIndex = atoi(value);
                                free(value);
                                value = NULL;
@@ -110,20 +99,15 @@ CalAlertData::CalAlertData(app_control_h request) :
                        }
                        index++;
                }
-       }
-       else
-       {
+       } else {
                app_control_get_extra_data(request, CAL_APPCALSVC_PARAM_ID, &value);
-               if (value)
-               {
+               if (value) {
                        int recordIndex = atoi(value);
                        free(value);
                        value = NULL;
                        __addRecord(recordIndex, false);
                        WDEBUG("alert index[%d]",recordIndex);
-               }
-               else
-               {
+               } else {
                        WERROR("get value fail");
                }
        }
@@ -154,8 +138,7 @@ CalAlertData::CalAlertData(const CalAlertData& obj)
 
 const CalAlertData& CalAlertData::operator=(const CalAlertData& obj)
 {
-       if (this != &obj)
-       {
+       if (this != &obj) {
                __tick = obj.__tick;
                __unit = obj.__unit;
                __alerts = obj.__alerts;
@@ -183,8 +166,7 @@ int CalAlertData::getCount(void)
 std::shared_ptr<CalAlertNotificationItem> CalAlertData::getAt(int nth)
 {
        WENTER();
-       if (nth >= getCount())
-       {
+       if (nth >= getCount()) {
                WERROR("invalid input[%d/%d]", nth, getCount());
                return nullptr;
        }
@@ -199,8 +181,7 @@ bool CalAlertData::isSnoozed(int nth)
 void CalAlertData::remove(int nth)
 {
        WENTER();
-       if (nth >= getCount())
-       {
+       if (nth >= getCount()) {
                WERROR("invalid input[%d/%d]", nth, getCount());
                return;
        }
@@ -211,10 +192,8 @@ bool CalAlertData::removeById(int id)
 {
 
        WENTER();
-       for (auto alertNotiItem = __alerts.begin() ; alertNotiItem != __alerts.end(); ++alertNotiItem)
-       {
-               if ((*alertNotiItem)->getRecordIndex() == id)
-               {
+       for (auto alertNotiItem = __alerts.begin() ; alertNotiItem != __alerts.end(); ++alertNotiItem) {
+               if ((*alertNotiItem)->getRecordIndex() == id) {
                        __alerts.erase(alertNotiItem);
 
                        WLEAVE();
@@ -237,16 +216,14 @@ void CalAlertData::add(const CalAlertData& data)
        __tick = data.__tick;
        __unit = data.__unit;
 
-       for (auto item : data.__alerts)
-       {
+       for (auto item : data.__alerts) {
                auto result = std::find_if(__alerts.begin(), __alerts.end(),
                        [item](const std::shared_ptr<CalAlertNotificationItem> &it) -> bool
                        {
                                return item->getScheduleId() == it->getScheduleId();
                        });
 
-               if(__alerts.end() == result)
-               {
+               if(__alerts.end() == result) {
                        __alerts.insert(__alerts.begin(), item);
                }
        }
@@ -264,16 +241,13 @@ void CalAlertData::__addRecord(int recordIndex, bool isSnoozed)
 {
        calendar_record_h record = nullptr;
        int error = calendar_db_get_record(_calendar_event._uri, recordIndex, &record);
-       if (error == CALENDAR_ERROR_NONE)
-       {
+       if (error == CALENDAR_ERROR_NONE) {
                auto item = std::make_shared<CalAlertNotificationItem>(recordIndex);
                item->setSnoozed(isSnoozed);
                __alerts.push_back(item);
 
                calendar_record_destroy(record, true);
-       }
-       else
-       {
+       } else {
                WERROR("Record %d isn't found in the calendar database", recordIndex);
        }
 }
index 4c5fb07..19be290 100644 (file)
@@ -48,22 +48,14 @@ Elm_Genlist_Item_Class* CalAlertItem::getItemClassStatic()
        {
                CalAlertItem* self = (CalAlertItem*)data;
 
-               if(self && self->__alertItem.get())
-               {
-                       if (!strcmp(part, "elm.text.main.top"))
-                       {
+               if(self && self->__alertItem.get()) {
+                       if (!strcmp(part, "elm.text.main.top")) {
                                return self->__alertItem->getEventName();
-                       }
-                       else if (!strcmp(part, "elm.text.time.up"))
-                       {
+                       } else if (!strcmp(part, "elm.text.time.up")) {
                                return self->__alertItem->getStartTime();
-                       }
-                       else if (!strcmp(part, "elm.text.time.down"))
-                       {
+                       } else if (!strcmp(part, "elm.text.time.down")) {
                                return self->__alertItem->getEndTime();
-                       }
-                       else if (!strcmp(part, "elm.text.location"))
-                       {
+                       } else if (!strcmp(part, "elm.text.location")) {
                                return self->__alertItem->getLocation();
                        }
                }
@@ -72,8 +64,7 @@ Elm_Genlist_Item_Class* CalAlertItem::getItemClassStatic()
        itc.func.content_get = [](void *data, Evas_Object *obj, const char *part)->Evas_Object*
        {
                CalAlertItem* self = (CalAlertItem*)data;
-               if (!strcmp(part, PART_CHECK) && self->__isCheckVisible)
-               {
+               if (!strcmp(part, PART_CHECK) && self->__isCheckVisible) {
                        Evas_Object *check = elm_check_add(obj);
                        elm_check_state_set(check, EINA_FALSE);
                        evas_object_propagate_events_set(check, EINA_FALSE);
@@ -84,9 +75,7 @@ Elm_Genlist_Item_Class* CalAlertItem::getItemClassStatic()
                                , self);
                        self->__check = check;
                        return self->__check;
-               }
-               else if (!strcmp(part, "elm.swallow.color.bar"))
-               {
+               } else if (!strcmp(part, "elm.swallow.color.bar")) {
                        Evas_Object* icon = evas_object_rectangle_add(evas_object_evas_get(obj));
                        evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
@@ -105,11 +94,9 @@ Elm_Genlist_Item_Class* CalAlertItem::getItemClassStatic()
 
 void CalAlertItem::onCheck()
 {
-       if (__check)
-       {
+       if (__check) {
                elm_check_state_set(__check, !elm_check_state_get(__check));
-               if (__checkCb)
-               {
+               if (__checkCb) {
                        __checkCb();
                }
        }
@@ -122,8 +109,7 @@ void CalAlertItem::setCheckCb(std::function<void (void)> checkCb)
 
 void CalAlertItem::onSelect()
 {
-       if (__selectCb)
-       {
+       if (__selectCb) {
                __selectCb();
        }
 }
@@ -135,8 +121,7 @@ void CalAlertItem::setSelectCb(std::function<void (void)> selectCb)
 
 void CalAlertItem::setCheckVisibility(bool isVisible)
 {
-       if (__isCheckVisible != isVisible)
-       {
+       if (__isCheckVisible != isVisible) {
                __isCheckVisible = isVisible;
                elm_genlist_item_fields_update (getElmObjectItem(), PART_CHECK, ELM_GENLIST_ITEM_FIELD_CONTENT);
        }
index fb9348d..a1f3858 100644 (file)
@@ -67,17 +67,14 @@ void CalAlertModel::snoozeAll(void)
 {
        WENTER();
        int count =  __alertData->getCount();
-       if (count <= 0)
-       {
+       if (count <= 0) {
                WERROR("count[%d]",count);
                return ;
        }
 
-       for (int i = 0; i < count; i++)
-       {
+       for (int i = 0; i < count; i++) {
                std::shared_ptr<CalAlertNotificationItem> alertItem = __alertData->getAt(i);
-               if(alertItem)
-               {
+               if(alertItem) {
                        alertItem->setSnoozed(true);
                        __snooze(alertItem);
                }
@@ -90,8 +87,7 @@ void CalAlertModel::snooze(int nth)
        WENTER();
        std::shared_ptr<CalAlertNotificationItem> alertItem = __alertData->getAt(nth);
 
-       if (alertItem == NULL)
-       {
+       if (alertItem == NULL) {
                WERROR("fail");
                return;
        }
@@ -105,13 +101,10 @@ void CalAlertModel::dismissAll(void)
 {
        WENTER();
        int count = __alertData->getCount();
-       if(count > 0)
-       {
-               for (int i = 0; i < count; i++)
-               {
+       if(count > 0) {
+               for (int i = 0; i < count; i++) {
                        std::shared_ptr<CalAlertNotificationItem> alertItem = __alertData->getAt(i);
-                       if(alertItem->isSnoozed())
-                       {
+                       if(alertItem->isSnoozed()) {
                                __dismiss(alertItem);
                        }
                }
@@ -124,14 +117,12 @@ void CalAlertModel::dismiss(int nth)
 {
        WENTER();
        std::shared_ptr<CalAlertNotificationItem> alertItem = __alertData->getAt(nth);
-       if (alertItem == NULL)
-       {
+       if (alertItem == NULL) {
                WERROR("fail");
                return;
        }
 
-       if(alertItem->isSnoozed())
-       {
+       if(alertItem->isSnoozed()) {
                __dismiss(alertItem);
        }
 
@@ -143,8 +134,7 @@ void CalAlertModel::dismiss(int nth)
 void CalAlertModel::dismiss(std::vector<int> &nths)
 {
        WENTER();
-       for (auto nth : nths)
-       {
+       for (auto nth : nths) {
                __alertData->remove(nth);
        }
        CalStatusBarManager::getInstance().update(__alertData);
@@ -160,23 +150,20 @@ void CalAlertModel::remove(int nth)
 void CalAlertModel::turnOnLcd(void)
 {
        int error = device_power_wakeup(false);
-       if (error != DEVICE_ERROR_NONE)
-       {
+       if (error != DEVICE_ERROR_NONE) {
                WERROR("device_power_wakeup error %d", error);
        }
        // set display normal
        display_state_e state = DISPLAY_STATE_NORMAL;
        device_display_get_state(&state);
-       if (state != DISPLAY_STATE_NORMAL)
-       {
+       if (state != DISPLAY_STATE_NORMAL) {
                device_display_change_state(DISPLAY_STATE_NORMAL);
        }
        WDEBUG("display state: %d -> %d", state, DISPLAY_STATE_NORMAL);
        // power
        WHIT();
        error = device_power_request_lock(POWER_LOCK_DISPLAY, 60*1000);
-       if (error != DEVICE_ERROR_NONE)
-       {
+       if (error != DEVICE_ERROR_NONE) {
                WERROR("device_power_request_lock error %d", error);
        }
 }
@@ -185,14 +172,12 @@ void CalAlertModel::turnOffLcd(void)
 {
        display_state_e state = DISPLAY_STATE_NORMAL;
        device_display_get_state(&state);
-       if (state != DISPLAY_STATE_SCREEN_DIM)
-       {
+       if (state != DISPLAY_STATE_SCREEN_DIM) {
                device_display_change_state(DISPLAY_STATE_SCREEN_DIM);
        }
        WDEBUG("display state: %d -> %d", state ,DISPLAY_STATE_SCREEN_DIM);
        int ret = device_power_release_lock(POWER_LOCK_DISPLAY);
-       if (ret != 0)
-       {
+       if (ret != 0) {
                WERROR("fail");
        }
 }
@@ -201,8 +186,7 @@ bool CalAlertModel::isDeviceLocked(void)
 {
        int lock_state = SYSTEM_SETTINGS_LOCK_STATE_LOCK;
        int ret = system_settings_get_value_int(SYSTEM_SETTINGS_KEY_LOCK_STATE, &lock_state);
-       if (ret == SYSTEM_SETTINGS_ERROR_NONE)
-       {
+       if (ret == SYSTEM_SETTINGS_ERROR_NONE) {
                WDEBUG("lock state: %d", lock_state);
                return !(lock_state == SYSTEM_SETTINGS_LOCK_STATE_UNLOCK);
        }
@@ -217,8 +201,7 @@ void CalAlertModel::setSnoozeMinute(const int min)
        int error = PREFERENCE_ERROR_NONE;
 
        error = preference_set_int(CALENDAR_ALERT_NOTI_MIN_KEY, min);
-       if (error != PREFERENCE_ERROR_NONE)
-       {
+       if (error != PREFERENCE_ERROR_NONE) {
                WERROR("preference_set_int is failed(%x)", error);
        }
 }
@@ -229,8 +212,7 @@ int CalAlertModel::getSnoozeMinute(void)
        int error = PREFERENCE_ERROR_NONE;
        int min;
        error = preference_get_int(CALENDAR_ALERT_NOTI_MIN_KEY, &min);
-       if (error != PREFERENCE_ERROR_NONE)
-       {
+       if (error != PREFERENCE_ERROR_NONE) {
                min = DEFAULT_SNOOZE_TIME;
        }
        WDEBUG("%d", min);
@@ -269,8 +251,7 @@ void CalAlertModel::__snooze(std::shared_ptr<CalAlertNotificationItem> &item)
        int alarm_id = 0;
        int error = ALARM_ERROR_NONE;
        error = alarm_schedule_once_after_delay(service, getSnoozeMinute() * 60, &alarm_id);
-       if (error != ALARM_ERROR_NONE)
-       {
+       if (error != ALARM_ERROR_NONE) {
                WERROR("fail");
        }
        WDEBUG("alarm_id[%d]", alarm_id);
@@ -285,8 +266,7 @@ void CalAlertModel::__dismiss(std::shared_ptr<CalAlertNotificationItem> &item)
        WENTER();
        int alarmId = item->getAlarmId();
        int error = alarm_cancel(alarmId);
-       if (error != ALARM_ERROR_NONE)
-       {
+       if (error != ALARM_ERROR_NONE) {
                WERROR("Failed to delete alarm %d", alarmId);
        }
 }
index cc4339e..a93bdcf 100644 (file)
@@ -71,12 +71,10 @@ int CalAlertNotificationItem::getAlarmId()
 void CalAlertNotificationItem::__getRecord(int recordIndex)
 {
        WENTER();
-       if(recordIndex)
-       {
+       if(recordIndex) {
                calendar_record_h record = NULL;
                int error = calendar_db_get_record(_calendar_event._uri, recordIndex, &record);
-               if (error == CALENDAR_ERROR_NONE)
-               {
+               if (error == CALENDAR_ERROR_NONE) {
                        __schedule = std::make_shared<CalOriginalSchedule>(record);
                }
        }
@@ -93,24 +91,18 @@ char *CalAlertNotificationItem::getEventName()
        const char *summary = __schedule->getSummary();
        const char *eventName = NULL;
 
-       if (summary && *summary)
-       {
+       if (summary && *summary) {
                eventName = summary;
-       }
-       else
-       {
+       } else {
                eventName = _L_("IDS_CLD_MBODY_MY_EVENT");
        }
 
-       if (isSnoozed())
-       {
+       if (isSnoozed()) {
                int newSize = strlen(eventName) + strlen(_L_("IDS_CLD_MBODY_PS_HSNOOZED_T_CALENDAR")) + 1;
                char *newName = (char*)calloc(1, newSize);
                snprintf(newName, newSize, _L_("IDS_CLD_MBODY_PS_HSNOOZED_T_CALENDAR"), eventName);
                return newName;
-       }
-       else
-       {
+       } else {
                return strdup(eventName);
        }
 }
@@ -148,12 +140,9 @@ char *CalAlertNotificationItem::getLocation()
 {
        WENTER();
        const char *location = __schedule->getLocation();
-       if (location && *location)
-       {
+       if (location && *location) {
                return strdup(location);
-       }
-       else
-       {
+       } else {
                return strdup("");
        }
 }
index 66ae498..d1fa052 100644 (file)
@@ -51,8 +51,7 @@ CalAlertView::~CalAlertView()
        WENTER();
        __model.turnOffLcd();
 
-       if(__timer)
-       {
+       if(__timer) {
                ecore_timer_del(__timer);
                __timer = NULL;
        }
@@ -83,10 +82,8 @@ Evas_Object* CalAlertView::onCreate( Evas_Object* parent, void* viewParam )
        std::stringstream ss(startText);
 
        int iteration = 0;
-       while (ss >> buf)
-       {
-               switch (iteration)
-               {
+       while (ss >> buf) {
+               switch (iteration) {
                case 0:
                        elm_object_part_text_set(layout, "event_time", buf.c_str());
                        break;
@@ -135,8 +132,7 @@ Evas_Object* CalAlertView::onCreate( Evas_Object* parent, void* viewParam )
                        CalAlertView* self = (CalAlertView*)data;
                        self->__dismissDown = true;
                        Evas_Event_Mouse_Up* ev = (Evas_Event_Mouse_Up*)eventInfo;
-                       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
-                       {
+                       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) {
                                return;
                        }
                        Evas_Coord_Point currentPoint = ev->canvas;
@@ -146,13 +142,11 @@ Evas_Object* CalAlertView::onCreate( Evas_Object* parent, void* viewParam )
        evas_object_event_callback_add(dismissImage, EVAS_CALLBACK_MOUSE_MOVE,
                [](void *data, Evas *e, Evas_Object *obj, void *eventInfo){
                        CalAlertView* self = (CalAlertView*)data;
-                       if(!self->__dismissDown)
-                       {
+                       if(!self->__dismissDown) {
                                return;
                        }
                        Evas_Event_Mouse_Up* ev = (Evas_Event_Mouse_Up*)eventInfo;
-                       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
-                       {
+                       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) {
                                return;
                        }
                        Evas_Coord_Point currentPoint = ev->canvas;
@@ -162,12 +156,9 @@ Evas_Object* CalAlertView::onCreate( Evas_Object* parent, void* viewParam )
                        int distanceCentreY = abs(currentPoint.y - DISTANCE_Y);
                        int distanceForActivate =  sqrt(distanceCentreX * distanceCentreX + distanceCentreY * distanceCentreY);
 
-                       if(distanceForActivate > ACTIVATE_DISTANCE)
-                       {
+                       if(distanceForActivate > ACTIVATE_DISTANCE) {
                                self->__actionLock = true;
-                       }
-                       else
-                       {
+                       } else {
                                self->__actionLock = false;
                                int centerX = DISTANCE_X;
                                int centerY = DISTANCE_Y;
@@ -179,8 +170,7 @@ Evas_Object* CalAlertView::onCreate( Evas_Object* parent, void* viewParam )
        evas_object_event_callback_add(dismissImage, EVAS_CALLBACK_MOUSE_UP,
                [](void *data, Evas *e, Evas_Object *obj, void *eventInfo){
                        CalAlertView* self = (CalAlertView*)data;
-                       if (self->__actionLock && self->__dismissDown)
-                       {
+                       if (self->__actionLock && self->__dismissDown) {
                                self->__actionLock = false;
                                self->__dismissDown = false;
                                self->__model.dismiss(0);
@@ -193,8 +183,7 @@ Evas_Object* CalAlertView::onCreate( Evas_Object* parent, void* viewParam )
                        CalAlertView* self = (CalAlertView*)data;
                        self->__snoozeDown = true;
                        Evas_Event_Mouse_Up* ev = (Evas_Event_Mouse_Up*)eventInfo;
-                       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
-                       {
+                       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) {
                                return;
                        }
                        Evas_Coord_Point currentPoint = ev->canvas;
@@ -204,13 +193,11 @@ Evas_Object* CalAlertView::onCreate( Evas_Object* parent, void* viewParam )
        evas_object_event_callback_add(snoozeImage, EVAS_CALLBACK_MOUSE_MOVE,
                [](void *data, Evas *e, Evas_Object *obj, void *eventInfo){
                        CalAlertView* self = (CalAlertView*)data;
-                       if(!self->__snoozeDown)
-                       {
+                       if(!self->__snoozeDown) {
                                return;
                        }
                        Evas_Event_Mouse_Up* ev = (Evas_Event_Mouse_Up*)eventInfo;
-                       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
-                       {
+                       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) {
                                return;
                        }
                        Evas_Coord_Point currentPoint = ev->canvas;
@@ -220,12 +207,9 @@ Evas_Object* CalAlertView::onCreate( Evas_Object* parent, void* viewParam )
                        int distanceCentreY = abs(currentPoint.y - DISTANCE_Y);
                        int distanceForActivate =  sqrt(distanceCentreX * distanceCentreX + distanceCentreY * distanceCentreY);
 
-                       if(distanceForActivate > ACTIVATE_DISTANCE)
-                       {
+                       if(distanceForActivate > ACTIVATE_DISTANCE) {
                                self->__actionLock = true;
-                       }
-                       else
-                       {
+                       } else {
                                self->__actionLock = false;
                                int centerX = CENTER_X_POSITION;
                                int centerY = DISTANCE_Y;
@@ -236,8 +220,7 @@ Evas_Object* CalAlertView::onCreate( Evas_Object* parent, void* viewParam )
        evas_object_event_callback_add(snoozeImage, EVAS_CALLBACK_MOUSE_UP,
                [](void *data, Evas *e, Evas_Object *obj, void *eventInfo){
                        CalAlertView* self = (CalAlertView*)data;
-                       if (self->__actionLock && self->__snoozeDown)
-                       {
+                       if (self->__actionLock && self->__snoozeDown) {
                                self->__actionLock = false;
                                self->__snoozeDown = false;
                                self->__model.snooze(0);
index 0d5c1a9..e93537c 100644 (file)
@@ -41,8 +41,7 @@ Elm_Genlist_Item_Class* CalNotificationsSelectAllItem::getItemClassStatic()
        itc.item_style = "type1";
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
-               if (!strcmp(part, "elm.text"))
-               {
+               if (!strcmp(part, "elm.text")) {
                        return strdup(_L_("IDS_CLD_OPT_SELECT_ALL"));
                }
 
@@ -50,19 +49,15 @@ Elm_Genlist_Item_Class* CalNotificationsSelectAllItem::getItemClassStatic()
        };
        itc.func.content_get = [](void *data, Evas_Object *obj, const char *part)->Evas_Object*
        {
-               if (!strcmp(part, "elm.swallow.end"))
-               {
+               if (!strcmp(part, "elm.swallow.end")) {
                        CalNotificationsSelectAllItem *self = (CalNotificationsSelectAllItem *)data;
 
                        Evas_Object *check = elm_check_add(obj);
                        self->__checkbox = check;
 
-                       if (self->__isAllVisible)
-                       {
+                       if (self->__isAllVisible) {
                                elm_check_state_set(check, EINA_TRUE);
-                       }
-                       else
-                       {
+                       } else {
                                elm_check_state_set(check, EINA_FALSE);
                        }
                        evas_object_propagate_events_set(check, EINA_FALSE);
@@ -82,8 +77,7 @@ Elm_Genlist_Item_Class* CalNotificationsSelectAllItem::getItemClassStatic()
 void CalNotificationsSelectAllItem::onSelect()
 {
        WENTER();
-       if (__selectCb)
-       {
+       if (__selectCb) {
                __selectCb();
        }
 }
index 6633039..0eabd28 100644 (file)
@@ -63,8 +63,7 @@ void CalNotificationsView::__updateSelectAllItems()
        __isAllVisible = !__isAllVisible;
        __updateSelectAllCheck();
 
-       for (auto it = __itemMap.begin(); it != __itemMap.end(); ++it)
-       {
+       for (auto it = __itemMap.begin(); it != __itemMap.end(); ++it) {
                CalAlertItem* item = it->second;
                elm_check_state_set(item->getCheckObject(), __isAllVisible);
        }
@@ -76,12 +75,10 @@ void CalNotificationsView::__updateCheckStatus()
 {
        WENTER();
        int checkedCount = 0;
-       for (auto it = __itemMap.begin(); it != __itemMap.end(); ++it)
-       {
+       for (auto it = __itemMap.begin(); it != __itemMap.end(); ++it) {
                CalAlertItem* item = it->second;
                Evas_Object* obj = item->getCheckObject();
-               if (elm_check_state_get(obj) == EINA_TRUE)
-               {
+               if (elm_check_state_get(obj) == EINA_TRUE) {
                        ++checkedCount;
                }
 
@@ -89,8 +86,7 @@ void CalNotificationsView::__updateCheckStatus()
 
        __updateButtonStatus(!checkedCount, !checkedCount);
 
-       if (__model.getCount() > 1)
-       {
+       if (__model.getCount() > 1) {
                __isAllVisible = (__model.getCount() == checkedCount);
                __updateSelectAllCheck();
        }
@@ -117,8 +113,7 @@ void CalNotificationsView::__launchDetailApp(const std::shared_ptr<CalAlertNotif
 void CalNotificationsView::__update()
 {
        WENTER();
-       if (__dialog->getEvasObj())
-       {
+       if (__dialog->getEvasObj()) {
                elm_genlist_clear(__dialog->getEvasObj());
        }
 
@@ -126,23 +121,18 @@ void CalNotificationsView::__update()
 
        int count = __model.getCount();
 
-       if(count > 1)
-       {
+       if(count > 1) {
                __selectAllItem = new CalNotificationsSelectAllItem(__isAllVisible,
-                       [this] ()
-                       {
+                       [this] () {
                                __updateSelectAllItems();
                        });
 
                __dialog->add(__selectAllItem);
-       }
-       else
-       {
+       } else {
                __selectAllItem = NULL;
        }
 
-       for (int i = 0; i < count; i++)
-       {
+       for (int i = 0; i < count; i++) {
                std::shared_ptr<CalAlertNotificationItem> alertItem = __model.getAt(i);
                CalAlertItem* item = new CalAlertItem(alertItem);
 
@@ -165,8 +155,7 @@ void CalNotificationsView::__update()
                __itemMap.insert(std::pair<int, CalAlertItem*>(i, item));
        }
 
-       if (__itemMap.size() == 1)
-       {
+       if (__itemMap.size() == 1) {
                __itemMap[0]->setCheckVisibility(false);
        }
 
@@ -245,32 +234,24 @@ void CalNotificationsView::onPushed(Elm_Object_Item* naviItem)
        evas_object_smart_callback_add(left_button, "clicked",
                [](void* data, Evas_Object* obj, void* event_info){
                        CalNotificationsView* self = (CalNotificationsView*)data;
-                       if (self->__selectAllItem)
-                       {
-                               if(self->__isAllVisible)
-                               {
+                       if (self->__selectAllItem) {
+                               if(self->__isAllVisible) {
                                        WDEBUG("Dismiss all");
                                        self->__model.dismissAll();
-                               }
-                               else
-                               {
+                               } else {
                                        WDEBUG("Dismiss selected");
                                        int i = 0;
                                        std::vector<int> nths;
-                                       for (auto item : self->__itemMap)
-                                       {
+                                       for (auto item : self->__itemMap) {
                                                Evas_Object* obj = item.second->getCheckObject();
-                                               if (elm_check_state_get(obj))
-                                               {
+                                               if (elm_check_state_get(obj)) {
                                                        nths.push_back(i);
                                                }
                                                i++;
                                        }
                                        self->__model.dismiss(nths);
                                }
-                       }
-                       else
-                       {
+                       } else {
                                WDEBUG("Dismiss one");
                                self->__model.dismissAll();
                        }
@@ -287,30 +268,22 @@ void CalNotificationsView::onPushed(Elm_Object_Item* naviItem)
        evas_object_smart_callback_add(right_button, "clicked",
                [](void* data, Evas_Object* obj, void* event_info){
                        CalNotificationsView* self = (CalNotificationsView*)data;
-                       if (self->__selectAllItem)
-                       {
-                               if(self->__isAllVisible)
-                               {
+                       if (self->__selectAllItem) {
+                               if(self->__isAllVisible) {
                                        WDEBUG("Snooze all");
                                        self->__model.snoozeAll();
-                               }
-                               else
-                               {
+                               } else {
                                        WDEBUG("Snooze selected");
                                        int i = 0;
-                                       for (auto item : self->__itemMap)
-                                       {
+                                       for (auto item : self->__itemMap) {
                                                Evas_Object* obj = item.second->getCheckObject();
-                                               if (elm_check_state_get(obj))
-                                               {
+                                               if (elm_check_state_get(obj)) {
                                                        self->__model.snooze(i);
                                                }
                                                i++;
                                        }
                                }
-                       }
-                       else
-                       {
+                       } else {
                                WDEBUG("Snooze one");
                                self->__model.snoozeAll();
                        }
@@ -338,8 +311,7 @@ void CalNotificationsView::onEvent(const CalEvent& event)
                {
                        CalStatusBarManager::getInstance().checkDeletedEvent();
                        std::shared_ptr<CalAlertData> alertData = std::make_shared<CalAlertData>();
-                       if (alertData->getCount() == 0)
-                       {
+                       if (alertData->getCount() == 0) {
                                elm_exit();
                        }
                        __model.relaceAlertData(alertData);
@@ -347,8 +319,7 @@ void CalNotificationsView::onEvent(const CalEvent& event)
                        break;
                }
                case CalEvent::APP_RESUMED:
-                       if(__model.getCount() == 0)
-                       {
+                       if(__model.getCount() == 0) {
                                elm_exit();
                        } else {
                                __update();
index 78a258c..4549152 100755 (executable)
@@ -49,23 +49,17 @@ void CalStatusBarManager::pushNotification(std::shared_ptr<CalAlertData> &alertD
        WDEBUG("Notification: %p", notification);
        app_control_h service = NULL;
 
-       if (NULL == notification)
-       {
+       if (NULL == notification) {
                WDEBUG("Create new notification");
                notification = notification_create(NOTIFICATION_TYPE_NOTI);
                __setTag(notification);
                service = __createAppControl();
-       }
-       else
-       {
+       } else {
                WDEBUG("Notification already on status bar");
                notification_get_launch_option(notification, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void*)&service);
-               if (service)
-               {
+               if (service) {
                        __getNotificationData(alertData);
-               }
-               else
-               {
+               } else {
                        WDEBUG("There is no app-control");
                }
        }
@@ -73,8 +67,7 @@ void CalStatusBarManager::pushNotification(std::shared_ptr<CalAlertData> &alertD
        __setNotificationData(service, alertData);
        notification_set_launch_option(notification, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, service);
 
-       if(addSound)
-       {
+       if(addSound) {
                __addSound(notification);
                __addVib(notification);
        }
@@ -91,8 +84,7 @@ void CalStatusBarManager::pushActiveNotification(const std::shared_ptr<CalAlertD
        WENTER();
        int count = alertData->getCount();
 
-       for (int i = 0; i < count; i++)
-       {
+       for (int i = 0; i < count; i++) {
                auto alertItem = alertData->getAt(i);
                auto schedule = alertItem->getSchedule();
                WPRET_M((schedule == NULL),"invalid param");
@@ -105,14 +97,11 @@ void CalStatusBarManager::update(std::shared_ptr<CalAlertData>& alertData)
        WENTER();
        notification_h notification = __getHandle();
 
-       if (notification != NULL)
-       {
-               if (alertData->getCount() > 0)
-               {
+       if (notification != NULL) {
+               if (alertData->getCount() > 0) {
                        app_control_h service = NULL;
                        notification_get_launch_option(notification, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void*)&service);
-                       if(service)
-                       {
+                       if(service) {
                                __setupStatusBarNotification(notification, alertData);
                                __setNotificationData(service, alertData);
                                notification_set_launch_option(notification, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, service);
@@ -121,9 +110,7 @@ void CalStatusBarManager::update(std::shared_ptr<CalAlertData>& alertData)
                        }
 
                        notification_update(notification);
-               }
-               else
-               {
+               } else {
                        WDEBUG("No more events! Delete notification");
                        notification_delete(notification);
                        notification_free(notification);
@@ -140,15 +127,12 @@ void CalStatusBarManager::removeFromNotification(const int id)
        WENTER();
        notification_h notification = __getHandle();
 
-       if (notification != NULL)
-       {
+       if (notification != NULL) {
                WDEBUG("Remove id[%d] from notification", id);
 
                std::shared_ptr<CalAlertData> alertData = std::make_shared<CalAlertData>();
-               if (alertData->removeById(id))
-               {
-                       if (alertData->getCount() == 0)
-                       {
+               if (alertData->removeById(id)) {
+                       if (alertData->getCount() == 0) {
                                WDEBUG("No more events! Delete notification");
                                notification_delete(notification);
                                return;
@@ -176,19 +160,16 @@ void CalStatusBarManager::checkDeletedEvent()
        std::vector<std::shared_ptr<CalAlertNotificationItem> > items;
        getAllStatusBar(items);
 
-       for (auto it = items.begin() ; it != items.end(); ++it)
-       {
+       for (auto it = items.begin() ; it != items.end(); ++it) {
                calendar_record_h record = NULL;
                int recordIndex = (*it)->getRecordIndex();
                int error = calendar_db_get_record(_calendar_event._uri, recordIndex, &record);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        WDEBUG("remove[%d]",recordIndex);
                        removeFromNotification(recordIndex);
                }
 
-               if (record)
-               {
+               if (record) {
                        calendar_record_destroy(record, true);
                }
        }
@@ -206,33 +187,24 @@ void CalStatusBarManager::__addSound(notification_h notification)
        WENTER();
        std::string sound;
        __getSound(sound);
-       if (!sound.empty())
-       {
+       if (!sound.empty()) {
                WDEBUG("sound:%s",sound.c_str());
-               if (!strcmp(sound.c_str(), CAL_SETTING_NOTIFICATION_SOUND_DEFAULT))
-               {
+               if (!strcmp(sound.c_str(), CAL_SETTING_NOTIFICATION_SOUND_DEFAULT)) {
                        char *value = NULL;
                        int result = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &value);
-                       if (result == SYSTEM_SETTINGS_ERROR_NONE && value)
-                       {
+                       if (result == SYSTEM_SETTINGS_ERROR_NONE && value) {
                                WDEBUG("get default ringtone(%s)", value);
                                notification_set_sound(notification, NOTIFICATION_SOUND_TYPE_USER_DATA, value);
-                       }
-                       else
-                       {
+                       } else {
                                WERROR("fail");
                                notification_set_sound(notification, NOTIFICATION_SOUND_TYPE_USER_DATA, NULL);
                        }
 
                        free(value);
-               }
-               else
-               {
+               } else {
                        notification_set_sound(notification, NOTIFICATION_SOUND_TYPE_USER_DATA, sound.c_str());
                }
-       }
-       else
-       {
+       } else {
                WERROR("sound is null");
                notification_set_sound(notification, NOTIFICATION_SOUND_TYPE_NONE, NULL);
        }
@@ -242,8 +214,7 @@ void CalStatusBarManager::__getSound(std::string& sound)
 {
        WENTER();
        const char* alertSound = CalSettingsManager::getInstance().getAlertSound();
-       if (alertSound)
-       {
+       if (alertSound) {
                sound = alertSound;
        }
 }
@@ -273,8 +244,7 @@ void CalStatusBarManager::__pushActiveNotification(const std::shared_ptr<CalSche
        const char *event_name = schedule->getSummary();
        notification_h notification = notification_create(NOTIFICATION_TYPE_NOTI);
 
-       if (event_name && *event_name)
-       {
+       if (event_name && *event_name) {
                CalDateTime startTime;
                std::string timeBuff;
                std::stringstream title;
@@ -284,24 +254,19 @@ void CalStatusBarManager::__pushActiveNotification(const std::shared_ptr<CalSche
                title << timeBuff;
 
                const char * location = schedule->getLocation();
-               if (location)
-               {
-                       if (strlen(location))
-                       {
+               if (location) {
+                       if (strlen(location)) {
                                title << ", ";
                                title << location;
                        }
                }
                notification_set_text(notification, NOTIFICATION_TEXT_TYPE_INFO_1, event_name, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
                notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, title.str().c_str(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
-       }
-       else
-       {
+       } else {
                notification_set_text(notification, NOTIFICATION_TEXT_TYPE_INFO_1, _L_("IDS_CLD_MBODY_MY_EVENT"), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
        }
 
-       if (addSound)
-       {
+       if (addSound) {
                __addSound(notification);
                __addVib(notification);
        }
@@ -336,8 +301,7 @@ void CalStatusBarManager::__postNotification(notification_h notification)
        notification_set_time(notification, time(NULL));
 
        int noti_err = notification_post(notification);
-       if (noti_err != NOTIFICATION_ERROR_NONE)
-       {
+       if (noti_err != NOTIFICATION_ERROR_NONE) {
                WERROR("Notification post fail [%d]", noti_err);
        }
 }
@@ -359,8 +323,7 @@ void CalStatusBarManager::removeNotification()
        notification_h notification = __getHandle();
        WDEBUG("Notification: %p", notification);
 
-       if (notification)
-       {
+       if (notification) {
                notification_delete(notification);
                notification_free(notification);
        }
@@ -370,8 +333,7 @@ void CalStatusBarManager::getAllStatusBar(std::vector<std::shared_ptr<CalAlertNo
 {
        WENTER();
        notification_h notification = __getHandle();
-       if (!notification)
-       {
+       if (!notification) {
                WWARNING("No status-bar notification");
                return;
        }
@@ -379,8 +341,7 @@ void CalStatusBarManager::getAllStatusBar(std::vector<std::shared_ptr<CalAlertNo
        app_control_h service = NULL;
 
        int err = notification_get_launch_option(notification, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void *)&service);
-       if (service && err == NOTIFICATION_ERROR_NONE)
-       {
+       if (service && err == NOTIFICATION_ERROR_NONE) {
                WDEBUG("service: %p", service);
                char **idsStr = NULL;
                int alertCount = 0;
@@ -391,10 +352,8 @@ void CalStatusBarManager::getAllStatusBar(std::vector<std::shared_ptr<CalAlertNo
                int recordIndex = 0;
                app_control_get_extra_data_array(service, CAL_APPCALSVC_PARAM_IDS, &idsStr, &alertCount);
 
-               if (idsStr && alertCount > 0)
-               {
-                       for (int i = 0; i < alertCount; i++)
-                       {
+               if (idsStr && alertCount > 0) {
+                       for (int i = 0; i < alertCount; i++) {
                                recordIndex = atoi(idsStr[i]);
                                WDEBUG("recordIndex: %d", recordIndex);
 
@@ -402,8 +361,7 @@ void CalStatusBarManager::getAllStatusBar(std::vector<std::shared_ptr<CalAlertNo
                                app_control_get_extra_data(service, key, &isSnoozed);
 
                                auto item = std::make_shared<CalAlertNotificationItem>(recordIndex);
-                               if(isSnoozed && !strcmp(isSnoozed, CAL_APPALERT_IS_SNOOZED))
-                               {
+                               if(isSnoozed && !strcmp(isSnoozed, CAL_APPALERT_IS_SNOOZED)) {
                                        WDEBUG("Snoozed!!!");
                                        item->setSnoozed(true);
                                        free(isSnoozed);
@@ -420,9 +378,7 @@ void CalStatusBarManager::getAllStatusBar(std::vector<std::shared_ptr<CalAlertNo
                                free(idsStr[i]);
                        }
                        free(idsStr);
-               }
-               else
-               {
+               } else {
                        WERROR("Get notification data fail");
                        app_control_destroy(service);
                        notification_free(notification);
@@ -442,29 +398,22 @@ void CalStatusBarManager::__setNotificationEventCallback(notification_h notifica
        char recordIndexText[INDEX_BUFFER] = {0};
        snprintf(recordIndexText, sizeof(recordIndexText), "%d", recordIndex);
 
-       do
-       {
+       do {
                app_control_h app_control = NULL;
-               if (APP_CONTROL_ERROR_NONE != app_control_create(&app_control))
-               {
+               if (APP_CONTROL_ERROR_NONE != app_control_create(&app_control)) {
                        WERROR("Failed to create app_control");
                        break;
                }
 
                app_control_set_app_id(app_control, CALENDAR_NOTI_PACKAGE);
 
-               if (CAL_ALERT_DISMISS == action)
-               {
+               if (CAL_ALERT_DISMISS == action) {
                        WDEBUG("Set app control for DISMISS");
                        app_control_add_extra_data(app_control, CAL_APPALERT_PARAM_ACTION, CAL_APPALERT_ACTION_DISMISS);
-               }
-               else if (CAL_ALERT_SNOOZE == action)
-               {
+               } else if (CAL_ALERT_SNOOZE == action) {
                        WDEBUG("Set app control for SNOOZE");
                        app_control_add_extra_data(app_control, CAL_APPALERT_PARAM_ACTION, CAL_APPALERT_ACTION_SNOOZE);
-               }
-               else
-               {
+               } else {
                        WERROR("Wrong action");
                        app_control_destroy(app_control);
                        break;
@@ -487,8 +436,7 @@ notification_h CalStatusBarManager::__getHandle()
        notification_h notification = NULL;
        notification = notification_load_by_tag(CALENDAR_NOTI_PACKAGE);
        WDEBUG("Notification: %p", notification);
-       if(NULL == notification)
-       {
+       if(NULL == notification) {
                int err = get_last_result();
                WDEBUG("Load notification by tag fail: '%s', %d (%s)", CALENDAR_NOTI_PACKAGE, err, get_error_message(err));
        }
@@ -501,8 +449,7 @@ void CalStatusBarManager::__setTag(notification_h notification)
        int ret = notification_set_tag(notification, CALENDAR_NOTI_PACKAGE);
        WDEBUG("set tag %s, notification: %p", CALENDAR_NOTI_PACKAGE, notification);
 
-       if (ret != NOTIFICATION_ERROR_NONE)
-       {
+       if (ret != NOTIFICATION_ERROR_NONE) {
                WERROR("set tag option fail: %d", ret);
        }
 }
@@ -517,22 +464,19 @@ bool CalStatusBarManager::__setNotificationData(app_control_h service, std::shar
 {
        WENTER();
        int alertCount = alertData->getCount();
-       if (alertCount > 0)
-       {
+       if (alertCount > 0) {
                char snoozedKey[ID_LENGTH] = {0};
                char alarmIdKey[ID_LENGTH] = {0};
                char alarmId[ID_LENGTH] = {0};
                char **ids = g_new0(char*, alertCount);
 
-               for (int i = 0; i < alertCount; ++i)
-               {
+               for (int i = 0; i < alertCount; ++i) {
                        auto alertItem = alertData->getAt(i);
                        int id = alertItem->getScheduleId();
                        char* strId = g_strdup_printf("%d", id);
                        ids[i] = strId;
 
-                       if(alertItem->isSnoozed())
-                       {
+                       if(alertItem->isSnoozed()) {
                                snprintf(snoozedKey, sizeof(snoozedKey), "%d.%s", id, CAL_APPALERT_PARAM_IS_SNOOZED);
                                app_control_add_extra_data(service, snoozedKey, CAL_APPALERT_IS_SNOOZED);
 
@@ -543,8 +487,7 @@ bool CalStatusBarManager::__setNotificationData(app_control_h service, std::shar
                }
 
                app_control_add_extra_data_array(service, CAL_APPCALSVC_PARAM_IDS, (const char**)ids, alertCount);
-               for (int i = 0; i < alertCount; i++)
-               {
+               for (int i = 0; i < alertCount; i++) {
                        g_free(ids[i]);
                }
                g_free(ids);
@@ -561,26 +504,20 @@ void CalStatusBarManager::__setNotificationTitle(notification_h notification, co
 
        int count = alertData->getCount();
        WDEBUG("Alerts count: %d", count);
-       if (count > 1)
-       {
+       if (count > 1) {
                WDEBUG("Multiple event");
-               for (int i = 0; i < count; i++)
-               {
+               for (int i = 0; i < count; i++) {
                        auto alertItem = alertData->getAt(i);
                        char *eventName = alertItem->getEventOriginalName();
                        WDEBUG("Event name: %s", eventName);
-                       if (eventName && *eventName)
-                       {
+                       if (eventName && *eventName) {
                                subTitle << eventName;
                                free(eventName);
-                       }
-                       else
-                       {
+                       } else {
                                subTitle << _L_("IDS_CLD_MBODY_MY_EVENT");
                        }
 
-                       if (i < count - 1)
-                       {
+                       if (i < count - 1) {
                                subTitle << ", ";
                        }
                }
@@ -591,9 +528,7 @@ void CalStatusBarManager::__setNotificationTitle(notification_h notification, co
 
                notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, title.str().c_str(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
                notification_set_text(notification, NOTIFICATION_TEXT_TYPE_CONTENT, subTitle.str().c_str(), NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
-       }
-       else if (count == 1)
-       {
+       } else if (count == 1) {
                WDEBUG("Single event");
                auto alertItem = alertData->getAt(0);
                char *eventName = alertItem->getEventOriginalName();
@@ -612,8 +547,7 @@ void CalStatusBarManager::__setNotificationTitle(notification_h notification, co
                subTitle << startTime;
 
                char * location = alertItem->getLocation();
-               if (*location)
-               {
+               if (*location) {
                        subTitle << ", ";
                        subTitle << location;
                }
@@ -624,9 +558,7 @@ void CalStatusBarManager::__setNotificationTitle(notification_h notification, co
 
                WDEBUG("Title: %s", title);
                WDEBUG("Sub-title: %s", subTitle.str().c_str());
-       }
-       else
-       {
+       } else {
                WERROR("No events!");
        }
 }
index a71d6ea..371360c 100755 (executable)
@@ -116,8 +116,7 @@ void CalEditApp::onTerminate()
 {
        CalTheme::finalize();
 
-       if(!__replyToRequest)
-       {
+       if(!__replyToRequest) {
                __replyError();
        }
 }
@@ -135,8 +134,7 @@ void CalEditApp::onAppControl(app_control_h request, bool firstLaunch)
        WDEBUG(" __editMode: %d", __editMode);
        CalNaviframe* frame = (CalNaviframe*)getWindow()->getBaseUiObject();
        CalEditView* view = new CalEditView(__schedule, __editMode,
-               [this](int newId)
-               {
+               [this](int newId) {
                        app_control_h reply;
                        app_control_create(&reply);
 
@@ -159,10 +157,8 @@ void CalEditApp::__makeScheduleForEditMode()
 {
        char *value = NULL;
        int ret = app_control_get_extra_data(__request, APP_CONTROL_DATA_ID, &value);
-       if (APP_CONTROL_ERROR_NONE != ret || !value || !strlen(value))
-       {
-               if(!__replyToRequest)
-               {
+       if (APP_CONTROL_ERROR_NONE != ret || !value || !strlen(value)) {
+               if(!__replyToRequest) {
                        __replyError();
                }
 
@@ -176,12 +172,10 @@ void CalEditApp::__makeScheduleForEditMode()
 
        free(value);
 
-       if(__schedule)
-       {
+       if(__schedule) {
                value = NULL;
                app_control_get_extra_data(__request, APP_CONTROL_DATA_CALENDAR_START_TIME, &value);
-               if (value)
-               {
+               if (value) {
                        struct tm startTm = {0};
                        strptime(value, "%Y-%m-%d %H:%M:%S", &startTm);
                        free(value);
@@ -191,8 +185,7 @@ void CalEditApp::__makeScheduleForEditMode()
 
                value = NULL;
                app_control_get_extra_data(__request, APP_CONTROL_DATA_CALENDAR_END_TIME, &value);
-               if (value)
-               {
+               if (value) {
                        struct tm endTm = {0};
                        strptime(value, "%Y-%m-%d %H:%M:%S", &endTm);
                        free(value);
@@ -202,10 +195,8 @@ void CalEditApp::__makeScheduleForEditMode()
 
                value = NULL;
                app_control_get_extra_data(__request, APP_CONTROL_DATA_CALENDAR_ALLDAY, &value);
-               if (value)
-               {
-                       if (!strcasecmp(value, "true") || !strcasecmp(value, "1"))
-                       {
+               if (value) {
+                       if (!strcasecmp(value, "true") || !strcasecmp(value, "1")) {
                                CalDateTime startTime, endTime;
                                __schedule->getStart(startTime);
                                __schedule->getEnd(endTime);
@@ -231,10 +222,8 @@ void CalEditApp::__makeScheduleForCreateMode()
        bool isAllDay = false;
        app_control_get_extra_data(__request, APP_CONTROL_DATA_CALENDAR_ALLDAY, &value);
        WDEBUG("all_day = %s", value);
-       if (value)
-       {
-               if (!strcasecmp(value, "true") || !strcasecmp(value, "1"))
-               {
+       if (value) {
+               if (!strcasecmp(value, "true") || !strcasecmp(value, "1")) {
                        isAllDay = true;
                }
 
@@ -244,16 +233,14 @@ void CalEditApp::__makeScheduleForCreateMode()
        value = NULL;
        app_control_get_extra_data(__request, APP_CONTROL_DATA_CALENDAR_START_TIME, &value);
        WDEBUG("%s", value);
-       if (value)
-       {
+       if (value) {
                WDEBUG("start_time = %s", value);
                struct tm startTm = {0};
                strptime(value, "%Y-%m-%d %H:%M:%S", &startTm);
                free(value);
                value = NULL;
                app_control_get_extra_data(__request, APP_CONTROL_DATA_CALENDAR_END_TIME, &value);
-               if (value)
-               {
+               if (value) {
                        WDEBUG("end_time = %s", value);
                        struct tm endTm = {0};
                        strptime(value, "%Y-%m-%d %H:%M:%S", &endTm);
@@ -262,24 +249,19 @@ void CalEditApp::__makeScheduleForCreateMode()
 
                        CalDateTime startDateTime(startTm);
                        CalDateTime endDateTime(endTm);
-                       if(isAllDay && endDateTime.isSameDay(startDateTime))
-                       {
+                       if(isAllDay && endDateTime.isSameDay(startDateTime)) {
                                // reset hours & minutes, if any
                                CalDateTime dateTemp = CalDateTime(startDateTime.getYear(), startDateTime.getMonth(), startDateTime.getMday(), 0, 0, 0);
                                startDateTime = dateTemp;
                                endDateTime = dateTemp;
                        }
                        __schedule =  CalSchedule::makeDefaultSchedule(startDateTime, endDateTime);
-               }
-               else
-               {
+               } else {
                        CalDateTime startDateTime(startTm);
                        startDateTime.setAllDay(isAllDay);
                        __schedule =  CalSchedule::makeDefaultSchedule(startDateTime);
                }
-       }
-       else
-       {
+       } else {
                __schedule = CalSchedule::makeDefaultSchedule(isAllDay);
        }
 
@@ -292,20 +274,16 @@ void CalEditApp::__makeScheduleFromExtraData()
 {
        char *value = NULL;
        int ret = app_control_get_operation(__request, &value);
-       if (APP_CONTROL_ERROR_NONE == ret && value && !strcmp(value, APP_CONTROL_OPERATION_EDIT))
-       {
+       if (APP_CONTROL_ERROR_NONE == ret && value && !strcmp(value, APP_CONTROL_OPERATION_EDIT)) {
                __editMode = CalEditView::EDIT_EXTERNAL;
        }
 
        free(value);
 
        WDEBUG("mode = %d", __editMode);
-       if(__editMode == CalEditView::EDIT_EXTERNAL)
-       {
+       if(__editMode == CalEditView::EDIT_EXTERNAL) {
                __makeScheduleForEditMode();
-       }
-       else
-       {
+       } else {
                __makeScheduleForCreateMode();
        }
 }
@@ -324,8 +302,7 @@ void CalEditApp::__addExtraParams()
        char *value = NULL;
        app_control_get_extra_data(__request, APP_CONTROL_DATA_TITLE, &value);
        WDEBUG("title = %s", value);
-       if (value && __schedule)
-       {
+       if (value && __schedule) {
                __schedule->setSummary(value);
        }
 
@@ -333,8 +310,7 @@ void CalEditApp::__addExtraParams()
        value = NULL;
        app_control_get_extra_data(__request, APP_CONTROL_DATA_TEXT, &value);
        WDEBUG("description = %s", value);
-       if (value && __schedule)
-       {
+       if (value && __schedule) {
                __schedule->setDescription(value);
        }
 
@@ -342,8 +318,7 @@ void CalEditApp::__addExtraParams()
        value = NULL;
        app_control_get_extra_data(__request, APP_CONTROL_DATA_LOCATION, &value);
        WDEBUG("location = %s", value);
-       if (value && __schedule)
-       {
+       if (value && __schedule) {
                __schedule->setLocation(value);
        }
 
index a6ba4a1..ba3ff35 100644 (file)
@@ -130,8 +130,7 @@ void CalPickApp::onAppControl(app_control_h request, bool firstLaunch)
        WPRET_M(ret != APP_CONTROL_ERROR_NONE, "Can't clone the request");
 
        ret = app_control_get_extra_data(__request, APP_CONTROL_DATA_SELECTION_MODE, &value);
-       if(APP_CONTROL_ERROR_NONE == ret && value && !strcasecmp(APP_CONTROL_DATA_SELECTION_MODE_MULTIPLE, value))
-       {
+       if(APP_CONTROL_ERROR_NONE == ret && value && !strcasecmp(APP_CONTROL_DATA_SELECTION_MODE_MULTIPLE, value)) {
                __mode = CalPickApp::SELECTION_MODE_MULTIPLE;
                __maxLimit = MULTI_SELECT_MAX;
        }
@@ -140,8 +139,7 @@ void CalPickApp::onAppControl(app_control_h request, bool firstLaunch)
        value = NULL;
 
        ret = app_control_get_extra_data(__request, APP_CONTROL_DATA_TOTAL_COUNT, &value);
-       if (APP_CONTROL_ERROR_NONE == ret && value)
-       {
+       if (APP_CONTROL_ERROR_NONE == ret && value) {
                __maxLimit = atoi(value);
        }
 
@@ -151,18 +149,12 @@ void CalPickApp::onAppControl(app_control_h request, bool firstLaunch)
        ret = app_control_get_extra_data(__request, APP_CONTROL_DATA_TYPE, &value);
        WDEBUG("Result type: %s", value);
 
-       if (APP_CONTROL_ERROR_NONE == ret && value)
-       {
-               if (!strcasecmp(APP_CONTROL_KEY_VCS, value))
-               {
+       if (APP_CONTROL_ERROR_NONE == ret && value) {
+               if (!strcasecmp(APP_CONTROL_KEY_VCS, value)) {
                        __resultType = CalPickView::RESULT_TYPE_VCS;
-               }
-               else if (!strcasecmp(APP_CONTROL_KEY_ID, value))
-               {
+               } else if (!strcasecmp(APP_CONTROL_KEY_ID, value)) {
                        __resultType = CalPickView::RESULT_TYPE_ID;
-               }
-               else
-               {
+               } else {
                        app_control_h reply;
                        app_control_create(&reply);
                        app_control_reply_to_launch_request(reply, __request, APP_CONTROL_RESULT_FAILED);
@@ -176,8 +168,7 @@ void CalPickApp::onAppControl(app_control_h request, bool firstLaunch)
        }
 
        ret = app_control_get_mime(__request, &value);
-       if (APP_CONTROL_ERROR_NONE == ret && value && !strcasecmp(APP_CONTROL_MIME_TEXT_CALENDAR, value))
-       {
+       if (APP_CONTROL_ERROR_NONE == ret && value && !strcasecmp(APP_CONTROL_MIME_TEXT_CALENDAR, value)) {
                __mimeType = CalPickApp::MIME_ICS;
        }
 
@@ -199,14 +190,12 @@ void CalPickApp::__processResult(const std::list<std::shared_ptr<CalSchedule>>&
 {
        WENTER();
 
-       if (__mode != CalPickApp::SELECTION_MODE_MULTIPLE && __mode != CalPickApp::SELECTION_MODE_SINGLE)
-       {
+       if (__mode != CalPickApp::SELECTION_MODE_MULTIPLE && __mode != CalPickApp::SELECTION_MODE_SINGLE) {
                WERROR("Unsupported mode : %d", __mode);
                return;
        }
 
-       if(schedules.size() <= 0)
-       {
+       if(schedules.size() <= 0) {
                WERROR("No events selected");
                elm_exit();
        }
@@ -218,24 +207,19 @@ void CalPickApp::__processResult(const std::list<std::shared_ptr<CalSchedule>>&
 
        char* filePath = NULL;
 
-       if (__resultType == CalPickView::RESULT_TYPE_VCS)
-       {
+       if (__resultType == CalPickView::RESULT_TYPE_VCS) {
                std::string fileTemplate = __mimeType == CalPickApp::MIME_ICS ? CAL_ICS_FILE_TEMPLATE : CAL_VCS_FILE_TEMPLATE;
                std::string pathFormat = CalPath::getPath(fileTemplate, CalPath::DATA);
 
-               for (auto it : schedules)
-               {
+               for (auto it : schedules) {
                        filePath = g_strdup_printf(pathFormat.c_str(), it->getIndex());
                        CalDataManager::getInstance().generateVcsFromSchedule(*it, filePath);
                        resultArray[resultIndex] = filePath;
                        WDEBUG("resultArray[%d] = %s", resultIndex, resultArray[resultIndex]);
                        resultIndex++;
                }
-       }
-       else if (__resultType == CalPickView::RESULT_TYPE_ID)
-       {
-               for (auto it : schedules)
-               {
+       } else if (__resultType == CalPickView::RESULT_TYPE_ID) {
+               for (auto it : schedules) {
                        resultArray[resultIndex] = g_strdup_printf("%d", it->getIndex());
                        WDEBUG("resultArray[%d] = %s", resultIndex, resultArray[resultIndex]);
                        resultIndex++;
@@ -249,8 +233,7 @@ void CalPickApp::__processResult(const std::list<std::shared_ptr<CalSchedule>>&
        __request = nullptr;
        app_control_destroy(reply);
 
-       for (int i = 0; i < resultIndex; i++)
-       {
+       for (int i = 0; i < resultIndex; i++) {
                g_free(resultArray[i]);
        }
 
index 8e262f4..dd2b44e 100644 (file)
@@ -66,32 +66,23 @@ void CalPickView::onPushed(Elm_Object_Item* naviItem)
        );
        elm_object_item_part_content_set(naviItem, "title_right_btn", button);
 
-       createList([this](std::shared_ptr<CalSchedule> schedule)
-               {
-                       if(__selectedScheduleSet.exists(schedule))
-                       {
+       createList([this](std::shared_ptr<CalSchedule> schedule) {
+                       if(__selectedScheduleSet.exists(schedule)) {
                                WHIT();
                                __selectedScheduleSet.remove(schedule);
-                       }
-                       else
-                       {
+                       } else {
                                WHIT();
                                __selectedScheduleSet.add(schedule);
                        }
                        this->__updateTitleInfo();
                }, true);
 
-       if(__maxLimit > 0)
-       {
-               __list->setMaxLimitSelectCb([this]()
-               {
+       if(__maxLimit > 0) {
+               __list->setMaxLimitSelectCb([this]() {
                        char warningText[CAL_WARNING_MAX_LENGTH] = {0};
-                       if (__resultType == CalPickView::RESULT_TYPE_TEXT || __resultType == CalPickView::RESULT_TYPE_ID)
-                       {
+                       if (__resultType == CalPickView::RESULT_TYPE_TEXT || __resultType == CalPickView::RESULT_TYPE_ID) {
                                snprintf(warningText, sizeof(warningText)-1, _L_("IDS_CLD_TPOP_MAXIMUM_NUMBER_OF_EVENTS_THAT_CAN_BE_INSERTED_HPD_REACHED"), __maxLimit);
-                       }
-                       else
-                       {
+                       } else {
                                snprintf(warningText, sizeof(warningText)-1, _L_("IDS_CLD_TPOP_MAXIMUM_NUMBER_OF_ATTACHMENTS_HPD_REACHED"), __maxLimit);
                        }
 
@@ -115,8 +106,7 @@ void CalPickView::onEvent(const CalEvent& event)
 {
        WENTER();
        WDEBUG("type = %u, source = %u", event.type, event.source);
-       switch (event.type)
-       {
+       switch (event.type) {
                case CalEvent::DB_CHANGED:
                case CalEvent::TIME_CHANGED:
                case CalEvent::LANGUAGE_CHANGED:
@@ -140,18 +130,14 @@ void CalPickView::__updateTitleInfo()
        int selectedItemCount = 0;
        selectedItemCount = __selectedScheduleSet.getCount();
 
-       if (__maxLimit > 0)
-       {
+       if (__maxLimit > 0) {
                snprintf(title, sizeof(title), "%d/%d", selectedItemCount, __maxLimit);
-       }
-       else
-       {
+       } else {
                snprintf(title, sizeof(title), _L_("IDS_CLD_HEADER_PD_SELECTED_ABB3"), selectedItemCount);
        }
 
        setTitle(title);
-       if (getNaviItem())
-       {
+       if (getNaviItem()) {
                elm_object_item_part_text_set(getNaviItem(), "elm.text.title", getTitle());
                Evas_Object* button = elm_object_item_part_content_get(getNaviItem(), "title_right_btn");
                elm_object_disabled_set(button, selectedItemCount > 0 ? EINA_FALSE : EINA_TRUE);
@@ -162,8 +148,7 @@ void CalPickView::__updateTitleInfo()
 void CalPickView::__reCheck()
 {
        WENTER();
-       if(__selectedScheduleSet.getCount() <= 0)
-       {
+       if(__selectedScheduleSet.getCount() <= 0) {
                return;
        }
 
@@ -171,8 +156,7 @@ void CalPickView::__reCheck()
        __selectedScheduleSet.getList(selectedScheduleList);
 
        auto it = selectedScheduleList.begin();
-       for( ; it != selectedScheduleList.end(); ++it)
-       {
+       for( ; it != selectedScheduleList.end(); ++it) {
                int eventId = (*it)->getIndex();
                CalDateTime startTime;
                (*it)->getStart(startTime);
index ecc1065..8b07846 100644 (file)
@@ -117,8 +117,7 @@ void CalViewApp::onTerminate()
 {
        CalTheme::finalize();
 
-       if(!__replyToRequest)
-       {
+       if(!__replyToRequest) {
                __replyError();
        }
 }
@@ -142,38 +141,30 @@ void CalViewApp::__makeSchedule()
 {
        CalNaviframe* frame = (CalNaviframe*)getWindow()->getBaseUiObject();
        const char* filePath = __getFilePath();
-       if (filePath)
-       {
+       if (filePath) {
                WDEBUG("URI = %s", filePath);
-               if (__isVtsFile(filePath))
-               {
+               if (__isVtsFile(filePath)) {
                        notification_status_message_post(_L_("IDS_CLD_TPOP_VTS_FILES_NOT_SUPPORTED"));
                }
 
                std::list<std::shared_ptr<CalSchedule>> schedules;
                CalDataManager::getInstance().getSchedulesFromVcs(filePath, schedules);
                int count = schedules.size();
-               if (count == 1)
-               {
+               if (count == 1) {
                        std::shared_ptr<CalSchedule> inputSchedule = *(schedules.begin());
                        frame->push(new CalDetailView(inputSchedule, CalDetailView::MENU_DISABLED, true));
-               }
-               else
-               {
+               } else {
                        frame->push(new CalVcsView(schedules));
                }
 
                __replyToRequest = true;
-       }
-       else
-       {
+       } else {
                WDEBUG("MIME") ;
                char *value = NULL;
                int ret = app_control_get_extra_data(__request, APP_CONTROL_DATA_ID, &value);
 
                WDEBUG("get %s [%s]", APP_CONTROL_DATA_ID, value);
-               if (APP_CONTROL_ERROR_NONE != ret || !value || !strlen(value))
-               {
+               if (APP_CONTROL_ERROR_NONE != ret || !value || !strlen(value)) {
                        free(value);
 
                        __replyError();
@@ -195,8 +186,7 @@ void CalViewApp::__makeSchedule()
 
 bool CalViewApp::__isVtsFile(const char* filePath)
 {
-       if (!filePath)
-       {
+       if (!filePath) {
                return false;
        }
        int len = strlen(filePath);
@@ -215,8 +205,7 @@ const char* CalViewApp::__getFilePath()
        free(__internalFilePath);
        __internalFilePath = NULL;
        int ret = app_control_get_uri(__request, &__internalFilePath);
-       if (ret != CALENDAR_ERROR_NONE || !__internalFilePath || !strlen(__internalFilePath))
-       {
+       if (ret != CALENDAR_ERROR_NONE || !__internalFilePath || !strlen(__internalFilePath)) {
                WERROR("app_control_get_uri failed : %d", ret);
                free(__internalFilePath);
                __internalFilePath = NULL;
@@ -226,8 +215,7 @@ const char* CalViewApp::__getFilePath()
 #define CAL_URI_FILE_FORMAT "file://"
 
        WDEBUG("vcs path = %s", __internalFilePath);
-       if (!strstr(__internalFilePath, CAL_URI_FILE_FORMAT))
-       {
+       if (!strstr(__internalFilePath, CAL_URI_FILE_FORMAT)) {
                return __internalFilePath;
        }
 
@@ -239,16 +227,14 @@ std::shared_ptr<CalSchedule> CalViewApp::__getScheduleFromExtraData(app_control_
        WENTER();
        char* value = NULL;
        app_control_get_extra_data(request, APP_CONTROL_DATA_ID, &value);
-       if (value && strlen(value))
-       {
+       if (value && strlen(value)) {
                int scheduleId = atoi(value);
                free(value);
                value = NULL;
 
                calendar_record_h record = NULL;
                int error = calendar_db_get_record(_calendar_event._uri, scheduleId, &record);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        WERROR("unable to find %d event", scheduleId);
                        return nullptr;
                }
index 8935c47..c30622b 100644 (file)
@@ -22,8 +22,7 @@ CalAppControlLauncher* CalAppControlLauncher::__instance = NULL;
 
 CalAppControlLauncher& CalAppControlLauncher::getInstance()
 {
-       if(__instance == NULL)
-       {
+       if(__instance == NULL) {
                __instance = new CalAppControlLauncher();
        }
 
@@ -54,8 +53,7 @@ bool CalAppControlLauncher::sendLaunchRequest(app_control_h request, app_control
 
        __appControl = request;
 
-       if (objToBlock)
-       {
+       if (objToBlock) {
                __evasObjBlocked = WEvasObject_getWeakPtr(objToBlock);
                auto p = __evasObjBlocked.lock();
 
@@ -66,8 +64,7 @@ bool CalAppControlLauncher::sendLaunchRequest(app_control_h request, app_control
        }
 
        int ret = app_control_send_launch_request(request, callback, userData);
-       if(ret != APP_CONTROL_ERROR_NONE)
-       {
+       if(ret != APP_CONTROL_ERROR_NONE) {
                WERROR("app_control return error code= %d", ret);
                app_control_destroy(__appControl);
                __appControl = NULL;
@@ -84,16 +81,14 @@ void CalAppControlLauncher::terminate()
 
 void CalAppControlLauncher::unblockUi()
 {
-       if(auto safeObj = __evasObjBlocked.lock())
-       {
+       if(auto safeObj = __evasObjBlocked.lock()) {
                Evas_Object* obj = safeObj->getEvasObj();
                evas_object_freeze_events_set(obj, EINA_FALSE);
                evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL, __evasObjDelCb, this);
                __evasObjBlocked.reset();
        }
 
-       if(__timer)
-       {
+       if(__timer) {
                ecore_timer_del(__timer);
                __timer = NULL;
        }
@@ -101,8 +96,7 @@ void CalAppControlLauncher::unblockUi()
 
 bool CalAppControlLauncher::isUiBlocked()
 {
-       if (auto safeObj = __evasObjBlocked.lock())
-       {
+       if (auto safeObj = __evasObjBlocked.lock()) {
                return true;
        }
 
@@ -115,8 +109,7 @@ Eina_Bool CalAppControlLauncher::__timeOutCb(void* userData)
 
        CalAppControlLauncher* p = (CalAppControlLauncher*)userData;
 
-       if( auto safeObj = p->__evasObjBlocked.lock() )
-       {
+       if( auto safeObj = p->__evasObjBlocked.lock() ) {
                Evas_Object* obj = safeObj->getEvasObj();
                evas_object_freeze_events_set(obj, EINA_FALSE);
                evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL, __evasObjDelCb, p);
@@ -130,8 +123,7 @@ Eina_Bool CalAppControlLauncher::__timeOutCb(void* userData)
 void CalAppControlLauncher::__evasObjDelCb(void *data, Evas *e, Evas_Object *obj, void *event_info)
 {
        CalAppControlLauncher* p = (CalAppControlLauncher*)data;
-       if ( p->__timer)
-       {
+       if ( p->__timer) {
                ecore_timer_del( p->__timer);
                p->__timer = NULL;
        }
@@ -139,12 +131,10 @@ void CalAppControlLauncher::__evasObjDelCb(void *data, Evas *e, Evas_Object *obj
 
 void CalAppControlLauncher::__clearAll()
 {
-       if( __appControl )
-       {
+       if( __appControl ) {
                WHIT();
                int ret = app_control_send_terminate_request( __appControl );
-               if( ret != APP_CONTROL_ERROR_NONE )
-               {
+               if( ret != APP_CONTROL_ERROR_NONE ) {
                        WWARNING("app_control ret error code= %d", ret);
                }
                app_control_destroy(__appControl);
index d3c5bd8..1855b22 100644 (file)
@@ -51,17 +51,13 @@ int CalDialogControl::Item::getSystemFontSize()
 {
        int fontSize = 0;
        Eina_Bool res = edje_text_class_get("list_item", NULL, &fontSize);
-       if (!res)
-       {
+       if (!res) {
                fontSize = TEXT_ITEM_DEFAULT_SIZE;
-       }
-       else if (fontSize < 0)
-       {
+       } else if (fontSize < 0) {
                fontSize = -fontSize * TEXT_ITEM_DEFAULT_SIZE / 100;
        }
 
-       if(fontSize > TEXT_MAX_GOOD_SIZE)
-       {
+       if(fontSize > TEXT_MAX_GOOD_SIZE) {
                fontSize = TEXT_MAX_GOOD_SIZE;
        }
 
@@ -110,8 +106,7 @@ Elm_Object_Item* CalDialogControl::add(CalDialogControl::Item* item)
        WPRET_VM((genlist == NULL),NULL,"get fail");
 
        objectItem = elm_genlist_item_append(genlist, item->getItemClassStatic(), item, NULL, ELM_GENLIST_ITEM_NONE,
-                       [](void *data, Evas_Object *obj, void *event_info)
-                       {
+                       [](void *data, Evas_Object *obj, void *event_info) {
                                Elm_Object_Item* genlistItem = (Elm_Object_Item*) event_info;
                                elm_genlist_item_selected_set(genlistItem, EINA_FALSE);
                                CalDialogControl::Item* item = (CalDialogControl::Item*)data;
index 6d08d68..37d5bc5 100644 (file)
@@ -51,13 +51,11 @@ void CalDragRecognizer::onMove(Evas_Object* obj, Evas_Event_Mouse_Move* eventInf
        const int dy = currentPoint.y - __pressedPoint.y;
        WDEBUG("%x (%d, %d) (%d, %d)", this, currentPoint.x, currentPoint.y, dx, dy);
 
-       if (!__isValidDrag && (abs(dx) > THRESHOLD || abs(dy) > THRESHOLD) && claimThisTouchToBeMine())
-       {
+       if (!__isValidDrag && (abs(dx) > THRESHOLD || abs(dy) > THRESHOLD) && claimThisTouchToBeMine()) {
                __isValidDrag = true;
        }
 
-       if (__isValidDrag)
-       {
+       if (__isValidDrag) {
                __onDragged(dx, dy);
        }
 }
index 157053f..bc8f2a0 100644 (file)
@@ -42,8 +42,7 @@ CalEvent::CalEvent(const CalEvent& obj)
 
 const CalEvent& CalEvent::operator=(const CalEvent& obj)
 {
-       if (this != &obj)
-       {
+       if (this != &obj) {
                type = obj.type;
                source = obj.source;
        }
index 22fc366..e4e4f5c 100644 (file)
@@ -60,8 +60,7 @@ void CalEventManager::detach(ICalEventListener* listener)
        WENTER();
        WDEBUG("%p", listener);
        auto finder = __listenerMap.find(listener);
-       if (finder == __listenerMap.end())
-       {
+       if (finder == __listenerMap.end()) {
                WDEBUG("null");
                return;
        }
@@ -78,8 +77,7 @@ void CalEventManager::block(ICalEventListener* listener)
        WENTER();
        WDEBUG("%p", listener);
        auto finder = __listenerMap.find(listener);
-       if (finder == __listenerMap.end())
-       {
+       if (finder == __listenerMap.end()) {
                WDEBUG("null");
                return;
        }
@@ -92,8 +90,7 @@ void CalEventManager::unblock(ICalEventListener* listener)
        WENTER();
        WDEBUG("%p", listener);
        auto finder = __listenerMap.find(listener);
-       if (finder == __listenerMap.end())
-       {
+       if (finder == __listenerMap.end()) {
                WDEBUG("null");
                return;
        }
@@ -105,10 +102,8 @@ void CalEventManager::unblock(ICalEventListener* listener)
 void CalEventManager::notify(const CalEvent& event)
 {
        WENTER();
-       if (__isSuspended)
-       {
-               for (auto it = __listenerMap.begin(); it != __listenerMap.end();)
-               {
+       if (__isSuspended) {
+               for (auto it = __listenerMap.begin(); it != __listenerMap.end();) {
                        auto node = it->second;
                        it++;
                        __addtoEventTable(node, event);
@@ -117,38 +112,27 @@ void CalEventManager::notify(const CalEvent& event)
                return;
        }
 
-       for (auto it = __listenerMap.begin(); it != __listenerMap.end(); ++it)
-       {
+       for (auto it = __listenerMap.begin(); it != __listenerMap.end(); ++it) {
                auto node = it->second;
-               if (node->isBlocked)
-               {
+               if (node->isBlocked) {
                        WDEBUG("node->isBlocked");
                        __addtoEventTable(node, event);
-               }
-               else
-               {
-                       if (event.source == CalEvent::REMOTE)
-                       {
+               } else {
+                       if (event.source == CalEvent::REMOTE) {
                                int timeout = __getTimeoutForTimerForPendingEvents();
                                WDEBUG("an event from a remote one, timeout = %d", timeout);
-                               if (timeout == 0)
-                               {
+                               if (timeout == 0) {
                                        node->listener->onEvent(event);
-                               }
-                               else
-                               {
+                               } else {
                                        __addtoEventTable(node, event);
                                }
-                       }
-                       else
-                       {
+                       } else {
                                node->listener->onEvent(event);
                        }
                }
        }
 
-       if (event.source == CalEvent::REMOTE)
-       {
+       if (event.source == CalEvent::REMOTE) {
                __addTimerForPendingEvents();
        }
 
@@ -157,8 +141,7 @@ void CalEventManager::notify(const CalEvent& event)
 
 void CalEventManager::clear()
 {
-       for (auto it = __listenerMap.begin(); it != __listenerMap.end(); ++it)
-       {
+       for (auto it = __listenerMap.begin(); it != __listenerMap.end(); ++it) {
                auto node = it->second;
                auto first = it->first;
 
@@ -170,10 +153,8 @@ void CalEventManager::clear()
 void CalEventManager::__resetEventTable(ListenerNode* node)
 {
        // reset the event table
-       for (int i = 1; i < CalEvent::TYPE_MAX; i++)
-       {
-               for (int j = 0; j < CalEvent::SOURCE_MAX; j++)
-               {
+       for (int i = 1; i < CalEvent::TYPE_MAX; i++) {
+               for (int j = 0; j < CalEvent::SOURCE_MAX; j++) {
                        node->eventTable[i][j] = NULL;
                }
        }
@@ -182,8 +163,7 @@ void CalEventManager::__resetEventTable(ListenerNode* node)
 void CalEventManager::__addtoEventTable(ListenerNode* node, const CalEvent& event)
 {
        // add it to the event table
-       if (node->eventTable[event.type][event.source])
-       {
+       if (node->eventTable[event.type][event.source]) {
                delete node->eventTable[event.type][event.source];
        }
 
@@ -193,18 +173,14 @@ void CalEventManager::__addtoEventTable(ListenerNode* node, const CalEvent& even
 void CalEventManager::__notifyFromEventTable(ListenerNode* node)
 {
        // notify events from the event table
-       for (int i = 1; i < CalEvent::TYPE_MAX; i++)
-       {
-               for (int j = 0; j < CalEvent::SOURCE_MAX; j++)
-               {
-                       if (node->eventTable[i][j])
-                       {
+       for (int i = 1; i < CalEvent::TYPE_MAX; i++) {
+               for (int j = 0; j < CalEvent::SOURCE_MAX; j++) {
+                       if (node->eventTable[i][j]) {
                                ICalEventListener* listener = node->listener;
                                node->listener->onEvent(*(node->eventTable[i][j]));
 
                                auto finder = __listenerMap.find(listener);
-                               if (finder == __listenerMap.end())
-                               {
+                               if (finder == __listenerMap.end()) {
                                        WDEBUG("null");
                                        return;
                                }
@@ -219,16 +195,13 @@ void CalEventManager::__notifyFromEventTable(ListenerNode* node)
 void CalEventManager::__notifyFromEventTable(ListenerNode* node, CalEvent::Source source)
 {
        // notify events from the event table
-       for (int i = 1; i < CalEvent::TYPE_MAX; i++)
-       {
-               if (node->eventTable[i][source])
-               {
+       for (int i = 1; i < CalEvent::TYPE_MAX; i++) {
+               if (node->eventTable[i][source]) {
                        ICalEventListener* listener = node->listener;
                        node->listener->onEvent(*(node->eventTable[i][source]));
 
                        auto finder = __listenerMap.find(listener);
-                       if (finder == __listenerMap.end())
-                       {
+                       if (finder == __listenerMap.end()) {
                                WDEBUG("null");
                                return;
                        }
@@ -242,12 +215,9 @@ void CalEventManager::__notifyFromEventTable(ListenerNode* node, CalEvent::Sourc
 void CalEventManager::__clearEventTable(ListenerNode* node)
 {
        // clear the event table
-       for (int i = 1; i < CalEvent::TYPE_MAX; i++)
-       {
-               for (int j = 0; j < CalEvent::SOURCE_MAX; j++)
-               {
-                       if (node->eventTable[i][j])
-                       {
+       for (int i = 1; i < CalEvent::TYPE_MAX; i++) {
+               for (int j = 0; j < CalEvent::SOURCE_MAX; j++) {
+                       if (node->eventTable[i][j]) {
                                delete node->eventTable[i][j];
                                node->eventTable[i][j] = NULL;
                        }
@@ -258,28 +228,21 @@ void CalEventManager::__clearEventTable(ListenerNode* node)
 void CalEventManager::__processTimerForPendingEvents()
 {
        WENTER();
-       for (auto it = __listenerMap.begin(); it != __listenerMap.end(); ++it)
-       {
+       for (auto it = __listenerMap.begin(); it != __listenerMap.end(); ++it) {
                auto node = it->second;
-               if (node->isBlocked)
-               {
+               if (node->isBlocked) {
                        WDEBUG("node->isBlocked");
                        continue;
-               }
-               else
-               {
+               } else {
                        __notifyFromEventTable(node, CalEvent::REMOTE);
                }
        }
 
        __timerForPeindingEvents = NULL;
 
-       if (__pendingEvents)
-       {
+       if (__pendingEvents) {
                __addTimerForPendingEvents();
-       }
-       else
-       {
+       } else {
                WDEBUG("expired");
                __resetTimeoutForTimerForPendingEvents();
        }
@@ -288,8 +251,7 @@ void CalEventManager::__processTimerForPendingEvents()
 void CalEventManager::__addTimerForPendingEvents()
 {
        WENTER();
-       if (__timerForPeindingEvents)
-       {
+       if (__timerForPeindingEvents) {
                //a request before timed out, just set the flag
                __pendingEvents = true;
                return;
@@ -308,8 +270,7 @@ void CalEventManager::__addTimerForPendingEvents()
 void CalEventManager::__removeTimerForPendingEvents()
 {
        WENTER();
-       if (__timerForPeindingEvents)
-       {
+       if (__timerForPeindingEvents) {
                ecore_timer_del(__timerForPeindingEvents);
        }
 
@@ -328,18 +289,12 @@ void CalEventManager::__updateTimeoutForTimerForPendingEvents()
 {
        WENTER();
        // check if there is any request before timed out, if it's true, update the next timeout for update (x2)
-       if (__timeout == 0)
-       {
+       if (__timeout == 0) {
                __timeout = 2;
-       }
-       else
-       {
-               if (__timeout >= __timeoutMax)
-               {
+       } else {
+               if (__timeout >= __timeoutMax) {
                        __timeout = __timeoutMax;
-               }
-               else
-               {
+               } else {
                        __timeout *= 2;
                }
        }
@@ -369,17 +324,13 @@ void CalEventManager::resume()
        WENTER();
        __isSuspended = false;
 
-       for (auto it = __listenerMap.begin(); it != __listenerMap.end();)
-       {
+       for (auto it = __listenerMap.begin(); it != __listenerMap.end();) {
                auto node = it->second;
                it++;
-               if (node->isBlocked)
-               {
+               if (node->isBlocked) {
                        WDEBUG("node->isBlocked");
                        continue;
-               }
-               else
-               {
+               } else {
                        __notifyFromEventTable(node);
                }
        }
@@ -389,8 +340,7 @@ bool CalEventManager::isDetached(ICalEventListener* listener)
 {
        WENTER();
        auto finder = __listenerMap.find(listener);
-       if (finder == __listenerMap.end())
-       {
+       if (finder == __listenerMap.end()) {
                return true;
        }
 
index a82d570..991990b 100644 (file)
@@ -41,8 +41,7 @@ bool CalNaviframe::onPush(WView* view, void* viewParam)
        WENTER();
        CalEventManager::getInstance().attach((CalView*)view);
        Elm_Object_Item* item = elm_naviframe_top_item_get(getEvasObj());
-       if (item)
-       {
+       if (item) {
                CalView* targetView = (CalView*)WView_getInstanceFromEvasObj(
                                elm_object_item_part_content_get(item, "elm.swallow.content"));
 
@@ -58,8 +57,7 @@ bool CalNaviframe::onItemPop(WView* view, Elm_Object_Item* item)
 {
        WENTER();
        bool ret = WNaviframe::onItemPop(view, item);
-       if (!ret)
-       {
+       if (!ret) {
                return false;
        }
 
@@ -75,14 +73,11 @@ void CalNaviframe::__arrangeEventManager(WView* view, Elm_Object_Item* item)
        {
                CalEventManager::getInstance().detach((CalView*)view);
                Eina_List* itemList = elm_naviframe_items_get(getEvasObj());
-               if (itemList)
-               {
+               if (itemList) {
                        int nth = eina_list_count(itemList) - 2;
-                       if (nth >= 0)
-                       {
+                       if (nth >= 0) {
                                Elm_Object_Item* tempItem = (Elm_Object_Item*)eina_list_nth(itemList, nth);
-                               if (tempItem)
-                               {
+                               if (tempItem) {
                                        CalView* targetView = (CalView*)WView_getInstanceFromEvasObj(
                                                        elm_object_item_part_content_get(tempItem, "elm.swallow.content"));
                                        WASSERT(targetView);
@@ -99,8 +94,7 @@ void CalNaviframe::destroyView(WView* view, Elm_Object_Item* item)
 {
        WENTER();
 
-       if (!CalEventManager::getInstance().isDetached((CalView*)view))
-       {
+       if (!CalEventManager::getInstance().isDetached((CalView*)view)) {
                __arrangeEventManager(view, item);
        }
 
index b6d86ec..f4e3996 100644 (file)
@@ -29,8 +29,7 @@ CalPath::CalPath()
 const std::string &CalPath::getEdjeDir()
 {
        static std::string edjeDir;
-       if(edjeDir.empty())
-       {
+       if(edjeDir.empty()) {
                edjeDir = getResourceDir();
                edjeDir.append(CAL_EDJE_DIR);
        }
@@ -40,8 +39,7 @@ const std::string &CalPath::getEdjeDir()
 const std::string &CalPath::getSharedResourceDir()
 {
        static std::string sharedResDir;
-       if(sharedResDir.empty())
-       {
+       if(sharedResDir.empty()) {
                char *sharedPath = app_get_shared_resource_path();
                sharedResDir = sharedPath;
                free(sharedPath);
@@ -52,8 +50,7 @@ const std::string &CalPath::getSharedResourceDir()
 const std::string &CalPath::getLocaleDir()
 {
        static std::string localeDir;
-       if(localeDir.empty())
-       {
+       if(localeDir.empty()) {
                localeDir = getResourceDir();
                localeDir.append(CAL_LOCALE_DIR);
        }
@@ -63,8 +60,7 @@ const std::string &CalPath::getLocaleDir()
 const std::string &CalPath::getThemeDir()
 {
        static std::string themeDir;
-       if(themeDir.empty())
-       {
+       if(themeDir.empty()) {
                themeDir = getEdjeDir();
                themeDir.append(CAL_THEME_DIR);
        }
@@ -74,8 +70,7 @@ const std::string &CalPath::getThemeDir()
 const std::string &CalPath::getImageDir()
 {
        static std::string imageDir;
-       if(imageDir.empty())
-       {
+       if(imageDir.empty()) {
                imageDir = getResourceDir();
                imageDir.append(CAL_IMAGE_DIR);
        }
@@ -85,8 +80,7 @@ const std::string &CalPath::getImageDir()
 const std::string &CalPath::getDataDir()
 {
        static std::string dataDir;
-       if(dataDir.empty())
-       {
+       if(dataDir.empty()) {
                char *dataPath = app_get_data_path();
                dataDir = dataPath;
                free(dataPath);
@@ -97,8 +91,7 @@ const std::string &CalPath::getDataDir()
 const std::string &CalPath::getResourceDir()
 {
        static std::string resourceDir;
-       if(resourceDir.empty())
-       {
+       if(resourceDir.empty()) {
 #ifdef CAL_DIR
                resourceDir = CAL_DIR "/res/";
 #else
index 3e9e273..87504e9 100644 (file)
@@ -40,15 +40,13 @@ CalSlideAnimator::CalSlideAnimator(Evas_Object* obj, std::function<void (int dir
 
 CalSlideAnimator::~CalSlideAnimator()
 {
-       if(__mAnimator)
-       {
+       if(__mAnimator) {
                ecore_animator_del(__mAnimator);
        }
 
        __mAnimator = NULL;
 
-       if(__timer)
-       {
+       if(__timer) {
                ecore_timer_del(__timer);
        }
 
@@ -69,8 +67,7 @@ void CalSlideAnimator::begin(Mode mode, Evas_Coord min, Evas_Coord max)
        __max = max;
        __dir = 0;
        evas_object_geometry_get(__obj, RECT_REF(__origin));
-       for (auto it = __sidekicks.begin(); it != __sidekicks.end(); it++)
-       {
+       for (auto it = __sidekicks.begin(); it != __sidekicks.end(); it++) {
                Evas_Coord_Rectangle rect;
                evas_object_geometry_get(it->obj, RECT_REF(rect));
                it->offset.x = rect.x - __origin.x;
@@ -81,12 +78,9 @@ void CalSlideAnimator::begin(Mode mode, Evas_Coord min, Evas_Coord max)
 
 void CalSlideAnimator::update(Evas_Coord delta)
 {
-       if (delta < __min)
-       {
+       if (delta < __min) {
                delta = __min;
-       }
-       else if (delta > __max)
-       {
+       } else if (delta > __max) {
                delta = __max;
        }
 
@@ -95,8 +89,7 @@ void CalSlideAnimator::update(Evas_Coord delta)
 
 void CalSlideAnimator::__update(Evas_Object* obj, const Evas_Coord_Rectangle& origin, Evas_Coord delta)
 {
-       switch (__mode)
-       {
+       switch (__mode) {
                case VERTICAL_MOVE:
                        evas_object_move(obj, origin.x, origin.y + delta);
                        break;
@@ -113,8 +106,7 @@ void CalSlideAnimator::__update(Evas_Object* obj, const Evas_Coord_Rectangle& or
                        break;
        }
 
-       for (auto it = __sidekicks.begin(); it != __sidekicks.end(); it++)
-       {
+       for (auto it = __sidekicks.begin(); it != __sidekicks.end(); it++) {
                evas_object_move(it->obj, origin.x + it->offset.x, origin.y + delta + it->offset.y);
        }
 }
@@ -125,16 +117,11 @@ void CalSlideAnimator::finish(int dir, bool noAnimation)
 
        __dir = dir;
 
-       if (noAnimation)
-       {
+       if (noAnimation) {
                __finalize();
-       }
-       else if (__dir < 0)
-       {
+       } else if (__dir < 0) {
                __slide(__min + __origin.y);
-       }
-       else
-       {
+       } else {
                __slide(__max + __origin.y);
        }
 }
@@ -143,12 +130,9 @@ void CalSlideAnimator::cancel(bool noAnimation)
 {
        WASSERT(__dir == 0);
 
-       if (noAnimation)
-       {
+       if (noAnimation) {
                __finalize();
-       }
-       else
-       {
+       } else {
                __slide(__origin.y);
        }
 }
@@ -166,8 +150,7 @@ void CalSlideAnimator::__slide(Evas_Coord target)
        const double remainingRatio = double(__target - __start.y) / __target;
        WDEBUG("%d %d %f", __start.y, target, remainingRatio);
 
-       if(__mAnimator)
-       {
+       if(__mAnimator) {
                ecore_animator_del(__mAnimator);
        }
 
@@ -188,19 +171,15 @@ void CalSlideAnimator::__slide(Evas_Coord target)
 
 bool CalSlideAnimator::__tween(double pos)
 {
-       if (pos < 1.0)
-       {
+       if (pos < 1.0) {
                double map = ecore_animator_pos_map(pos, ECORE_POS_MAP_LINEAR, 0, 0);
                __update(__obj, __start, map * (__target - __start.y));
 
                return true;
-       }
-       else
-       {
+       } else {
                __update(__obj, __start, (__target - __start.y));
 
-               if(__timer)
-               {
+               if(__timer) {
                        ecore_timer_del(__timer);
                }
 
@@ -217,8 +196,7 @@ bool CalSlideAnimator::__tween(double pos)
 
 void CalSlideAnimator::__finalize()
 {
-       if (__slideFinishedCb)
-       {
+       if (__slideFinishedCb) {
                __slideFinishedCb(__dir);
        }
        evas_object_freeze_events_set(__obj, EINA_FALSE);
index 238a191..ae0c451 100644 (file)
@@ -40,23 +40,19 @@ void CalTapRecognizer::onMove(Evas_Object* obj, Evas_Event_Mouse_Move* eventInfo
 
 void CalTapRecognizer::onRelease(Evas_Object* obj, Evas_Event_Mouse_Up* eventInfo)
 {
-       if ((eventInfo->event_flags & EVAS_EVENT_FLAG_ON_HOLD) == EVAS_EVENT_FLAG_ON_HOLD)
-       {
+       if ((eventInfo->event_flags & EVAS_EVENT_FLAG_ON_HOLD) == EVAS_EVENT_FLAG_ON_HOLD) {
                /**
                 * @note
                 * Do not process the TAP event in this case.
                 */
                WDEBUG("On Hold triggered");
-       }
-       else
-       {
+       } else {
                const Evas_Coord_Point& currentPoint = eventInfo->canvas;
                const int dx = currentPoint.x - __pressedPoint.x;
                const int dy = currentPoint.y - __pressedPoint.y;
 
                WDEBUG("(%d, %d) (%d, %d)", currentPoint.x, currentPoint.y, dx, dy);
-               if (claimThisTouchToBeMine())
-               {
+               if (claimThisTouchToBeMine()) {
                        __onTap(obj);
                }
        }
index b7373ee..e0b776f 100644 (file)
@@ -46,8 +46,7 @@ void CalTouchInputRecognizer::removeTarget(Evas_Object* obj)
 
 void CalTouchInputRecognizer::terminate(Evas_Object* obj)
 {
-       if(obj)
-       {
+       if(obj) {
                __waitPress(obj);
        }
 }
@@ -65,15 +64,13 @@ void CalTouchInputRecognizer::unblock()
 void CalTouchInputRecognizer::__onPress(void* data, Evas* evas, Evas_Object* obj, void* event_info)
 {
        CalTouchInputRecognizer* self = (CalTouchInputRecognizer*)data;
-       if (self->__blocked)
-       {
+       if (self->__blocked) {
                WDEBUG("blocked");
                return;
        }
 
        Evas_Event_Mouse_Down* ev = (Evas_Event_Mouse_Down*)event_info;
-       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
-       {
+       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) {
                WDEBUG("EVAS_EVENT_FLAG_ON_HOLD");
                return;
        }
@@ -87,21 +84,18 @@ void CalTouchInputRecognizer::__onPress(void* data, Evas* evas, Evas_Object* obj
 void CalTouchInputRecognizer::__onMove(void* data, Evas* evas, Evas_Object* obj, void* event_info)
 {
        CalTouchInputRecognizer* self = (CalTouchInputRecognizer*)data;
-       if (self->__blocked)
-       {
+       if (self->__blocked) {
                WDEBUG("blocked");
                return;
        }
 
        Evas_Event_Mouse_Move* ev = (Evas_Event_Mouse_Move*)event_info;
-       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
-       {
+       if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) {
                WDEBUG("EVAS_EVENT_FLAG_ON_HOLD");
                return;
        }
 
-       if (self->thisTouchIsFreeOrMine())
-       {
+       if (self->thisTouchIsFreeOrMine()) {
                self->onMove(obj, ev);
        }
 }
@@ -109,8 +103,7 @@ void CalTouchInputRecognizer::__onMove(void* data, Evas* evas, Evas_Object* obj,
 void CalTouchInputRecognizer::__onRelease(void* data, Evas* evas, Evas_Object* obj, void* event_info)
 {
        CalTouchInputRecognizer* self = (CalTouchInputRecognizer*)data;
-       if (self->__blocked)
-       {
+       if (self->__blocked) {
                WDEBUG("blocked");
                self->__waitPress(obj);
                return;
@@ -145,8 +138,7 @@ bool CalTouchInputRecognizer::thisTouchIsFreeOrMine()
 
 bool CalTouchInputRecognizer::claimThisTouchToBeMine()
 {
-       if (!thisTouchIsFreeOrMine())
-       {
+       if (!thisTouchIsFreeOrMine()) {
                return false;
        }
 
index ae6c7fb..e74f035 100644 (file)
@@ -26,8 +26,7 @@ CalView::CalView(const char* name) : WView(name)
 CalView::~CalView()
 {
        CalNaviframe *naviframe = static_cast<CalNaviframe *>(getNaviframe());
-       if(naviframe)
-       {
+       if(naviframe) {
                naviframe->destroyView(this, getNaviItem());
        }
 }
@@ -49,8 +48,7 @@ void CalView::onEvent(const CalEvent& event)
 Evas_Object* CalView::__createMenuBtn(Evas_Object* parent, Evas_Smart_Cb func, void* data)
 {
        Evas_Object* btn = elm_button_add(parent);
-       if (!btn)
-       {
+       if (!btn) {
                return NULL;
        }
 
index 8ec2ca1..1333c48 100644 (file)
@@ -32,8 +32,7 @@ CalWorker::~CalWorker()
 void CalWorker::wait()
 {
        WENTER();
-       if (__workerThread)
-       {
+       if (__workerThread) {
                g_thread_join(__workerThread);
                __workerThread = NULL;
        }
index 6fb4b9c..5c485d7 100644 (file)
@@ -54,8 +54,7 @@ CalBook::CalBook(const cal_book_h book)
 
 const CalBook& CalBook::operator=(const CalBook& obj)
 {
-       if (this != &obj)
-       {
+       if (this != &obj) {
                this->destroyBook();
                return *(obj.cloneBook());
        }
@@ -71,8 +70,7 @@ CalBook* CalBook::cloneBook() const
 void CalBook::destroyBook()
 {
        cal_book_s *lbook = (cal_book_s*) __book;
-       if (lbook)
-       {
+       if (lbook) {
                calendar_record_destroy(*lbook, true);
                free(lbook);
        }
@@ -335,8 +333,7 @@ void CalBook::setMode(int mode)
 
 bool CalBook::isReadOnly() const
 {
-       if (getMode() != CALENDAR_BOOK_MODE_NONE || getIndex() == DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID)
-       {
+       if (getMode() != CALENDAR_BOOK_MODE_NONE || getIndex() == DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID) {
                return true;
        }
 
index d0cf1cb..0aa6bca 100644 (file)
@@ -72,8 +72,7 @@ std::shared_ptr<CalBook> CalBookManager::getBook(int index)
 {
        WENTER();
        auto finder = __bookMap.find(index);
-       if (finder == __bookMap.end())
-       {
+       if (finder == __bookMap.end()) {
                WDEBUG("null");
                return nullptr;
        }
@@ -130,48 +129,39 @@ void CalBookManager::__addLocalBooks(std::map<int, std::shared_ptr<CalBook>>& bo
        calendar_query_h query = NULL;
        calendar_list_h list = NULL;
        int account_id = _CALENDAR_LOCAL_ACCOUNT_ID;
-       do
-       {
+       do {
                error = calendar_query_create(_calendar_book._uri, &query);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
 
-               if (account_id != _CALENDAR_ALL_ACCOUNT_ID)
-               {
+               if (account_id != _CALENDAR_ALL_ACCOUNT_ID) {
                        error = calendar_filter_create(_calendar_book._uri, &filter);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                        error = calendar_filter_add_int(filter, _calendar_book.account_id, CALENDAR_MATCH_EQUAL, account_id);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                        error = calendar_query_set_filter(query, filter);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                }
 
                error = calendar_db_get_records_with_query(query, 0, 0, &list);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
        }
        while(0);
 
-       if (filter)
-       {
+       if (filter) {
                calendar_filter_destroy(filter);
        }
 
-       if (query)
-       {
+       if (query) {
                calendar_query_destroy(query);
        }
 
@@ -181,12 +171,10 @@ void CalBookManager::__addLocalBooks(std::map<int, std::shared_ptr<CalBook>>& bo
        calendar_list_get_count(list, &count);
 
        calendar_record_h record = NULL;
-       for (int i = 0; i < count; ++i)
-       {
+       for (int i = 0; i < count; ++i) {
                calendar_list_get_current_record_p(list, &record);
                std::shared_ptr<CalBook> instance(new CalBook((cal_book_h) &record));
-               if (instance->getStoreType() != CALENDAR_BOOK_TYPE_TODO)
-               {
+               if (instance->getStoreType() != CALENDAR_BOOK_TYPE_TODO) {
                        bookMap.insert(std::pair<int, std::shared_ptr<CalBook>>(instance->getIndex(), instance));
                }
                calendar_list_next(list);
@@ -215,13 +203,11 @@ void CalBookManager::__fillColorlessBook(std::map<int, std::shared_ptr<CalBook>>
 
        cal_book_color_s color = {0};
        std::vector<int> ids;
-       for (auto it = bookMap.begin(); it != bookMap.end(); ++it)
-       {
+       for (auto it = bookMap.begin(); it != bookMap.end(); ++it) {
                auto instance = it->second;
 
                instance->getColor(color.r, color.g, color.b, color.a);
-               if (color.r < 0 || color.g < 0 || color.b < 0 || color.a < 0)
-               {
+               if (color.r < 0 || color.g < 0 || color.b < 0 || color.a < 0) {
                        int id = instance->getIndex();
                        WDEBUG("need to set a color for a book(id = %d)", id);
                        color = __books_default_rgb_color[id % COLOR_ARRAY_LENTH];
@@ -231,11 +217,9 @@ void CalBookManager::__fillColorlessBook(std::map<int, std::shared_ptr<CalBook>>
                }
        }
 
-       for (auto it = ids.begin(); it != ids.end(); ++it)
-       {
+       for (auto it = ids.begin(); it != ids.end(); ++it) {
                        auto entity = bookMap.find(*it);
-                       if (entity != bookMap.end())
-                       {
+                       if (entity != bookMap.end()) {
                                std::shared_ptr<CalBook> instance = entity->second;
                                bookMap.erase(*it);
                                std::shared_ptr<CalBook> instanceNew(new CalBook(*instance));
index 765e6a6..57c16e4 100644 (file)
@@ -35,8 +35,7 @@ void CalComplexListProvider::prefetch(bool fillBothBuffers)
 {
        WDEBUG("[%d%d]", __dir, __allDay);
        __fetcher.prefetch(fillBothBuffers);
-       if (!__currentSchedule)
-       {
+       if (!__currentSchedule) {
                loadNext();
        }
 }
@@ -53,12 +52,10 @@ const CalDate& CalComplexListProvider::getCurrentDate()
 
 void CalComplexListProvider::loadNext()
 {
-       if (__list.size() == 0 || __iter == __list.end())
-       {
+       if (__list.size() == 0 || __iter == __list.end()) {
                __deleteFinishedFromList();
                __updateCurrentDateAndFillList();
-               if (__list.size() == 0)
-               {
+               if (__list.size() == 0) {
                        __currentSchedule = NULL;
                        return;
                }
@@ -73,15 +70,11 @@ void CalComplexListProvider::loadNext()
 
 void CalComplexListProvider::__deleteFinishedFromList()
 {
-       for (auto it = __list.begin(); it != __list.end();)
-       {
+       for (auto it = __list.begin(); it != __list.end();) {
                WASSERT((*it).__remainingDays >= 0);
-               if ((*it).__remainingDays == 0)
-               {
+               if ((*it).__remainingDays == 0) {
                        it = __list.erase(it);
-               }
-               else
-               {
+               } else {
                        ++it;
                }
        }
@@ -91,27 +84,21 @@ void CalComplexListProvider::__updateCurrentDateAndFillList()
 {
        WDEBUG("[%d%d] %s %d", __dir, __allDay, __currentDate.dump().c_str(), __list.size());
 
-       if (!__pending)
-       {
+       if (!__pending) {
                __pending = __getNextScheduleFromDbList(__pendingDate);
        }
 
-       if (__list.size() > 0 || !__pending)
-       {
+       if (__list.size() > 0 || !__pending) {
                __currentDate.addDays(__dir > 0 ? 1 : -1);
-       }
-       else
-       {
+       } else {
                __currentDate = __pendingDate;
        }
 
-       while (__pending && __pendingDate == __currentDate)
-       {
+       while (__pending && __pendingDate == __currentDate) {
                const int duration = __getDuration(*__pending);
                WASSERT(duration >= 0);
                WDEBUG("%d", duration);
-               if (duration > 0)
-               {
+               if (duration > 0) {
                        __list.push_back(Occupant(__pending, duration));
                }
                __pending = __getNextScheduleFromDbList(__pendingDate);
@@ -123,8 +110,7 @@ void CalComplexListProvider::__updateCurrentDateAndFillList()
 std::shared_ptr<CalInstanceSchedule> CalComplexListProvider::__getNextScheduleFromDbList(CalDate& date)
 {
        calendar_record_h record = __fetcher.getNext(true);
-       if (record == NULL)
-       {
+       if (record == NULL) {
                return nullptr;
        }
 
@@ -133,14 +119,12 @@ std::shared_ptr<CalInstanceSchedule> CalComplexListProvider::__getNextScheduleFr
        CalDate adjustedStart, adjustedEnd;
        __getAdjustedDates(*schedule, adjustedStart, adjustedEnd);
 
-       if (adjustedStart < CalDate(CalDate::INIT_LOWER_BOUND))
-       {
+       if (adjustedStart < CalDate(CalDate::INIT_LOWER_BOUND)) {
                WDEBUG("Start is out of supported range(%s)", adjustedStart.dump().c_str());
                return nullptr;
        }
 
-       if (CalDate(CalDate::INIT_UPPER_BOUND) < adjustedEnd)
-       {
+       if (CalDate(CalDate::INIT_UPPER_BOUND) < adjustedEnd) {
                WDEBUG("End is out of supported range(%s)", adjustedEnd.dump().c_str());
                return nullptr;
        }
@@ -161,50 +145,34 @@ void CalComplexListProvider::__getAdjustedDates(const CalInstanceSchedule& sched
        schedule.getEndForComplexList(endDateTime);
        const CalDate end(endDateTime.getYear(), endDateTime.getMonth(), endDateTime.getMday());
 
-       if (__allDay)
-       {
+       if (__allDay) {
                WASSERT(start <= end);
-               if (__dir > 0)
-               {
+               if (__dir > 0) {
                        WASSERT(__base <= end); // 2014/5/4 ~ 2014/5/5 event should show on 2014/5/5
-               }
-               else
-               {
+               } else {
                        WASSERT(start < __base);
                }
-       }
-       else
-       {
+       } else {
                WASSERT(startDateTime <= endDateTime);
-               if (__dir > 0)
-               {
+               if (__dir > 0) {
                        WASSERT(__base <= end); // 2014/5/5 00:00 ~ 2014/5/5 00:00 event should show on 2014/5/5
-               }
-               else
-               {
+               } else {
 //                     http://en.wikipedia.org/wiki/Magadan_Time
 //                     http://www.timeanddate.com/time/zone/russia/magadan
                        WASSERT(start <= __base);
                }
        }
 
-       if (__dir > 0)
-       {
+       if (__dir > 0) {
                adjustedStart = __base <= start ? start : __base;
                adjustedEnd = end;
-       }
-       else
-       {
+       } else {
                adjustedStart = start;
-               if (end < __base)
-               {
+               if (end < __base) {
                        adjustedEnd =  end;
-               }
-               else
-               {
+               } else {
                        adjustedEnd =  __base;
-                       if (start < end)
-                       {
+                       if (start < end) {
                                WINFO("The 2014/10/26 2:00 AM Magadan timezone case");
                                adjustedEnd.addDays(-1);
                        }
@@ -217,24 +185,18 @@ int CalComplexListProvider::__getDuration(const CalInstanceSchedule& schedule) c
        CalDate adjustedStart, adjustedEnd;
        __getAdjustedDates(schedule, adjustedStart, adjustedEnd);
 
-       if (__allDay)
-       {
+       if (__allDay) {
                return CalDate::getDayDiff(adjustedEnd, adjustedStart) + 1;
 
-       }
-       else
-       {
+       } else {
                CalDateTime startDateTime, endDateTime;
                schedule.getStart(startDateTime);
                schedule.getEndForComplexList(endDateTime);
 
                if (startDateTime.getDateCompareVal() < endDateTime.getDateCompareVal() &&
-                   endDateTime.getHour() == 0 && endDateTime.getMinute() == 0 && endDateTime.getSecond() == 0)
-               {
+                   endDateTime.getHour() == 0 && endDateTime.getMinute() == 0 && endDateTime.getSecond() == 0) {
                        return CalDate::getDayDiff(adjustedEnd, adjustedStart);
-               }
-               else
-               {
+               } else {
                        return CalDate::getDayDiff(adjustedEnd, adjustedStart) + 1;
                }
        }
@@ -260,12 +222,9 @@ bool CalComplexListProvider::Occupant::normalOrderPredicate(const Occupant& a, c
        a.__schedule->getStart(startA);
        b.__schedule->getStart(startB);
 
-       if (startA == startB)
-       {
+       if (startA == startB) {
                return CAL_STRCMP(a.__schedule->getSummary(), b.__schedule->getSummary()) < 0;
-       }
-       else
-       {
+       } else {
                return startA < startB;
        }
 }
index 6693352..e598305 100644 (file)
@@ -24,8 +24,7 @@ CalCustomListModel::CalCustomListModel(const std::list<std::shared_ptr<CalSchedu
 {
        WENTER();
        __it = __schedules.begin();
-       if (!schedules.empty())
-       {
+       if (!schedules.empty()) {
                CalDateTime start;
                (*__it)->getStart(start);
                __currentDate.set(start.getYear(), start.getMonth(), start.getMday());
@@ -40,8 +39,7 @@ CalCustomListModel::~CalCustomListModel()
 std::shared_ptr<CalSchedule> CalCustomListModel::getNext(bool& dayChanged)
 {
        WENTER();
-       if (__it == __schedules.end())
-       {
+       if (__it == __schedules.end()) {
                return nullptr;
        }
 
index b17b9ea..4b1f393 100644 (file)
@@ -67,8 +67,7 @@ int CalDataManager::insertSchedule(const CalSchedule& schedule, int* newId)
 
        int id = 0;
        int error = calendar_db_insert_record(record, &id);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("calendar_db_insert_record failed : %d", error);
                return -1;
        }
@@ -87,8 +86,7 @@ void CalDataManager::__updateSchedule(CalOriginalSchedule& workingCopy)
 
        const calendar_record_h record = workingCopy.getRecord();
        int error = calendar_db_update_record(record);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("calendar_db_update_record failed : %d", error);
                return;
        }
@@ -103,8 +101,7 @@ std::shared_ptr<CalOriginalSchedule> CalDataManager::__getOriginalSchedule(const
 
        calendar_record_h originalRecord = NULL;
        int error = calendar_db_get_record(_calendar_event._uri, originalRecordId, &originalRecord);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("calendar_db_get_record(%d) failed : %d", originalRecordId, error);
                return nullptr;
        }
@@ -117,8 +114,7 @@ int CalDataManager::updateSchedule(OperationMode mode, const CalSchedule& inputS
        WENTER();
        WASSERT(workingCopy.getType() == CalSchedule::ORIGINAL);
 
-       switch (mode)
-       {
+       switch (mode) {
                case CalDataManager::ONLY_THIS:
                        __updateOnlyThisInstance(inputSchedule, (CalOriginalSchedule&)workingCopy);
                        break;
@@ -140,13 +136,10 @@ int CalDataManager::updateSchedule(OperationMode mode, const CalSchedule& inputS
 
 void CalDataManager::__updateOnlyThisInstance(const CalSchedule& inputSchedule, CalOriginalSchedule& workingCopy)
 {
-       if (inputSchedule.isException())
-       {
+       if (inputSchedule.isException()) {
                WASSERT(workingCopy.isException());
                __updateSchedule(workingCopy);
-       }
-       else
-       {
+       } else {
                workingCopy.setOriginalEventId(__getOriginalSchedule(inputSchedule)->getIndex());
                workingCopy.setRecurranceId(inputSchedule.getExceptionString());
                insertSchedule(workingCopy);
@@ -161,8 +154,7 @@ void CalDataManager::__updateThisAndFutureInstances(const CalSchedule& inputSche
 
        auto originalSchedule = __getOriginalSchedule(inputSchedule);
 
-       if (originalSchedule->getInstanceCountBeforeDate(inputInstanceStartTime) == 0)
-       {
+       if (originalSchedule->getInstanceCountBeforeDate(inputInstanceStartTime) == 0) {
                __updateAllInstances(inputSchedule, workingCopy);
                *newId = workingCopy.getIndex();
                return;
@@ -185,8 +177,7 @@ void CalDataManager::__updateAllInstances(const CalSchedule& inputSchedule, CalO
        const calendar_record_h record = workingCopy.getRecord();
 
        int error = calendar_db_update_record(record);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("calendar_db_update_record failed : %d", error);
                return;
        }
@@ -198,8 +189,7 @@ int CalDataManager::deleteSchedule(const CalSchedule& inputSchedule)
 {
        WENTER();
        int ret = __deleteSchedule(inputSchedule);
-       if (ret == 0)
-       {
+       if (ret == 0) {
                __notify(CalEvent::LOCAL);
                __notifyAlert();
        }
@@ -210,8 +200,7 @@ int CalDataManager::deleteSchedule(const CalSchedule& inputSchedule)
 int CalDataManager::deleteSchedule(OperationMode mode, const CalSchedule& inputSchedule)
 {
        WENTER();
-       switch (mode)
-       {
+       switch (mode) {
                case CalDataManager::ONLY_THIS:
                        __deleteOnlyThisInstance(inputSchedule);
                        break;
@@ -231,8 +220,7 @@ int CalDataManager::deleteSchedule(OperationMode mode, const CalSchedule& inputS
 int CalDataManager::__deleteSchedule(const CalSchedule& inputSchedule)
 {
        int error = calendar_db_delete_record(_calendar_event._uri, inputSchedule.getIndex());
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("calendar_db_delete(%d) failed : %d", inputSchedule.getIndex(), error);
                return -1;
        }
@@ -242,12 +230,9 @@ int CalDataManager::__deleteSchedule(const CalSchedule& inputSchedule)
 
 void CalDataManager::__deleteOnlyThisInstance(const CalSchedule& inputSchedule)
 {
-       if (inputSchedule.isException())
-       {
+       if (inputSchedule.isException()) {
                deleteSchedule(inputSchedule);
-       }
-       else
-       {
+       } else {
                auto originalSchedule = __getOriginalSchedule(inputSchedule);
                calendar_record_h originalRecord = originalSchedule->getRecord();
 
@@ -256,12 +241,9 @@ void CalDataManager::__deleteOnlyThisInstance(const CalSchedule& inputSchedule)
                c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_record_get_str() has failed(%x)", error);
 
                char* new_exdate = NULL;
-               if (exdate && *exdate)
-               {
+               if (exdate && *exdate) {
                        new_exdate = g_strdup_printf("%s,%s", exdate, inputSchedule.getExceptionString());
-               }
-               else
-               {
+               } else {
                        new_exdate = g_strdup_printf("%s", inputSchedule.getExceptionString());
                }
 
@@ -280,8 +262,7 @@ void CalDataManager::__deleteThisAndFutureInstances(const CalSchedule& inputSche
        inputSchedule.getStart(inputInstanceStartTime);
 
        auto originalSchedule = __getOriginalSchedule(inputSchedule);
-       if (originalSchedule->getInstanceCountBeforeDate(inputInstanceStartTime) == 0)
-       {
+       if (originalSchedule->getInstanceCountBeforeDate(inputInstanceStartTime) == 0) {
                __deleteAllInstances(inputSchedule);
                return;
        }
@@ -293,26 +274,21 @@ void CalDataManager::__deleteThisAndFutureInstances(const CalSchedule& inputSche
 
 void CalDataManager::__deleteAllInstances(const CalSchedule& inputSchedule)
 {
-       if (inputSchedule.isException())
-       {
+       if (inputSchedule.isException()) {
                deleteSchedule(*__getOriginalSchedule(inputSchedule));
-       }
-       else
-       {
+       } else {
                deleteSchedule(inputSchedule);
        }
 }
 
 std::shared_ptr<CalSchedule> CalDataManager::getUpdatedWorkingCopy(OperationMode mode, const CalSchedule& inputSchedule)
 {
-       switch (mode)
-       {
+       switch (mode) {
                case CalDataManager::ONLY_THIS:
                case CalDataManager::THIS_AND_FUTURE:
                {
                        auto workingCopy = __getWorkingUpdatedCopy(inputSchedule);
-                       if (workingCopy)
-                       {
+                       if (workingCopy) {
                                return workingCopy;
                        }
                        return __getWorkingInstanceCopy(inputSchedule);
@@ -326,8 +302,7 @@ std::shared_ptr<CalSchedule> CalDataManager::getUpdatedWorkingCopy(OperationMode
 
 std::shared_ptr<CalSchedule> CalDataManager::getWorkingCopy(OperationMode mode, const CalSchedule& inputSchedule)
 {
-       switch (mode)
-       {
+       switch (mode) {
                case CalDataManager::ONLY_THIS:
                        return __getWorkingInstanceCopy(inputSchedule);
                case CalDataManager::THIS_AND_FUTURE:
@@ -345,8 +320,7 @@ std::shared_ptr<CalSchedule> CalDataManager::getWorkingCopy(OperationMode mode,
 
 std::shared_ptr<CalSchedule> CalDataManager::getWorkingCopyForForward(OperationMode mode, const CalSchedule& inputSchedule)
 {
-       switch (mode)
-       {
+       switch (mode) {
                case CalDataManager::ONLY_THIS:
                {
                        auto workingCopy = __getWorkingInstanceCopy(inputSchedule);
@@ -372,8 +346,7 @@ std::shared_ptr<CalOriginalSchedule> CalDataManager::__getWorkingInstanceCopy(co
 
        calendar_record_h originalRecord = NULL;
        int error = calendar_db_get_record(_calendar_event._uri, originalRecordId, &originalRecord);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("calendar_db_get_record(%d) failed : %d", originalRecordId, error);
                return NULL;
        }
@@ -382,8 +355,7 @@ std::shared_ptr<CalOriginalSchedule> CalDataManager::__getWorkingInstanceCopy(co
        //      If inputSchedule is an exception instance, originalRecord is the exception record
        //  from the original table, which is precisely what we want to work with.
        auto workingCopy = std::make_shared<CalOriginalSchedule>(originalRecord);
-       if (!workingCopy->isException() && workingCopy->hasRepeat() == true)
-       {
+       if (!workingCopy->isException() && workingCopy->hasRepeat() == true) {
                CalDateTime startTime, endTime;
                inputSchedule.getStart(startTime);
                inputSchedule.getEnd(endTime);
@@ -398,11 +370,9 @@ std::shared_ptr<CalOriginalSchedule> CalDataManager::__getWorkingOriginalCopy(co
 {
        auto workingCopy = __getOriginalSchedule(inputSchedule);
 
-       if (!workingCopy->hasRepeat())
-       {
+       if (!workingCopy->hasRepeat()) {
                const char* myTimezone = workingCopy->getTimeZone();
-               if (myTimezone == NULL || g_strcmp0(myTimezone, TIMEZONE_ETC_GMT) == 0)
-               {
+               if (myTimezone == NULL || g_strcmp0(myTimezone, TIMEZONE_ETC_GMT) == 0) {
                        WHIT();
                        std::string calendarTimezone;
                        CalSettingsManager::getInstance().getCalendarTimeZone(calendarTimezone);
@@ -418,8 +388,7 @@ void CalDataManager::__setThisAndFutureRepeatCount(const CalSchedule& inputSched
 {
        CalScheduleRepeat repeat = workingCopy.getRepeat();
        repeat.print();
-       if (repeat.untilType != CalScheduleRepeat::UntilType::TIMES)
-       {
+       if (repeat.untilType != CalScheduleRepeat::UntilType::TIMES) {
                return;
        }
 
@@ -438,21 +407,17 @@ std::shared_ptr<CalOriginalSchedule> CalDataManager::__getWorkingUpdatedCopy(con
 {
        WENTER();
 
-       if (inputSchedule.hasRepeat())
-       {
+       if (inputSchedule.hasRepeat()) {
                std::shared_ptr<CalOriginalSchedule> workingCopy = NULL;
                int originalRecordId = 0;
                char *recurrenceId = NULL;
 
                int error = 0;
-               if (inputSchedule.isException() == true)
-               {
+               if (inputSchedule.isException() == true) {
                        originalRecordId = inputSchedule.getOriginalEventId();
                        // get recurrence_id
                        recurrenceId = inputSchedule.getExceptionString();
-               }
-               else
-               {
+               } else {
                        originalRecordId = inputSchedule.getIndex();
                        // make recurrence_id
                        recurrenceId = inputSchedule.getExceptionString();
@@ -462,67 +427,54 @@ std::shared_ptr<CalOriginalSchedule> CalDataManager::__getWorkingUpdatedCopy(con
                calendar_filter_h filter = NULL;
                const char* view_uri = _calendar_event._uri;
                calendar_list_h list = NULL;
-               do
-               {
+               do {
                        error = calendar_query_create(view_uri, &query);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                        error = calendar_filter_create(view_uri, &filter);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                        error = calendar_filter_add_int(filter, _calendar_event.original_event_id,CALENDAR_MATCH_EQUAL,originalRecordId);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                        error = calendar_filter_add_operator(filter, CALENDAR_FILTER_OPERATOR_AND);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                        error = calendar_filter_add_str(filter, _calendar_event.recurrence_id, CALENDAR_MATCH_CONTAINS,recurrenceId);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                        error = calendar_query_set_filter(query,filter);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                        error = calendar_db_get_records_with_query(query,0,0,&list);
                }
                while(0);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        WERROR("fail : %d", error);
                }
 
-               if (list != NULL)
-               {
+               if (list != NULL) {
                        int count = 0;
                        calendar_list_first(list);
                        calendar_record_h record2 = NULL;
                        error = calendar_list_get_count(list, &count);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                WERROR("fail : %d", error);
                        }
                        error = calendar_list_get_current_record_p(list, &record2);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                WERROR("fail : %d", error);
                        }
-                       if (count > 0 && record2 != NULL)
-                       {
+                       if (count > 0 && record2 != NULL) {
                                calendar_record_h clone = NULL;
                                error = calendar_record_clone(record2, &clone);
-                               if (error != CALENDAR_ERROR_NONE)
-                               {
+                               if (error != CALENDAR_ERROR_NONE) {
                                        WERROR("fail : %d", error);
                                }
                                workingCopy = std::make_shared<CalOriginalSchedule>(clone);
@@ -546,30 +498,26 @@ void CalDataManager::getSchedulesFromVcs(const char* filePath, std::list<std::sh
 
        struct stat st = {0};
        int ret = stat(filePath, &st);
-       if (ret != 0 || st.st_size <= 0)
-       {
+       if (ret != 0 || st.st_size <= 0) {
                WERROR("stat(%s) failed : %s", filePath, strerror(errno));
                return;
        }
 
        FILE* file = fopen(filePath, "r");
-       if (!file)
-       {
+       if (!file) {
                WERROR("fopen(%s) failed : %s", filePath, strerror(errno));
                return;
        }
 
        char* vcsData = (char*)g_malloc0(st.st_size);
-       if(vcsData == NULL)
-       {
+       if(vcsData == NULL) {
                WERROR("g_malloc0(%d) failed : %s", st.st_size, strerror(errno));
                fclose(file);
                return;
        }
 
        ret = fread(vcsData, 1, st.st_size, file);
-       if (ret <= 0)
-       {
+       if (ret <= 0) {
                WERROR("fread(%s) failed : %s", filePath, strerror(errno));
                g_free(vcsData);
                fclose(file);
@@ -580,8 +528,7 @@ void CalDataManager::getSchedulesFromVcs(const char* filePath, std::list<std::sh
        calendar_list_h records = NULL;
        int error = calendar_vcalendar_parse_to_calendar(vcsData, &records);
        g_free(vcsData);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("calendar_vcalendar_parse_to_calendar failed : %d", error);
                return;
        }
@@ -589,26 +536,20 @@ void CalDataManager::getSchedulesFromVcs(const char* filePath, std::list<std::sh
        int count = 0;
        calendar_list_get_count(records, &count);
        calendar_list_first(records);
-       for (int i = 0; i < count; i++)
-       {
+       for (int i = 0; i < count; i++) {
                calendar_record_h record = NULL;
                calendar_list_get_current_record_p(records, &record);
                WASSERT(record);
                char *view_uri = NULL;
                calendar_record_get_uri_p(record, &view_uri);
                WASSERT(view_uri);
-               if (strcmp(view_uri, _calendar_todo._uri) == 0)
-               {
+               if (strcmp(view_uri, _calendar_todo._uri) == 0) {
                        WERROR("Task cannot be supported");
                        continue;
-               }
-               else if (strcmp(view_uri, _calendar_event._uri) == 0)
-               {
+               } else if (strcmp(view_uri, _calendar_event._uri) == 0) {
                        std::shared_ptr<CalOriginalSchedule> original(std::make_shared<CalOriginalSchedule>(record));
                        schedules.push_back(original);
-               }
-               else
-               {
+               } else {
                        WDEBUG("%s", view_uri);
                }
                calendar_list_next(records);
@@ -627,69 +568,56 @@ void CalDataManager::generateVcsFromSchedule(const CalSchedule& schedule, const
        char *vcs = NULL;
        int fd = -1;
 
-       do
-       {
-               if (isOriginalSchedule)
-               {
+       do {
+               if (isOriginalSchedule) {
                        error = calendar_record_clone(schedule.getRecord(), &record);
-               }
-               else
-               {
+               } else {
                        error = calendar_db_get_record(_calendar_event._uri, schedule.getIndex(), &record);
                }
 
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
 
                // check birthday book
-               if (DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID == schedule.getBookId())
-               {
+               if (DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID == schedule.getBookId()) {
                        std::string text;
                        schedule.getDisplaySummary(-1, text);
                        char* input = elm_entry_markup_to_utf8(text.c_str());
                        error = calendar_record_set_str(record, _calendar_event.summary, input);
                        free(input);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                break;
                        }
                }
 
                error = calendar_list_create(&list);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
 
                error = calendar_list_add(list, record);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
 
                error = calendar_vcalendar_make_from_records(list, &vcs);
-               if (vcs == NULL || strlen(vcs) == 0)
-               {
+               if (vcs == NULL || strlen(vcs) == 0) {
                        WDEBUG("no data");
                        error = CALENDAR_ERROR_NO_DATA;
                }
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
 
                fd = open(filePath, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH);
-               if (fd < 0)
-               {
+               if (fd < 0) {
                        WDEBUG("open error: %s", strerror(errno));
                        error = CALENDAR_ERROR_SYSTEM;
                        break;
                }
 
-               if (write(fd, vcs, strlen(vcs)) == -1)
-               {
+               if (write(fd, vcs, strlen(vcs)) == -1) {
                        WDEBUG("write error: %s", strerror(errno));
                        error = CALENDAR_ERROR_SYSTEM;
                        break;
@@ -700,23 +628,19 @@ void CalDataManager::generateVcsFromSchedule(const CalSchedule& schedule, const
        }
        while (0);
 
-       if (record)
-       {
+       if (record) {
                calendar_record_destroy(record, true);
        }
-       if (list)
-       {
+       if (list) {
                calendar_list_destroy(list, false);
        }
 
        free(vcs);
-       if (fd >= 0)
-       {
+       if (fd >= 0) {
                close(fd);
        }
 
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WASSERT_EX(0, "cannot make a vcs file from %d event : %d", schedule.getIndex(), error);
                return;
        }
@@ -727,19 +651,15 @@ char* CalDataManager::generateTextFromSchedule(const CalSchedule& schedule)
        std::string summaryMarkUp;
        std::string summary;
        schedule.getDisplaySummary(-1, summaryMarkUp);
-       if (summaryMarkUp.empty())
-       {
+       if (summaryMarkUp.empty()) {
                summaryMarkUp = _L_("IDS_CLD_MBODY_MY_EVENT");
        }
 
        char *tmp = elm_entry_markup_to_utf8(summaryMarkUp.c_str());
-       if (!tmp)
-       {
+       if (!tmp) {
                WERROR("elm_entry_markup_to_utf8(%s) failed : %s", summaryMarkUp.c_str(), strerror(errno));
                summary = "";
-       }
-       else
-       {
+       } else {
                summary = tmp;
        }
        free(tmp);
@@ -747,30 +667,21 @@ char* CalDataManager::generateTextFromSchedule(const CalSchedule& schedule)
        std::string fromToString;
        schedule.getFromToString(fromToString);
        std::string location;
-       if (schedule.getLocation())
-       {
+       if (schedule.getLocation()) {
                location = schedule.getLocation();
        }
        std::string description;
-       if (schedule.getDescription())
-       {
+       if (schedule.getDescription()) {
                description = schedule.getDescription();
        }
 
-       if (!location.empty() && !description.empty())
-       {
+       if (!location.empty() && !description.empty()) {
                return g_strdup_printf("%s\n%s\n\n%s\n\n%s", summary.c_str(), fromToString.c_str(), location.c_str(), description.c_str());
-       }
-       else if (location.empty() && description.empty())
-       {
+       } else if (location.empty() && description.empty()) {
                return g_strdup_printf("%s\n%s", summary.c_str(), fromToString.c_str());
-       }
-       else if (location.empty())
-       {
+       } else if (location.empty()) {
                return g_strdup_printf("%s\n%s\n\n%s", summary.c_str(), fromToString.c_str(), description.c_str());
-       }
-       else
-       {
+       } else {
                return g_strdup_printf("%s\n%s\n\n%s", summary.c_str(), fromToString.c_str(), location.c_str());
        }
 }
@@ -781,8 +692,7 @@ std::shared_ptr<CalSchedule> CalDataManager::getSchedule(const int eventIndex)
 
        calendar_record_h record = NULL;
        int error = calendar_db_get_record(_calendar_event._uri, eventIndex, &record);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("calendar_db_get_record(%d) failed : %d", eventIndex, error);
                return nullptr;
        }
@@ -797,16 +707,14 @@ std::shared_ptr<CalSchedule> CalDataManager::getInstanceSchedule(const int event
 {
        calendar_record_h record = NULL;
        int error = calendar_db_get_record(_calendar_event._uri, eventIndex, &record);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("calendar_db_get_record(%d) failed : %d", eventIndex, error);
                return nullptr;
        }
 
        calendar_time_s recordStart;
        error = calendar_record_get_caltime(record, _calendar_event.start_time, &recordStart);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                calendar_record_destroy(record, true);
                WERROR("calendar_record_get_caltime(%d) failed : %d", eventIndex, error);
                return nullptr;
@@ -833,8 +741,7 @@ std::shared_ptr<CalSchedule> CalDataManager::getInstanceSchedule(const int event
                calendar_db_get_records_with_query(query, 0, 0, &list);
                calendar_filter_destroy(filter);
                calendar_query_destroy(query);
-       }
-       else  // allday instance
+       } else  // allday instance
        {
                CalDateTime tempDateTime(dateTime.getYear(), dateTime.getMonth(), dateTime.getMday());
                calendar_time_s start = CalSchedule::getCaltime(tempDateTime);
@@ -853,8 +760,7 @@ std::shared_ptr<CalSchedule> CalDataManager::getInstanceSchedule(const int event
 
        int count = 0;
        calendar_list_get_count(list, &count);
-       if (count <= 0)
-       {
+       if (count <= 0) {
                calendar_list_destroy(list, true);
                WERROR("There is no event for %d", eventIndex);
                return nullptr;
@@ -883,18 +789,14 @@ bool CalDataManager::isOverlapped(const CalSchedule& schedule)
        calendar_query_h query1 = NULL;
        calendar_filter_h filter = NULL;
        int error = 0;
-       do
-       {
+       do {
                calendar_time_s caltimeStart, caltimeEnd;
-               if (start.type == CALENDAR_TIME_LOCALTIME)
-               {
+               if (start.type == CALENDAR_TIME_LOCALTIME) {
                        caltimeStart.type = CALENDAR_TIME_UTIME;
                        caltimeStart.time.utime = startTime.getUtimeFromTm();
                        caltimeEnd.type = CALENDAR_TIME_UTIME;
                        caltimeEnd.time.utime= endTime.getUtimeFromTm();
-               }
-               else
-               {
+               } else {
                        caltimeStart = start;
                        caltimeEnd = end;
                }
@@ -902,44 +804,36 @@ bool CalDataManager::isOverlapped(const CalSchedule& schedule)
                unsigned int end_time_property_id = _calendar_instance_utime_calendar_book.end_time;
                const char* view_uri = _calendar_instance_utime_calendar_book._uri;
                error = calendar_filter_create(view_uri, &filter);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_filter_add_caltime(filter, end_time_property_id, CALENDAR_MATCH_GREATER_THAN, caltimeStart);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_filter_add_operator(filter, CALENDAR_FILTER_OPERATOR_AND);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_filter_add_caltime(filter, start_time_property_id, CALENDAR_MATCH_LESS_THAN_OR_EQUAL, caltimeEnd);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_query_create(view_uri, &query1);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_query_set_filter(query1, filter);
        }
        while(0);
 
-       if (filter)
-       {
+       if (filter) {
                calendar_filter_destroy(filter);
                filter = NULL;
        }
 
-       if (error != CALENDAR_ERROR_NONE)
-       {
-               if (query1)
-               {
+       if (error != CALENDAR_ERROR_NONE) {
+               if (query1) {
                        calendar_query_destroy(query1);
                }
                WERROR("fail(%x)",error);
@@ -949,11 +843,9 @@ bool CalDataManager::isOverlapped(const CalSchedule& schedule)
        // instance allday
        calendar_query_h query2 = NULL;
 
-       do
-       {
+       do {
                calendar_time_s caltimeStart, caltimeEnd;
-               if (start.type == CALENDAR_TIME_UTIME)
-               {
+               if (start.type == CALENDAR_TIME_UTIME) {
                        caltimeStart.type = CALENDAR_TIME_LOCALTIME;
                        caltimeStart.time.date.year = startTime.getYear();
                        caltimeStart.time.date.month = startTime.getMonth();
@@ -962,9 +854,7 @@ bool CalDataManager::isOverlapped(const CalSchedule& schedule)
                        caltimeEnd.time.date.year = endTime.getYear();
                        caltimeEnd.time.date.month = endTime.getMonth();
                        caltimeEnd.time.date.mday = endTime.getMday();
-               }
-               else
-               {
+               } else {
                        caltimeStart = start;
                        caltimeEnd = end;
                }
@@ -972,47 +862,38 @@ bool CalDataManager::isOverlapped(const CalSchedule& schedule)
                unsigned int end_time_property_id = _calendar_instance_localtime_calendar_book.end_time;
                const char* view_uri = _calendar_instance_localtime_calendar_book._uri;
                error = calendar_filter_create(view_uri, &filter);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_filter_add_caltime(filter, end_time_property_id, CALENDAR_MATCH_GREATER_THAN, caltimeStart);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_filter_add_operator(filter, CALENDAR_FILTER_OPERATOR_AND);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_filter_add_caltime(filter, start_time_property_id, CALENDAR_MATCH_LESS_THAN_OR_EQUAL, caltimeEnd);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_query_create(view_uri, &query2);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_query_set_filter(query2, filter);
        }
        while(0);
 
-       if (filter)
-       {
+       if (filter) {
                calendar_filter_destroy(filter);
        }
-       if (error != CALENDAR_ERROR_NONE)
-       {
-               if (query2)
-               {
+       if (error != CALENDAR_ERROR_NONE) {
+               if (query2) {
                        calendar_query_destroy(query2);
                }
                WERROR("fail(%x)",error);
-               if (query1)
-               {
+               if (query1) {
                        calendar_query_destroy(query1);
                }
                return false;
@@ -1022,16 +903,13 @@ bool CalDataManager::isOverlapped(const CalSchedule& schedule)
        int count1 = 0;
        int count2 = 0;
 
-       do
-       {
+       do {
                error = calendar_db_get_records_with_query(query1, 0, 0, &list);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_list_get_count(list, &count1);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                calendar_list_destroy(list, true);
@@ -1040,13 +918,11 @@ bool CalDataManager::isOverlapped(const CalSchedule& schedule)
                query1 = NULL;
 
                error = calendar_db_get_records_with_query(query2, 0, 0, &list);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                error = calendar_list_get_count(list, &count2);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        break;
                }
                calendar_list_destroy(list, true);
@@ -1056,26 +932,21 @@ bool CalDataManager::isOverlapped(const CalSchedule& schedule)
        }
        while(0);
 
-       if (error != CALENDAR_ERROR_NONE)
-       {
-               if (query1)
-               {
+       if (error != CALENDAR_ERROR_NONE) {
+               if (query1) {
                        calendar_query_destroy(query1);
                }
-               if (query2)
-               {
+               if (query2) {
                        calendar_query_destroy(query2);
                }
-               if (list)
-               {
+               if (list) {
                        calendar_list_destroy(list, true);
                }
                WERROR("fail(%x)",error);
                return false;
        }
 
-       if (0 < count1 || 0 < count2)
-       {
+       if (0 < count1 || 0 < count2) {
                return true;
        }
 
@@ -1084,11 +955,9 @@ bool CalDataManager::isOverlapped(const CalSchedule& schedule)
 
 void CalDataManager::__notify(CalEvent::Source source)
 {
-       if (source == CalEvent::LOCAL)
-       {
+       if (source == CalEvent::LOCAL) {
                int error = calendar_db_get_last_change_version(&__localVersion);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        WASSERT_EX(0, "calendar_db_get_last_change_version failed : %d", error);
                        WERROR("calendar_db_get_last_change_version failed : %d", error);
                        return;
@@ -1110,8 +979,7 @@ void CalDataManager::__notifyAlert()
        app_control_add_extra_data(service, CAL_APPSVC_PARAM_CALLER, CAL_APPSVC_PARAM_CALLER_CALENDAR);
 
        int ret = app_control_send_launch_request(service, NULL, NULL);
-       if( ret != APP_CONTROL_ERROR_NONE )
-       {
+       if( ret != APP_CONTROL_ERROR_NONE ) {
                WERROR("app_control ret error code= %d", ret);
        }
 
@@ -1126,16 +994,14 @@ void CalDataManager::__onChanged(const char* uri, void* userData)
        int error = calendar_db_get_changes_by_version(_calendar_event._uri, -1, self.__localVersion, &changedList, &self.__version);
        //int error = calendar_db_get_current_version(&self.__version);
        calendar_list_destroy(changedList, true);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WASSERT_EX(0, "calendar_db_get_changes_by_version failed : %d", error);
                WERROR("calendar_db_get_changes_by_version failed : %d", error);
                return;
        }
 
        WDEBUG("version = %d:%d", self.__localVersion, self.__version);
-       if (self.__localVersion == self.__version)
-       {
+       if (self.__localVersion == self.__version) {
                WDEBUG("already updated");
                return;
        }
@@ -1145,12 +1011,10 @@ void CalDataManager::__onChanged(const char* uri, void* userData)
 void CalDataManager::__deleteExceptionRecordsOnAndAfter(const CalOriginalSchedule& originalSchedule, const CalDateTime& inputInstanceStartTime)
 {
        calendar_record_h originalRecord = originalSchedule.getRecord();
-       if(originalRecord)
-       {
+       if(originalRecord) {
                char* exdate = NULL;
                int error = calendar_record_get_str(originalRecord, _calendar_event.exdate, &exdate);
-               if (error == CALENDAR_ERROR_NONE && exdate && *exdate)
-               {
+               if (error == CALENDAR_ERROR_NONE && exdate && *exdate) {
                        // 20150124,20150125
                        std::string targetString(exdate);
                        std::istringstream iss(targetString);
@@ -1163,8 +1027,7 @@ void CalDataManager::__deleteExceptionRecordsOnAndAfter(const CalOriginalSchedul
                                sscanf(strEach.c_str(),"%4d%2d%2d", &year, &month, &day);
 
                                CalDateTime testDate(year, month, day);
-                               if(testDate < inputInstanceStartTime)
-                               {
+                               if(testDate < inputInstanceStartTime) {
                                        if(!strNew.empty())
                                                strNew += ",";
 
@@ -1180,8 +1043,7 @@ void CalDataManager::__deleteExceptionRecordsOnAndAfter(const CalOriginalSchedul
 void CalDataManager::__deleteAllExceptionRecords(const CalOriginalSchedule& originalSchedule)
 {
        calendar_record_h originalRecord = originalSchedule.getRecord();
-       if(originalRecord)
-       {
+       if(originalRecord) {
                calendar_record_set_str(originalRecord, _calendar_event.exdate, NULL);
        }
 }
index d64ea28..bad2e11 100644 (file)
@@ -28,8 +28,7 @@
 
 CalDate::CalDate(InitialValue initialValue)
 {
-       switch (initialValue)
-       {
+       switch (initialValue) {
                case INIT_TODAY:
                {
                        struct tm now_tm = {0};
@@ -76,16 +75,14 @@ CalDate::CalDate(const char* stringParam)
        time_t timeFromParam = (time_t)atoll(stringParam);
        memset(&__date, 0, sizeof(struct tm));
        tm *t = localtime(&timeFromParam);
-       if (t != NULL)
-       {
+       if (t != NULL) {
                __date = *t;
        }
 }
 
 const CalDate& CalDate::operator=( const CalDate& obj)
 {
-       if (this != &obj)
-       {
+       if (this != &obj) {
                WASSERT(obj.__date.tm_hour == 12);
                WASSERT(obj.__date.tm_min == 0);
                WASSERT(obj.__date.tm_sec == 0);
@@ -154,14 +151,11 @@ void CalDate::setToMonthGridStart(int firstWeekday, int year, int month)
 std::string CalDate::dump(bool showTime) const
 {
        char buffer[DATE_BUFFER];
-       if (showTime)
-       {
+       if (showTime) {
                snprintf(buffer, DATE_BUFFER, "{%.04d/%.02d/%.02d (%s) %.02d:%.02d:%.02d}",
                        getYear(), getMonth(), getMday(), getWeekdayText(__date.tm_wday),
                        __date.tm_hour, __date.tm_min, __date.tm_sec);
-       }
-       else
-       {
+       } else {
                snprintf(buffer, DATE_BUFFER, "{%.04d/%.02d/%.02d (%s)}",
                        getYear(), getMonth(), getMday(), getWeekdayText(__date.tm_wday));
        }
@@ -183,13 +177,10 @@ void CalDate::decrementDay()
 
 void CalDate::incrementMonth()
 {
-       if (__date.tm_mon == 11)
-       {
+       if (__date.tm_mon == 11) {
                __date.tm_mon = 0;
                __date.tm_year++;
-       }
-       else
-       {
+       } else {
                __date.tm_mon++;
        }
        __normalizeMday();
@@ -207,8 +198,7 @@ void CalDate::__normalizeMday()
 {
        const int mon = __date.tm_mon;
        __normalizeStructTm(__date);
-       if (__date.tm_mon != mon)
-       {
+       if (__date.tm_mon != mon) {
                __date.tm_mday = 1;
                __normalizeStructTm(__date);
                decrementDay();
@@ -217,13 +207,10 @@ void CalDate::__normalizeMday()
 
 void CalDate::decrementMonth()
 {
-       if (__date.tm_mon == 0)
-       {
+       if (__date.tm_mon == 0) {
                __date.tm_mon = 11;
                __date.tm_year--;
-       }
-       else
-       {
+       } else {
                __date.tm_mon--;
        }
        __normalizeMday();
@@ -259,8 +246,7 @@ void CalDate::setMday(int mday)
        const int originalMon = __date.tm_mon;
        __date.tm_mday = mday;
        __normalizeStructTm(__date);
-       if (__date.tm_mon != originalMon)
-       {
+       if (__date.tm_mon != originalMon) {
                __date.tm_mday = 0;
                __normalizeStructTm(__date);
        }
index 34153f5..cb7a052 100644 (file)
@@ -66,8 +66,7 @@ CalDateTime::CalDateTime(int year, int month, int mday, int hour, int min, int s
 CalDateTime::CalDateTime(const CalDateTime &base, const char *timeZone)
                :CalDateTime()
 {
-       if (timeZone && *timeZone)
-       {
+       if (timeZone && *timeZone) {
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(timeZone, base.__utime, time);
                __utime = CalLocaleManager::getInstance().getUtimeFromTm(NULL, time);
@@ -89,8 +88,7 @@ CalDateTime::CalDateTime(const CalDateTime& obj)
 
 const CalDateTime& CalDateTime::operator=(const CalDateTime& obj)
 {
-       if (this != &obj)
-       {
+       if (this != &obj) {
                __utime = obj.__utime;
                __year = obj.__year;
                __month = obj.__month;
@@ -104,13 +102,10 @@ bool CalDateTime::operator==(const CalDateTime &obj) const
 {
        if (__allday != obj.__allday)
                return false;
-       if (__allday == true)
-       {
+       if (__allday == true) {
                return (getYear() == obj.getYear() && getMonth() == obj.getMonth() &&
                                getMday() == obj.getMday());
-       }
-       else
-       {
+       } else {
                return (__utime == obj.__utime);
        }
 }
@@ -169,12 +164,9 @@ void CalDateTime::set(const struct tm& dateTm)
 
 int CalDateTime::getYear(const char *timeZone) const
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                return __year;
-       }
-       else
-       {
+       } else {
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(timeZone, __utime, time);
                return time.tm_year + 1900;
@@ -184,12 +176,9 @@ int CalDateTime::getYear(const char *timeZone) const
 
 int CalDateTime::getMonth(const char *timeZone) const
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                return __month;
-       }
-       else
-       {
+       } else {
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(timeZone, __utime, time);
                return time.tm_mon + 1;
@@ -198,12 +187,9 @@ int CalDateTime::getMonth(const char *timeZone) const
 
 int CalDateTime::getMday(const char *timeZone) const
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                return __mday;
-       }
-       else
-       {
+       } else {
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(timeZone, __utime, time);
                return time.tm_mday;
@@ -212,12 +198,9 @@ int CalDateTime::getMday(const char *timeZone) const
 
 int CalDateTime::getHour(const char *timeZone) const
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                return 0;
-       }
-       else
-       {
+       } else {
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(timeZone, __utime, time);
                WDEBUG("%lld %d:%d:%d", __utime, time.tm_hour, time.tm_min, time.tm_sec);
@@ -227,12 +210,9 @@ int CalDateTime::getHour(const char *timeZone) const
 
 int CalDateTime::getMinute(const char *timeZone) const
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                return 0;
-       }
-       else
-       {
+       } else {
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(timeZone, __utime, time);
                WDEBUG("%lld %d:%d:%d", __utime, time.tm_hour, time.tm_min, time.tm_sec);
@@ -242,12 +222,9 @@ int CalDateTime::getMinute(const char *timeZone) const
 
 int CalDateTime::getSecond(const char *timeZone) const
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                return 0;
-       }
-       else
-       {
+       } else {
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(timeZone, __utime, time);
                WDEBUG("%lld %d:%d:%d", __utime, time.tm_hour, time.tm_min, time.tm_sec);
@@ -257,30 +234,25 @@ int CalDateTime::getSecond(const char *timeZone) const
 
 void CalDateTime::getTmFromUtime(struct tm* dateTm) const
 {
-       if (dateTm == NULL)
-       {
+       if (dateTm == NULL) {
                WERROR("invalid input");
                return;
        }
-       if (__allday == true)
-       {
+       if (__allday == true) {
                dateTm->tm_year = __year - 1900;
                dateTm->tm_mon = __month - 1;
                dateTm->tm_mday = __mday;
                dateTm->tm_hour = 0;
                dateTm->tm_min = 0;
                dateTm->tm_sec = 0;
-       }
-       else
-       {
+       } else {
                CalLocaleManager::getInstance().getTmFromUtime(NULL, __utime, *dateTm);
        }
 }
 
 long long int CalDateTime::getUtimeFromTm() const
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                struct tm time;
                memset(&time, 0, sizeof(struct tm));
                time.tm_year = __year - 1900;
@@ -291,9 +263,7 @@ long long int CalDateTime::getUtimeFromTm() const
                time.tm_sec = 0;
 
                return CalLocaleManager::getInstance().getUtime(time);
-       }
-       else
-       {
+       } else {
                return __utime;
        }
 }
@@ -332,8 +302,7 @@ void CalDateTime::getTimeString(std::string& text) const
        else
                tf = CalLocaleManager::TIMEFORMAT_6;
        text.clear();
-       if (__allday == true)
-       {
+       if (__allday == true) {
                return;
        }
        __getString(CalLocaleManager::DATEFORMAT_NONE, tf, text);
@@ -346,14 +315,11 @@ void CalDateTime::getDateString(std::string& text) const
 
 void CalDateTime::__getString(int df, int tf, std::string& text) const
 {
-       if (__allday)
-       {
+       if (__allday) {
                CalLocaleManager::getInstance().getDateTimeText(
                                (CalLocaleManager::DateFormat)df,
                                CalLocaleManager::TimeFormat::TIMEFORMAT_NONE, *this, text);
-       }
-       else
-       {
+       } else {
                CalLocaleManager::getInstance().getDateTimeText(
                                (CalLocaleManager::DateFormat)df,
                                (CalLocaleManager::TimeFormat)tf, *this, text);
@@ -380,8 +346,7 @@ int CalDateTime::getWeekday() const
 
 void CalDateTime::setAllDay(const bool isAllDay)
 {
-       if (isAllDay == true)
-       {
+       if (isAllDay == true) {
                if (__allday == true)
                        return ;
                __allday = true;
@@ -390,9 +355,7 @@ void CalDateTime::setAllDay(const bool isAllDay)
                __year = time.tm_year +1900;
                __month = time.tm_mon +1;
                __mday = time.tm_mday;
-       }
-       else
-       {
+       } else {
                if (__allday == false)
                        return;
 
@@ -409,8 +372,7 @@ void CalDateTime::setAllDay(const bool isAllDay)
 
 void CalDateTime::addSeconds(const long long int seconds, const bool setLimit)
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                WERROR("invalid");
                return;
        }
@@ -422,8 +384,7 @@ void CalDateTime::addSeconds(const long long int seconds, const bool setLimit)
 
 void CalDateTime::addHours(const int hours, const bool setLimit)
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                WERROR("invalid");
                return;
        }
@@ -436,8 +397,7 @@ void CalDateTime::addHours(const int hours, const bool setLimit)
 
 void CalDateTime::addDays(const int days, const bool setLimit)
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                long long int utime = getUtimeFromTm();
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(NULL, utime, time);
@@ -459,8 +419,7 @@ void CalDateTime::addDays(const int days, const bool setLimit)
 
 void CalDateTime::addMonths(const int months, const bool setLimit)
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                long long int utime = getUtimeFromTm();
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(NULL, utime, time);
@@ -484,8 +443,7 @@ void CalDateTime::addMonths(const int months, const bool setLimit)
 
 void CalDateTime::addYears(const int years, const bool setLimit)
 {
-       if (__allday == true)
-       {
+       if (__allday == true) {
                long long int utime = getUtimeFromTm();
                struct tm time;
                CalLocaleManager::getInstance().getTmFromUtime(NULL, utime, time);
@@ -510,14 +468,10 @@ void CalDateTime::addYears(const int years, const bool setLimit)
 void CalDateTime::__setLimit()
 {
        // 1902 ~ 2036
-       if (getYear() < 1902)
-       {
-               if (__allday == true)
-               {
+       if (getYear() < 1902) {
+               if (__allday == true) {
                        set(1902,1,1);
-               }
-               else
-               {
+               } else {
                        struct tm time;
                        memset(&time, 0, sizeof(struct tm));
                        time.tm_year = 1902 - 1900;
@@ -528,15 +482,10 @@ void CalDateTime::__setLimit()
                        time.tm_sec = 0;
                        __utime = CalLocaleManager::getInstance().getUtime(time);
                }
-       }
-       else if (getYear() > 2037)
-       {
-               if (__allday == true)
-               {
+       } else if (getYear() > 2037) {
+               if (__allday == true) {
                        set(2037,12,31);
-               }
-               else
-               {
+               } else {
                        struct tm time;
                        memset(&time, 0, sizeof(struct tm));
                        time.tm_year = 2037 - 1900;
index f06286d..f2f83bc 100644 (file)
@@ -68,14 +68,12 @@ int CalEditModel::__getInt(const char *key)
        int error = PREFERENCE_ERROR_NONE;
        bool check = false;
        error = preference_is_existing(key, &check);
-       if (PREFERENCE_ERROR_NONE == error && !check)
-       {
+       if (PREFERENCE_ERROR_NONE == error && !check) {
                __setInt(key, CAL_EDIT_SETTING_INT_DEFAULT);
        }
 
        error = preference_get_int(key, &value);
-       if (error != PREFERENCE_ERROR_NONE)
-       {
+       if (error != PREFERENCE_ERROR_NONE) {
                WERROR("preference_get_int(%s) is failed(%x)", key, error);
                return -1;
        } else
@@ -93,8 +91,7 @@ void CalEditModel::__setInt(const char *key, int value)
 
 const char* CalEditModel::__getKey(CalEditExpandField field)
 {
-       switch (field)
-       {
+       switch (field) {
        case TIME_ZONE:
                return CAL_EDIT_KEY_PREFIX "time_zone" CAL_EDIT_KEY_SUFFIX;
        case LOCATION:
index 68b7fb5..f8d8f4d 100644 (file)
@@ -25,19 +25,13 @@ CalInstanceSchedule::CalInstanceSchedule(calendar_record_h record) :
        char *view_uri = NULL;
        int error = CALENDAR_ERROR_NONE;
        error =  calendar_record_get_uri_p(record, &view_uri);
-       if (error == CALENDAR_ERROR_NONE)
-       {
-               if(g_strcmp0(view_uri, _calendar_instance_utime_calendar_book_extended._uri) == 0)
-               {
+       if (error == CALENDAR_ERROR_NONE) {
+               if(g_strcmp0(view_uri, _calendar_instance_utime_calendar_book_extended._uri) == 0) {
                        __type = CalSchedule::INSTANCE_NORMAL;
-               }
-               else if(g_strcmp0(view_uri, _calendar_instance_localtime_calendar_book_extended._uri) == 0)
-               {
+               } else if(g_strcmp0(view_uri, _calendar_instance_localtime_calendar_book_extended._uri) == 0) {
                        __type = CalSchedule::INSTANCE_ALLDAY;
                }
-       }
-       else
-       {
+       } else {
                WASSERT(0);
        }
 
@@ -557,8 +551,7 @@ static calendar_filter_h __createWritableOnlyFilter(const char* filter_uri, unsi
                if (calendar_book_id != DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID) {
                        error = calendar_filter_add_int(writable_filter, property_id, CALENDAR_MATCH_EQUAL, calendar_book_id);
                        c_warn_if(error != CALENDAR_ERROR_NONE, "calendar_filter_add_int() is failed(%x)", error);
-               }
-               else {
+               } else {
                        calendar_book_id = previous_book_id;
                }
 
index de4b993..7ef3480 100644 (file)
@@ -98,8 +98,7 @@ CalLocaleManager::~CalLocaleManager()
        if (__patternGenerator)
                i18n_udatepg_destroy(__patternGenerator);
 
-       for (auto it=__mapFormat.begin(); it!=__mapFormat.end(); ++it)
-       {
+       for (auto it=__mapFormat.begin(); it!=__mapFormat.end(); ++it) {
                i18n_udate_format_h dateFormat= it->second;
                i18n_udate_destroy(dateFormat);
        }
@@ -140,8 +139,7 @@ bool CalLocaleManager::isRTL()
 {
        WENTER();
        Evas_BiDi_Direction bidi = EVAS_BIDI_DIRECTION_NATURAL;
-       if(__obj)
-       {
+       if(__obj) {
                const char *type = evas_object_type_get(__obj);
                if(type && strstr(type, "text"))
                        bidi = evas_object_text_direction_get(__obj);
@@ -149,8 +147,7 @@ bool CalLocaleManager::isRTL()
                {
                        char *locale = NULL;
                        int value = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
-                       if(value == SYSTEM_SETTINGS_ERROR_NONE && locale)
-                       {
+                       if(value == SYSTEM_SETTINGS_ERROR_NONE && locale) {
                                /*
                                "ar" - Arabic
                                "dv" - Divehi
@@ -186,14 +183,12 @@ void CalLocaleManager::setTimeZone(const std::string &timeZone)
 {
        WENTER();
 
-       if (timeZone.empty())
-       {
+       if (timeZone.empty()) {
                WERROR("input timezone is empty");
                return;
        }
 
-       if (timeZone.compare(__tzid)== 0)
-       {
+       if (timeZone.compare(__tzid)== 0) {
                return;
        }
 
@@ -231,8 +226,7 @@ void CalLocaleManager::updateRegion(void)
 
        i18n_udatepg_create(__locale.c_str(), &__patternGenerator);
 
-       for (auto it=__mapFormat.begin(); it!=__mapFormat.end(); ++it)
-       {
+       for (auto it=__mapFormat.begin(); it!=__mapFormat.end(); ++it) {
                i18n_udate_format_h dateFormat= it->second;
                i18n_udate_destroy(dateFormat);
        }
@@ -269,8 +263,7 @@ void CalLocaleManager::getDateTimeText(const char* timezone, const DateFormat df
 {
        WENTER();
 
-       if (timezone == NULL || (timezone != NULL && __tzid.compare(timezone) == 0) )
-       {
+       if (timezone == NULL || (timezone != NULL && __tzid.compare(timezone) == 0) ) {
                getDateTimeText(df, tf, dt, text);
        }
 
@@ -300,8 +293,7 @@ void CalLocaleManager::getDateText(const DateFormat dateFormat, const CalDate &d
 {
        WENTER();
 
-       if (dateFormat == DATEFORMAT_NONE || dateFormat == DATEFORMAT_END)
-       {
+       if (dateFormat == DATEFORMAT_NONE || dateFormat == DATEFORMAT_END) {
                WERROR("invalid input");
                return;
        }
@@ -348,8 +340,7 @@ i18n_ucalendar_h CalLocaleManager::__getUcal(const std::string &tzid)
        const char* locale;
        i18n_ulocale_get_default(&locale);
        status = i18n_ucalendar_create(utf16_timezone, -1, locale, I18N_UCALENDAR_GREGORIAN , &cal);
-       if (status)
-       {
+       if (status) {
                WERROR("i18n_ucalendar_create got an error : %d", status);
                return NULL;
        }
@@ -375,15 +366,12 @@ void CalLocaleManager::__getLocale(std::string &localeStr)
 
        split_str = g_strsplit(locale,".", 0);
 
-       for(ptr = split_str; *ptr; ptr++)
-       {
+       for(ptr = split_str; *ptr; ptr++) {
                count++;
        }
 
-       if(count == 2)
-       {
-               if(!strcmp(split_str[1], "UTF-8"))
-               {
+       if(count == 2) {
+               if(!strcmp(split_str[1], "UTF-8")) {
                        str = g_strdup_printf("%s", split_str[0]);
                        free(locale);
                        WDEBUG("dest_locale:%s", str);
@@ -391,17 +379,13 @@ void CalLocaleManager::__getLocale(std::string &localeStr)
                        localeStr = str;
                        free(str);
                        return ;
-               }
-               else
-               {
+               } else {
                        g_strfreev(split_str);
                        localeStr = locale;
                        free(locale);
                        return ;
                }
-       }
-       else
-       {
+       } else {
                g_strfreev(split_str);
                localeStr = locale;
                free(locale);
@@ -413,8 +397,7 @@ void CalLocaleManager::__getLocale(std::string &localeStr)
 const i18n_udate_format_h CalLocaleManager::__getUDateFormat(const DateFormat df, const TimeFormat tf)
 {
        WENTER();
-       if (__patternGenerator == NULL)
-       {
+       if (__patternGenerator == NULL) {
                WASSERT(__patternGenerator);
        }
        char buf[1024];
@@ -435,8 +418,7 @@ const i18n_udate_format_h CalLocaleManager::__getUDateFormat(const DateFormat df
 
        std::string formatString = buf;
        auto it = __mapFormat.find(formatString);
-       if (it == __mapFormat.end())
-       {
+       if (it == __mapFormat.end()) {
                i18n_uchar custom_format[DATETIME_BUFFER]={0};
                int32_t bestPatternLength, bestPatternCapacity;
                i18n_udate_format_h formatter;
@@ -454,9 +436,7 @@ const i18n_udate_format_h CalLocaleManager::__getUDateFormat(const DateFormat df
                __mapFormat.insert(std::pair<std::string,i18n_udate_format_h>(formatString, formatter));
 
                return formatter;
-       }
-       else
-       {
+       } else {
                return it->second;
        }
 }
@@ -464,8 +444,7 @@ const i18n_udate_format_h CalLocaleManager::__getUDateFormat(const DateFormat df
 i18n_udate_format_h CalLocaleManager::__getUDateFormat(const char* timezone, const DateFormat df, const TimeFormat tf)
 {
        WENTER();
-       if (__patternGenerator == NULL)
-       {
+       if (__patternGenerator == NULL) {
                WASSERT(__patternGenerator);
        }
        char buf[1024];
@@ -515,15 +494,12 @@ long long int CalLocaleManager::getUtimeFromTm(const char *timezone, const struc
 {
        WENTER();
 
-       if (timezone == NULL || !strcmp(timezone, __tzid.c_str()))
-       {
+       if (timezone == NULL || !strcmp(timezone, __tzid.c_str())) {
                __setUCalendar(__cal, &tm);
                i18n_udate date;
                i18n_ucalendar_get_milliseconds(__cal, &date);
                return ms2sec(date);
-       }
-       else
-       {
+       } else {
                i18n_ucalendar_h ucal = __getUcal(timezone);
                __setUCalendar(ucal, &tm);
 
@@ -537,13 +513,10 @@ long long int CalLocaleManager::getUtimeFromTm(const char *timezone, const struc
 void CalLocaleManager::getTmFromUtime(const char *timezone, const long long int utime, struct tm &tm)
 {
        WENTER();
-       if (timezone == NULL || !strcmp(timezone, __tzid.c_str()))
-       {
+       if (timezone == NULL || !strcmp(timezone, __tzid.c_str())) {
                i18n_ucalendar_set_milliseconds(__cal, sec2ms(utime));
                __getUCalendar(__cal, &tm);
-       }
-       else
-       {
+       } else {
                i18n_ucalendar_h ucal = __getUcal(timezone);
                i18n_ucalendar_set_milliseconds(ucal, sec2ms(utime));
                __getUCalendar(ucal, &tm);
@@ -554,15 +527,12 @@ void CalLocaleManager::getTmFromUtime(const char *timezone, const long long int
 int CalLocaleManager::getDayOfWeekInMonth(const char *timezone, const long long int utime)
 {
        WENTER();
-       if (timezone == NULL || !strcmp(timezone, __tzid.c_str()))
-       {
+       if (timezone == NULL || !strcmp(timezone, __tzid.c_str())) {
                i18n_ucalendar_set_milliseconds(__cal, sec2ms(utime));
                int32_t result = 0;
                i18n_ucalendar_get(__cal, I18N_UCALENDAR_DAY_OF_WEEK_IN_MONTH, &result);
                return (int)result;
-       }
-       else
-       {
+       } else {
                int dayOfWeek = 0;
                i18n_ucalendar_h ucal = __getUcal(timezone);
                i18n_ucalendar_set_milliseconds(ucal, sec2ms(utime));
@@ -576,15 +546,12 @@ const char* CalLocaleManager::getWeekdayText(const char *timezone, const long lo
 {
        WENTER();
        static char weeks[7][3] = {"SU", "MO", "TU", "WE", "TH", "FR", "SA"};
-       if (timezone == NULL || !strcmp(timezone, __tzid.c_str()))
-       {
+       if (timezone == NULL || !strcmp(timezone, __tzid.c_str())) {
                i18n_ucalendar_set_milliseconds(__cal, sec2ms(utime));
                int wday = 0;
                i18n_ucalendar_get(__cal, I18N_UCALENDAR_DAY_OF_WEEK, &wday);
                return weeks[wday - 1];
-       }
-       else
-       {
+       } else {
                i18n_ucalendar_h ucal = __getUcal(timezone);
                i18n_ucalendar_set_milliseconds(ucal, sec2ms(utime));
                int wday = 0;
@@ -609,15 +576,12 @@ const char* CalLocaleManager::getWeekdayShortText(int weekday)
 int CalLocaleManager::getWeekday(const char *timezone, const long long int utime)
 {
        WENTER();
-       if (timezone == NULL || !strcmp(timezone, __tzid.c_str()))
-       {
+       if (timezone == NULL || !strcmp(timezone, __tzid.c_str())) {
                i18n_ucalendar_set_milliseconds(__cal, sec2ms(utime));
                int wday = 0;
                i18n_ucalendar_get(__cal, I18N_UCALENDAR_DAY_OF_WEEK, &wday);
                return (wday-1);
-       }
-       else
-       {
+       } else {
                i18n_ucalendar_h ucal = __getUcal(timezone);
                i18n_ucalendar_set_milliseconds(ucal, sec2ms(utime));
                int wday = 0;
@@ -692,8 +656,7 @@ void CalLocaleManager::__setUCalendar(i18n_ucalendar_h calendar, const struct tm
 
        status = i18n_ucalendar_set_date_time(calendar, tm->tm_year+1900, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
 
-       if(status != I18N_ERROR_NONE)
-       {
+       if(status != I18N_ERROR_NONE) {
                WDEBUG("i18n_ucalendar_set_date_time() is fail. error:%d", status);
                WDEBUG("tm->tm_year:%d, tm->tm_mon:%d, tm->tm_mday:%d, tm->tm_hour:%d, tm->tm_min:%d,  tm->tm_sec:%d ", tm->tm_year, tm->tm_mon, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
        }
@@ -781,8 +744,7 @@ void CalLocaleManager::__initWeekday()
        // get Sunday
        CalDate date(2013,12,1);
 
-       for(int i=0; i < 7; i++)
-       {
+       for(int i=0; i < 7; i++) {
                getDateText(CalLocaleManager::DATEFORMAT_2, date, __weekdayText[i]);
                getDateText(CalLocaleManager::DATEFORMAT_17, date, __weekdayShortText[i]);
                date.incrementDay();
index 6d4c12a..3aff706 100644 (file)
@@ -33,17 +33,13 @@ CalOriginalSchedule::CalOriginalSchedule(calendar_record_h record) :
        char *view_uri = NULL;
        int error = CALENDAR_ERROR_NONE;
        error =  calendar_record_get_uri_p(record, &view_uri);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WASSERT(0);
        }
 
-       if(g_strcmp0(view_uri, _calendar_event._uri) == 0)
-       {
+       if(g_strcmp0(view_uri, _calendar_event._uri) == 0) {
                __type = CalSchedule::ORIGINAL;
-       }
-       else
-       {
+       } else {
                __type = CalSchedule::INVALID;
        }
 
@@ -63,8 +59,7 @@ CalOriginalSchedule::CalOriginalSchedule(const CalOriginalSchedule& obj) :
 const CalOriginalSchedule& CalOriginalSchedule::operator=(const CalOriginalSchedule& obj)
 {
        CalSchedule::operator=(obj);
-       if (this != &obj)
-       {
+       if (this != &obj) {
                __repeat = obj.__repeat;
        }
        return *this;
@@ -101,8 +96,7 @@ void CalOriginalSchedule::setRepeat(const CalScheduleRepeat& repeat)
        __repeat = repeat;
 
        // set record
-       switch(repeat.unitType)
-       {
+       switch(repeat.unitType) {
        case CalScheduleRepeat::UnitType::ONE_TIME:
        {
                error = calendar_record_set_int(getRecord(), _calendar_event.freq, CALENDAR_RECURRENCE_NONE);
@@ -121,42 +115,35 @@ void CalOriginalSchedule::setRepeat(const CalScheduleRepeat& repeat)
                if (error != CALENDAR_ERROR_NONE) break;
                std::string byday;
 
-               if (repeat.unitInfo.weekly.selected[0] == true)
-               {
+               if (repeat.unitInfo.weekly.selected[0] == true) {
                        byday.append("SU");
                }
-               if (repeat.unitInfo.weekly.selected[1] == true)
-               {
+               if (repeat.unitInfo.weekly.selected[1] == true) {
                        if (!byday.empty())
                                byday.append(",");
                        byday.append("MO");
                }
-               if (repeat.unitInfo.weekly.selected[2] == true)
-               {
+               if (repeat.unitInfo.weekly.selected[2] == true) {
                        if (!byday.empty())
                                byday.append(",");
                        byday.append("TU");
                }
-               if (repeat.unitInfo.weekly.selected[3] == true)
-               {
+               if (repeat.unitInfo.weekly.selected[3] == true) {
                        if (!byday.empty())
                                byday.append(",");
                        byday.append("WE");
                }
-               if (repeat.unitInfo.weekly.selected[4] == true)
-               {
+               if (repeat.unitInfo.weekly.selected[4] == true) {
                        if (!byday.empty())
                                byday.append(",");
                        byday.append("TH");
                }
-               if (repeat.unitInfo.weekly.selected[5] == true)
-               {
+               if (repeat.unitInfo.weekly.selected[5] == true) {
                        if (!byday.empty())
                                byday.append(",");
                        byday.append("FR");
                }
-               if (repeat.unitInfo.weekly.selected[6] == true)
-               {
+               if (repeat.unitInfo.weekly.selected[6] == true) {
                        if (!byday.empty())
                                byday.append(",");
                        byday.append("SA");
@@ -172,12 +159,9 @@ void CalOriginalSchedule::setRepeat(const CalScheduleRepeat& repeat)
                        error = calendar_record_get_caltime(getRecord(), _calendar_event.start_time, &start);
                        WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
                        CalDateTime dtTime;
-                       if (start.type == CALENDAR_TIME_UTIME)
-                       {
+                       if (start.type == CALENDAR_TIME_UTIME) {
                                dtTime.set(start.time.utime);
-                       }
-                       else
-                       {
+                       } else {
                                dtTime.set(start.time.date.year,start.time.date.month,start.time.date.mday);
                        }
                        // TODO check
@@ -191,8 +175,7 @@ void CalOriginalSchedule::setRepeat(const CalScheduleRepeat& repeat)
 
                error = calendar_record_set_int(getRecord(), _calendar_event.freq, CALENDAR_RECURRENCE_MONTHLY);
                if (error != CALENDAR_ERROR_NONE) {WERROR("fail");break;}
-               if (repeat.unitInfo.monthly.type == CalScheduleRepeat::MonthlyType::WEEKDAY)
-               {
+               if (repeat.unitInfo.monthly.type == CalScheduleRepeat::MonthlyType::WEEKDAY) {
                        CalDateTime start(__repeat.startDate.year, __repeat.startDate.month, __repeat.startDate.mday);
                        int weekNum = CalLocaleManager::getInstance().getDayOfWeekInMonth(NULL, start.getUtimeFromTm());
 
@@ -207,9 +190,7 @@ void CalOriginalSchedule::setRepeat(const CalScheduleRepeat& repeat)
                        error = calendar_record_set_str(getRecord(), _calendar_event.bymonthday, "");
                        if (error != CALENDAR_ERROR_NONE) break;
 
-               }
-               else
-               {
+               } else {
                        char bymonthday[WEEKDAY_BUFFER];
                        // TODO check local mday
                        snprintf(bymonthday, sizeof(bymonthday), "%d", __repeat.unitInfo.monthly.date.mday);
@@ -231,12 +212,9 @@ void CalOriginalSchedule::setRepeat(const CalScheduleRepeat& repeat)
                        error = calendar_record_get_caltime(getRecord(), _calendar_event.start_time, &start);
                        WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
                        CalDateTime dtTime;
-                       if (start.type == CALENDAR_TIME_UTIME)
-                       {
+                       if (start.type == CALENDAR_TIME_UTIME) {
                                dtTime.set(start.time.utime);
-                       }
-                       else
-                       {
+                       } else {
                                dtTime.set(start.time.date.year,start.time.date.month,start.time.date.mday);
                        }
                        // TODO check
@@ -272,8 +250,7 @@ void CalOriginalSchedule::setRepeat(const CalScheduleRepeat& repeat)
                WERROR("set fail");
 
        // TODO until..
-       switch(repeat.untilType)
-       {
+       switch(repeat.untilType) {
        case CalScheduleRepeat::UntilType::DUE_DATE:
                error = calendar_record_set_int(getRecord(), _calendar_event.range_type, CALENDAR_RANGE_UNTIL);
                if (error != CALENDAR_ERROR_NONE) break;
@@ -281,8 +258,7 @@ void CalOriginalSchedule::setRepeat(const CalScheduleRepeat& repeat)
                calendar_time_s startTime;
                error = calendar_record_get_caltime(getRecord(), _calendar_event.start_time, &startTime);
                if (error != CALENDAR_ERROR_NONE) break;
-               if (startTime.type == CALENDAR_TIME_UTIME)
-               {
+               if (startTime.type == CALENDAR_TIME_UTIME) {
                        struct tm startTm;
                        CalLocaleManager::getInstance().getTmFromUtime(getTimeZone(),startTime.time.utime, startTm);
                        startTm.tm_year = repeat.untilInfo.date.year - 1900;
@@ -290,9 +266,7 @@ void CalOriginalSchedule::setRepeat(const CalScheduleRepeat& repeat)
                        startTm.tm_mday = repeat.untilInfo.date.mday;
                        untilTime.type = CALENDAR_TIME_UTIME;
                        untilTime.time.utime = CalLocaleManager::getInstance().getUtimeFromTm(getTimeZone(),startTm);
-               }
-               else
-               {
+               } else {
                        untilTime.type = CALENDAR_TIME_LOCALTIME;
                        untilTime.time.date.year = repeat.untilInfo.date.year;
                        untilTime.time.date.month = repeat.untilInfo.date.month;
@@ -455,8 +429,7 @@ void CalOriginalSchedule::updateRepeat(void)
        int value = 0;
        error = calendar_record_get_int(getRecord(), _calendar_event.freq, &value);
        WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
-       switch(value)
-       {
+       switch(value) {
        default:
        case CALENDAR_RECURRENCE_NONE:
                __repeat.unitType = CalScheduleRepeat::UnitType::ONE_TIME;
@@ -470,32 +443,25 @@ void CalOriginalSchedule::updateRepeat(void)
                        char *byday = NULL;
                        error = calendar_record_get_str_p(getRecord(), _calendar_event.byday, &byday);
                        WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
-                       if (strstr(byday, "SU") != NULL)
-                       {
+                       if (strstr(byday, "SU") != NULL) {
                                __repeat.unitInfo.weekly.selected[0] = true;
                        }
-                       if (strstr(byday, "MO") != NULL)
-                       {
+                       if (strstr(byday, "MO") != NULL) {
                                __repeat.unitInfo.weekly.selected[1] = true;
                        }
-                       if (strstr(byday, "TU") != NULL)
-                       {
+                       if (strstr(byday, "TU") != NULL) {
                                __repeat.unitInfo.weekly.selected[2] = true;
                        }
-                       if (strstr(byday, "WE") != NULL)
-                       {
+                       if (strstr(byday, "WE") != NULL) {
                                __repeat.unitInfo.weekly.selected[3] = true;
                        }
-                       if (strstr(byday, "TH") != NULL)
-                       {
+                       if (strstr(byday, "TH") != NULL) {
                                __repeat.unitInfo.weekly.selected[4] = true;
                        }
-                       if (strstr(byday, "FR") != NULL)
-                       {
+                       if (strstr(byday, "FR") != NULL) {
                                __repeat.unitInfo.weekly.selected[5] = true;
                        }
-                       if (strstr(byday, "SA") != NULL)
-                       {
+                       if (strstr(byday, "SA") != NULL) {
                                __repeat.unitInfo.weekly.selected[6] = true;
                        }
                }
@@ -507,13 +473,10 @@ void CalOriginalSchedule::updateRepeat(void)
                        char *bymonthday = NULL;
                        error = calendar_record_get_str_p(getRecord(), _calendar_event.byday, &byday);
                        WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
-                       if (byday && strlen(byday) > 0)
-                       {
+                       if (byday && strlen(byday) > 0) {
                                // byday
                                __repeat.unitInfo.monthly.type = CalScheduleRepeat::MonthlyType::WEEKDAY;
-                       }
-                       else
-                       {
+                       } else {
                                // bymonthday
                                error = calendar_record_get_str(getRecord(), _calendar_event.bymonthday, &bymonthday);
                                WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
@@ -524,12 +487,9 @@ void CalOriginalSchedule::updateRepeat(void)
                        error = calendar_record_get_caltime(getRecord(), _calendar_event.start_time, &start);
                        WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
                        CalDateTime dtTime;
-                       if (start.type == CALENDAR_TIME_UTIME)
-                       {
+                       if (start.type == CALENDAR_TIME_UTIME) {
                                dtTime.set(start.time.utime);
-                       }
-                       else
-                       {
+                       } else {
                                dtTime.set(start.time.date.year,start.time.date.month,start.time.date.mday);
                        }
                        __repeat.unitInfo.monthly.date.year = dtTime.getYear();
@@ -549,8 +509,7 @@ void CalOriginalSchedule::updateRepeat(void)
        error = calendar_record_get_int(getRecord(), _calendar_event.range_type, &value);
        WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
 
-       switch(value)
-       {
+       switch(value) {
        case CALENDAR_RANGE_UNTIL:
                {
                        __repeat.untilType = CalScheduleRepeat::UntilType::DUE_DATE;
@@ -558,24 +517,18 @@ void CalOriginalSchedule::updateRepeat(void)
                        error = calendar_record_get_caltime(getRecord(), _calendar_event.until_time, &untilTime);
                        WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
                        int year = 0, month = 0, mday = 0;
-                       if (untilTime.type == CALENDAR_TIME_UTIME)
-                       {
-                               if (CALENDAR_RECORD_NO_UNTIL == untilTime.time.utime)
-                               {
+                       if (untilTime.type == CALENDAR_TIME_UTIME) {
+                               if (CALENDAR_RECORD_NO_UNTIL == untilTime.time.utime) {
                                        __repeat.untilType = CalScheduleRepeat::UntilType::FOREVER;
                                        break;
-                               }
-                               else
-                               {
+                               } else {
                                        CalDateTime dateTime;
                                        dateTime.set(untilTime.time.utime);
                                        year = dateTime.getYear();
                                        month = dateTime.getMonth();
                                        mday = dateTime.getMday();
                                }
-                       }
-                       else
-                       {
+                       } else {
                                year = untilTime.time.date.year;
                                month = untilTime.time.date.month;
                                mday = untilTime.time.date.mday;
@@ -599,18 +552,14 @@ void CalOriginalSchedule::updateRepeat(void)
                break;
        }
 
-       do
-       {
+       do {
                calendar_time_s start;
                error = calendar_record_get_caltime(getRecord(), _calendar_event.start_time, &start);
                WPRET_M((error!=CALENDAR_ERROR_NONE), "fail");
                CalDateTime dtTime;
-               if (start.type == CALENDAR_TIME_UTIME)
-               {
+               if (start.type == CALENDAR_TIME_UTIME) {
                        dtTime.set(start.time.utime);
-               }
-               else
-               {
+               } else {
                        dtTime.set(start.time.date.year,start.time.date.month,start.time.date.mday);
                }
                __repeat.startDate.year = dtTime.getYear();
@@ -655,8 +604,7 @@ int CalOriginalSchedule::addReminder(const CalScheduleReminder& reminder)
        WPRET_VM((NULL==alarmHandle), -1, "convert fail");
 
        error = calendar_record_add_child_record(getRecord(), _calendar_event.calendar_alarm, alarmHandle);
-       if (error != CALENDAR_ERROR_NONE)
-       {
+       if (error != CALENDAR_ERROR_NONE) {
                WERROR("add child fail");
                calendar_record_destroy(alarmHandle, true);
                return -1;
@@ -694,8 +642,7 @@ void CalOriginalSchedule::__convertAlarmToReminder(const calendar_record_h alarm
                WDEBUG("[tick:%d][tickUnit:%d]",tick,reminder.unitType);
        }
 
-       switch(tickUnit)
-       {
+       switch(tickUnit) {
        case CALENDAR_ALARM_TIME_UNIT_SPECIFIC:
                // TODO specipic
                reminder.unitType = CalScheduleReminder::UnitType::MIN;
@@ -725,14 +672,12 @@ void CalOriginalSchedule::__convertReminderToAlarm(const CalScheduleReminder& re
 {
        int error = CALENDAR_ERROR_NONE;
 
-       do
-       {
+       do {
                int tick = reminder.unitValue;
                WDEBUG("[tick:%d][tickUnit:%d]",tick,reminder.unitType);
 
                int tickUnit = 0;
-               switch(reminder.unitType)
-               {
+               switch(reminder.unitType) {
                case CalScheduleReminder::UnitType::NONE:
                        tickUnit = CALENDAR_ALARM_NONE;
                        break;
@@ -774,15 +719,13 @@ void CalOriginalSchedule::initialize(const char* tzid, const CalDateTime& startT
 {
        int error = 0;
        WPRET_M((getRecord()==NULL), "fail");
-       do
-       {
+       do {
                CalDateTime bufTime = startTime;
                setStart(bufTime);
                bufTime.addHours(1);
                setEnd(bufTime);
 
-               if (tzid)
-               {
+               if (tzid) {
                        error = calendar_record_set_str(getRecord(), _calendar_event.start_tzid, tzid);
                        if (error != CALENDAR_ERROR_NONE) break;
                        error = calendar_record_set_str(getRecord(), _calendar_event.end_tzid, tzid);
index 3e58364..feb5f8a 100644 (file)
@@ -44,8 +44,7 @@ CalSchedule::CalSchedule(calendar_record_h record)
 
 CalSchedule::~CalSchedule()
 {
-       if (__record)
-       {
+       if (__record) {
                calendar_record_destroy(__record, true);
        }
 
@@ -55,8 +54,7 @@ CalSchedule::~CalSchedule()
 
 CalSchedule::CalSchedule(const CalSchedule& obj)
 {
-       if (obj.__record)
-       {
+       if (obj.__record) {
                calendar_record_h clone;
                calendar_record_clone(obj.__record, &clone);
                __record = clone;
@@ -70,10 +68,8 @@ CalSchedule::CalSchedule(const CalSchedule& obj)
 
 const CalSchedule& CalSchedule::operator=(const CalSchedule& obj)
 {
-       if (this != &obj)
-       {
-               if (obj.__record)
-               {
+       if (this != &obj) {
+               if (obj.__record) {
                        calendar_record_h clone;
                        calendar_record_clone(obj.__record, &clone);
                        __record = clone;
@@ -113,20 +109,16 @@ void CalSchedule::getFromToDisplayString(std::string& text) const
        std::string displayMyTz;
        std::string displayCalendarTz;
        CalLocaleManager::getInstance().getDisplayTextTimeZone(calendarTimezone, displayCalendarTz);
-       if (myTimezone)
-       {
+       if (myTimezone) {
                CalLocaleManager::getInstance().getDisplayTextTimeZone(myTimezone, displayMyTz);
        }
 
        if (startTime.isAllDay( )== true ||
                        myTimezone == NULL ||
                        g_str_has_prefix(myTimezone, TIMEZONE_ETC_GMT) ||
-                       displayCalendarTz.compare(displayMyTz) == 0)
-       {
+                       displayCalendarTz.compare(displayMyTz) == 0) {
                __getFromToDisplayString(NULL, startTime, endTime, text);
-       }
-       else
-       {
+       } else {
                text = displayCalendarTz + "<br/>";
 
                std::string stringTemp;
@@ -156,12 +148,9 @@ void CalSchedule::getFromToString(std::string& text) const
        if (startTime.isAllDay( )== true ||
                        myTimezone == NULL ||
                        g_strcmp0(myTimezone, TIMEZONE_ETC_GMT) == 0 ||
-                       calendarTimezone.compare(myTimezone) == 0)
-       {
+                       calendarTimezone.compare(myTimezone) == 0) {
                __getFromToString(NULL, startTime, endTime, text);
-       }
-       else
-       {
+       } else {
                std::string stringTemp;
                CalLocaleManager::getInstance().getDisplayTextTimeZone(calendarTimezone, stringTemp);
 
@@ -203,48 +192,33 @@ void CalSchedule::__getFromToString(const char* timezone, const CalDateTime& sta
        start.getString(startText);
        end.getString(endText);
 
-       if (start.isAllDay())
-       {
-               if (start.isSameDay(end))
-               {
+       if (start.isAllDay()) {
+               if (start.isSameDay(end)) {
                        text = startText;
-               }
-               else
-               {
+               } else {
                        text = startText + " - \r\n" + endText;
                }
-       }
-       else
-       {
-               if (timezone)
-               {
+       } else {
+               if (timezone) {
                        CalDateTime startInTimeZone(start, timezone);
                        CalDateTime endInTimeZone(end, timezone);
 
                        startInTimeZone.getString(startText);
                        endInTimeZone.getString(endText);
 
-                       if (startInTimeZone.isSameDay(endInTimeZone))
-                       {
+                       if (startInTimeZone.isSameDay(endInTimeZone)) {
                                std::string endNoDataText;
                                endInTimeZone.getTimeString(endNoDataText);
                                text = startText + " - " + endNoDataText;
-                       }
-                       else
-                       {
+                       } else {
                                text = startText + " - \r\n" + endText;
                        }
-               }
-               else
-               {
-                       if (start.isSameDay(end))
-                       {
+               } else {
+                       if (start.isSameDay(end)) {
                                std::string endNoDataText;
                                end.getTimeString(endNoDataText);
                                text = startText + " - " + endNoDataText;
-                       }
-                       else
-                       {
+                       } else {
                                text = startText + " - \r\n" + endText;
                        }
                }
@@ -256,8 +230,7 @@ void CalSchedule::__getFromToDisplayString(const char* timezone, const CalDateTi
        std::string bufString;
        __getFromToString(timezone, start, end, bufString);
        char *markupStr = elm_entry_utf8_to_markup(bufString.c_str());
-       if (!markupStr)
-       {
+       if (!markupStr) {
                WERROR("elm_entry_utf8_to_markup(%s) failed : %s", bufString.c_str(), strerror(errno));
                return;
        }
@@ -288,8 +261,7 @@ void CalSchedule::__trimNewLine(char* str) const
        if (str == NULL)
                return;
 
-       while (*str != '\0')
-       {
+       while (*str != '\0') {
                if(*str == '\n' || *str == '\r')
                        *str = ' ';
                str++;
@@ -302,35 +274,27 @@ void CalSchedule::__checkSummary(const int stringLimit, int len, std::string& te
        std::string utfStr = text;
 
        int bookId = getBookId();
-       if (DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID == bookId)
-       {
+       if (DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID == bookId) {
                // TODO
                char *syncData1 = NULL;
                const unsigned int syncData1propertyId = getSyncData1Property();
                int error = calendar_record_get_str_p(__record, syncData1propertyId, &syncData1);
                WPRET_M((error != CALENDAR_ERROR_NONE),"get_str fail");
 
-               if (!strcmp(syncData1, "anniversary"))
-               {
+               if (!strcmp(syncData1, "anniversary")) {
                        char buffer[summaryBuffer]={0};
                        snprintf(buffer, sizeof( buffer)-1, _L_("IDS_CLD_MBODY_PSS_ANNIVERSARY"), utfStr.c_str());
                        utfStr.clear();
                        utfStr.append(buffer);
-               }
-               else if (!strcmp(syncData1, "birthday"))
-               {
+               } else if (!strcmp(syncData1, "birthday")) {
                        char buffer[summaryBuffer]={0};
                        snprintf(buffer, sizeof( buffer)-1, _L_("IDS_CLD_BODY_PSS_BIRTHDAY_ABB"), utfStr.c_str());
                        utfStr.clear();
                        utfStr.append(buffer);
-               }
-               else if (!strcmp(syncData1, "other"))
-               {
+               } else if (!strcmp(syncData1, "other")) {
                        utfStr.append(". ");
                        utfStr.append(_L_("IDS_CLD_BODY_OTHER_M_EVENT_TYPE"));
-               }
-               else
-               {
+               } else {
                        utfStr.append(". ");
                        utfStr.append(syncData1);
                }
@@ -341,8 +305,7 @@ void CalSchedule::__checkSummary(const int stringLimit, int len, std::string& te
                utfStr.resize(stringLimit);
 
        char *markupStr = elm_entry_utf8_to_markup(utfStr.c_str());
-       if (!markupStr)
-       {
+       if (!markupStr) {
                WERROR("elm_entry_utf8_to_markup(%s) failed : %s", utfStr.c_str(), strerror(errno));
                return;
        }
@@ -354,8 +317,7 @@ void CalSchedule::getDisplaySummary(const int stringLimit, std::string& text) co
 {
        const char *summary = getSummary();
 
-       if (summary == NULL || strlen(summary) == 0)
-       {
+       if (summary == NULL || strlen(summary) == 0) {
                text = _L_("IDS_CLD_MBODY_MY_EVENT");
                return ;
        }
@@ -368,17 +330,14 @@ void CalSchedule::getDisplayTrimedSummary(const int stringLimit, std::string& te
 {
        const char* summary = getSummary();
 
-       if (summary == NULL || strlen(summary) == 0)
-       {
+       if (summary == NULL || strlen(summary) == 0) {
                text = _L_("IDS_CLD_MBODY_MY_EVENT");
                return ;
        }
 
-       if(__trimedSummary == NULL)
-       {
+       if(__trimedSummary == NULL) {
                __trimedSummary = strdup(summary);
-               if (!__trimedSummary)
-               {
+               if (!__trimedSummary) {
                        WERROR("strdup(%s) failed : %s", summary, strerror(errno));
                        return;
                }
@@ -413,8 +372,7 @@ void CalSchedule::__checkLocation(const int stringLimit, int len, std::string& t
                str.resize(stringLimit);
 
        char *markupStr = elm_entry_utf8_to_markup(str.c_str());
-       if (!markupStr)
-       {
+       if (!markupStr) {
                WERROR("elm_entry_utf8_to_markup(%s) failed : %s", str.c_str(), strerror(errno));
                return;
        }
@@ -426,8 +384,7 @@ void CalSchedule::getDisplayLocation(const int stringLimit, std::string& text) c
 {
        const char* location = getLocation();
 
-       if (location == NULL)
-       {
+       if (location == NULL) {
                text.clear();
                return ;
        }
@@ -441,13 +398,10 @@ void CalSchedule::getDisplayTrimedLocation(const int stringLimit, std::string& t
 {
        const char* location = getLocation();
 
-       if (location)
-       {
-               if(__trimedLocation == NULL)
-               {
+       if (location) {
+               if(__trimedLocation == NULL) {
                        __trimedLocation = strdup(location);
-                       if (!__trimedLocation)
-                       {
+                       if (!__trimedLocation) {
                                WERROR("strdup(%s) failed : %s", location, strerror(errno));
                                return;
                        }
@@ -455,9 +409,7 @@ void CalSchedule::getDisplayTrimedLocation(const int stringLimit, std::string& t
                }
                text = __trimedLocation;
                __checkLocation(stringLimit, (int)strlen(location), text);
-       }
-       else
-       {
+       } else {
                text.clear();
                WERROR("Location could not be taken from getLocation() function");
        }
@@ -508,15 +460,13 @@ void CalSchedule::getDisplayDescription(std::string& text) const
        char *tmp = NULL;
        int error = calendar_record_get_str_p(__record, propertyId, &tmp);
        WPRET_M((error != CALENDAR_ERROR_NONE),"get_str fail");
-       if (tmp == NULL)
-       {
+       if (tmp == NULL) {
                text.clear();
                return ;
        }
        std::string utfStr = tmp;
        char *markupStr = elm_entry_utf8_to_markup(utfStr.c_str());
-       if (!markupStr)
-       {
+       if (!markupStr) {
                WERROR("elm_entry_utf8_to_markup(%s) failed : %s", utfStr.c_str(), strerror(errno));
                return;
        }
@@ -560,13 +510,10 @@ const bool CalSchedule::hasReminder() const
 {
        const unsigned int propertyId = getHasReminderProperty();
        int count = 0;
-       if (propertyId == 0)
-       {
+       if (propertyId == 0) {
                WASSERT(0);
                return false;
-       }
-       else
-       {
+       } else {
                int error = calendar_record_get_int(__record, propertyId, &count);
                WPRET_VM((error != CALENDAR_ERROR_NONE),false,"get id fail");
        }
@@ -585,13 +532,10 @@ const bool CalSchedule::hasRepeat() const
 {
        const unsigned int propertyId = getHasRepeatProperty();
        int count = 0;
-       if (propertyId == 0)
-       {
+       if (propertyId == 0) {
                const CalScheduleRepeat repeat = getRepeat();
                return (repeat.unitType == CalScheduleRepeat::UnitType::ONE_TIME) ? false : true;
-       }
-       else
-       {
+       } else {
                int error = calendar_record_get_int(__record, propertyId, &count);
                WPRET_VM((error != CALENDAR_ERROR_NONE),false,"get id fail");
        }
@@ -957,8 +901,7 @@ void CalSchedule::__removeDuplicateReminder(void) const
        error = calendar_record_get_child_record_count(record, _calendar_event.calendar_alarm, &alarmCount);
        if (alarmCount <= 1)
                return;
-       for (i=0;i<(alarmCount-1);i++)
-       {
+       for (i=0;i<(alarmCount-1);i++) {
                calendar_record_h reminder = NULL;
                int tick = 0, tickUnit = 0;
                error = calendar_record_get_child_record_at_p(record,_calendar_event.calendar_alarm, i, &reminder);
@@ -967,17 +910,14 @@ void CalSchedule::__removeDuplicateReminder(void) const
                        continue;
                }
                error = calendar_record_get_int(reminder, _calendar_alarm.tick, &tick);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        WERROR("fail");
                }
                error = calendar_record_get_int(reminder, _calendar_alarm.tick_unit, &tickUnit);
-               if (error != CALENDAR_ERROR_NONE)
-               {
+               if (error != CALENDAR_ERROR_NONE) {
                        WERROR("fail");
                }
-               for (j = i+1;j<alarmCount;j++)
-               {
+               for (j = i+1;j<alarmCount;j++) {
                        calendar_record_h reminder2 = NULL;
                        int tick2 = 0, tickUnit2 = 0;
                        error = calendar_record_get_child_record_at_p(record,_calendar_event.calendar_alarm, j, &reminder2);
@@ -986,17 +926,14 @@ void CalSchedule::__removeDuplicateReminder(void) const
                                continue;
                        }
                        error = calendar_record_get_int(reminder2, _calendar_alarm.tick, &tick2);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                WERROR("fail");
                        }
                        error = calendar_record_get_int(reminder2, _calendar_alarm.tick_unit, &tickUnit2);
-                       if (error != CALENDAR_ERROR_NONE)
-                       {
+                       if (error != CALENDAR_ERROR_NONE) {
                                WERROR("fail");
                        }
-                       if (tick == tick2 && tickUnit == tickUnit2)
-                       {
+                       if (tick == tick2 && tickUnit == tickUnit2) {
                                error = calendar_record_remove_child_record(record,_calendar_event.calendar_alarm, reminder2);
                                if ((error!=CALENDAR_ERROR_NONE)) {
                                        WERROR("fail");
@@ -1005,8 +942,7 @@ void CalSchedule::__removeDuplicateReminder(void) const
                                WDEBUG("remove duplicate reminder(%d --)",alarmCount);
                                alarmCount--;
                                error = calendar_record_destroy(reminder2, true);
-                               if (error != CALENDAR_ERROR_NONE)
-                               {
+                               if (error != CALENDAR_ERROR_NONE) {
                                        WERROR("fail");
                                }
                                break;
index 6a95ee2..6ea17ff 100644 (file)
@@ -45,8 +45,7 @@ CalScheduleReminder::CalScheduleReminder(const CalScheduleReminder& obj)
 
 const CalScheduleReminder& CalScheduleReminder::operator=(const CalScheduleReminder& obj)
 {
-       if (this != &obj)
-       {
+       if (this != &obj) {
                unitType = obj.unitType;
                unitValue = obj.unitValue;
                isCustom = obj.isCustom;
@@ -61,13 +60,11 @@ const bool CalScheduleReminder::operator<(const CalScheduleReminder& obj) const
 
 void CalScheduleReminder::getString(std::string& text) const
 {
-       if (unitType == NONE)
-       {
+       if (unitType == NONE) {
                text = _L_("IDS_CLD_OPT_NONE");
                return;
        }
-       if (unitType != NONE && unitValue == 0)
-       {
+       if (unitType != NONE && unitValue == 0) {
                text = _L_("IDS_CLD_OPT_AT_START_TIME_ABB");
                return;
        }
@@ -99,8 +96,7 @@ void CalScheduleReminder::getString(std::string& text) const
                displayUnitValue = minuteValue;
        }
 
-       switch(displayUnitType)
-       {
+       switch(displayUnitType) {
        case MIN:
                if (displayUnitValue == 0)
                        snprintf(buffer, sizeof(buffer)-1, _L_("IDS_CLD_OPT_AT_START_TIME_ABB"));
index 39da7dd..f78fc9c 100644 (file)
@@ -52,8 +52,7 @@ CalScheduleRepeat::CalScheduleRepeat( const CalScheduleRepeat& obj)
 
 const CalScheduleRepeat& CalScheduleRepeat::operator=( const CalScheduleRepeat& obj)
 {
-       if (this != &obj)
-       {
+       if (this != &obj) {
                unitType = obj.unitType;
                unitInterval = obj.unitInterval;
                unitInfo = obj.unitInfo;
@@ -118,8 +117,7 @@ void CalScheduleRepeat::setDefault(const UnitType type, const CalDateTime& start
 
 void CalScheduleRepeat::getString(std::string& text) const
 {
-       switch(unitType)
-       {
+       switch(unitType) {
        default:
        //case CalScheduleRepeat::UnitType::ONE_TIME:
        //      return "One-time event";
@@ -162,8 +160,7 @@ void CalScheduleRepeat::getItemString(const Date date, const char* timezone, std
                if (!isWeek) {
                        char monthText[DATE_BUFFER] = {0};
                        if(isMonth) {
-                               switch(unitInfo.monthly.type)
-                               {
+                               switch(unitInfo.monthly.type) {
                                        default:
                                        case CalScheduleRepeat::MONTHDAY:
                                                break;
@@ -236,8 +233,7 @@ void CalScheduleRepeat::getItemString(const Date date, const char* timezone, std
                snprintf(textDate, sizeof(textDate),"%d/%d/%d", untilInfo.date.mday, untilInfo.date.month, untilInfo.date.year);
                snprintf(textUntilDate, sizeof(textUntilDate), _L_("IDS_CLD_BODY_UNTIL_PS_LC"), textDate);
 
-               switch(untilType)
-               {
+               switch(untilType) {
                        default:
                        case CalScheduleRepeat::UntilType::FOREVER:
                                snprintf(buffer, sizeof(buffer),"%s", textUntilType);
@@ -255,8 +251,7 @@ void CalScheduleRepeat::getItemString(const Date date, const char* timezone, std
 
 void CalScheduleRepeat::getRepeatString(const Date date, const char* timezone, std::string& text) const
 {
-       switch(unitType)
-       {
+       switch(unitType) {
        default:
        case CalScheduleRepeat::UnitType::ONE_TIME:
                getItemString(date, timezone, text, _L_("IDS_CLD_OPT_NEVER"), NULL, false, false, true);
@@ -280,8 +275,7 @@ void CalScheduleRepeat::getMonthlyUnitInfoString(const Date date, const char* ti
 {
        char buffer[SCHEDULE_BUFFER] = {0};
        WDEBUG("Monthly[%d/%d/%d", date.year, date.month, date.mday);
-       if (type == CalScheduleRepeat::MonthlyType::WEEKDAY)
-       {
+       if (type == CalScheduleRepeat::MonthlyType::WEEKDAY) {
                CalDateTime start(date.year, date.month, date.mday);
                int weekNum = CalLocaleManager::getInstance().getDayOfWeekInMonth(timezone, start.getUtimeFromTm());
                std::string text;
@@ -310,9 +304,7 @@ void CalScheduleRepeat::getMonthlyUnitInfoString(const Date date, const char* ti
                                snprintf(buffer, sizeof(buffer), _L_("IDS_CLD_OPT_EVERY_FIFTH_PS_ABB"), text.c_str());
                                break;
                }
-       }
-       else
-       {
+       } else {
                // ex) On day 14
                snprintf(buffer, sizeof(buffer), _L_("IDS_CLD_OPT_ON_DAY_PD"), date.mday);
        }
@@ -323,8 +315,7 @@ void CalScheduleRepeat::getMonthlyUnitInfoString(const Date date, const char* ti
 void CalScheduleRepeat::print() const
 {
        WDEBUG("unitInterval[%d]",unitInterval);
-       switch(unitType)
-       {
+       switch(unitType) {
        default:
        case CalScheduleRepeat::UnitType::DAY:
                WDEBUG("DAY");
@@ -355,8 +346,7 @@ void CalScheduleRepeat::print() const
                break;
        }
 
-       switch(untilType)
-       {
+       switch(untilType) {
        case CalScheduleRepeat::UntilType::FOREVER:
                WDEBUG("FOREVER");
                break;
index c78e5f8..cbeb176 100644 (file)
@@ -65,88 +65,58 @@ void CalSettingsManager::init()
        WENTER();
 
        bool check = false;
-       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_FIRST_DAY_OF_WEEK_KEY, &check))
-       {
-               if (check)
-               {
+       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_FIRST_DAY_OF_WEEK_KEY, &check)) {
+               if (check) {
                        WDEBUG(CAL_PREFERENCE_EXISTS, CAL_SETTING_FIRST_DAY_OF_WEEK_KEY);
-               }
-               else
-               {
+               } else {
                        WDEBUG(CAL_PREFERENCE_DOES_NOT_EXIST, CAL_SETTING_FIRST_DAY_OF_WEEK_KEY);
                        setFirstDayOfWeek(CAL_SETTING_FIRST_DAY_OF_WEEK_DEFAULT);
                }
-       }
-       else
-       {
+       } else {
                WERROR(CAL_PREFERENCE_READ_ERROR, CAL_SETTING_FIRST_DAY_OF_WEEK_KEY);
        }
 
-       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_TIME_ZONE_KEY, &check))
-       {
-               if (check)
-               {
+       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_TIME_ZONE_KEY, &check)) {
+               if (check) {
                        WDEBUG(CAL_PREFERENCE_EXISTS, CAL_SETTING_TIME_ZONE_KEY);
-               }
-               else
-               {
+               } else {
                        WDEBUG(CAL_PREFERENCE_DOES_NOT_EXIST, CAL_SETTING_TIME_ZONE_KEY);
                        setTimeZone(CAL_SETTING_TIME_ZONE_DEFAULT);
                }
-       }
-       else
-       {
+       } else {
                WERROR(CAL_PREFERENCE_READ_ERROR, CAL_SETTING_TIME_ZONE_KEY);
        }
 
-       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_SELECT_ALERT_TYPE_KEY, &check))
-       {
-               if (check)
-               {
+       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_SELECT_ALERT_TYPE_KEY, &check)) {
+               if (check) {
                        WDEBUG(CAL_PREFERENCE_EXISTS, CAL_SETTING_SELECT_ALERT_TYPE_KEY);
-               }
-               else
-               {
+               } else {
                        WDEBUG(CAL_PREFERENCE_DOES_NOT_EXIST, CAL_SETTING_SELECT_ALERT_TYPE_KEY);
                        setAlertType(CAL_SETTING_SELECT_ALERT_TYPE_DEFAULT);
                }
-       }
-       else
-       {
+       } else {
                WERROR(CAL_PREFERENCE_READ_ERROR, CAL_SETTING_SELECT_ALERT_TYPE_KEY);
        }
 
-       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_LOCK_TIME_ZONE_KEY, &check))
-       {
-               if (check)
-               {
+       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_LOCK_TIME_ZONE_KEY, &check)) {
+               if (check) {
                        WDEBUG(CAL_PREFERENCE_EXISTS, CAL_SETTING_LOCK_TIME_ZONE_KEY);
-               }
-               else
-               {
+               } else {
                        WDEBUG(CAL_PREFERENCE_DOES_NOT_EXIST, CAL_SETTING_LOCK_TIME_ZONE_KEY);
                        setLockTimeZone(CAL_SETTING_LOCK_TIME_ZONE_DEFAULT);
                }
-       }
-       else
-       {
+       } else {
                WERROR(CAL_PREFERENCE_READ_ERROR, CAL_SETTING_LOCK_TIME_ZONE_KEY);
        }
 
-       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_LAST_USED_CALENDAR_KEY, &check))
-       {
-               if (check)
-               {
+       if (PREFERENCE_ERROR_NONE == preference_is_existing(CAL_SETTING_LAST_USED_CALENDAR_KEY, &check)) {
+               if (check) {
                        WDEBUG(CAL_PREFERENCE_EXISTS, CAL_SETTING_LAST_USED_CALENDAR_KEY);
-               }
-               else
-               {
+               } else {
                        WDEBUG(CAL_PREFERENCE_DOES_NOT_EXIST, CAL_SETTING_LAST_USED_CALENDAR_KEY);
                        setLastUsedCalendar(CAL_SETTING_LAST_USED_CALENDAR_DEFAULT);
                }
-       }
-       else
-       {
+       } else {
                WERROR(CAL_PREFERENCE_READ_ERROR, CAL_SETTING_LAST_USED_CALENDAR_KEY);
        }
 
@@ -169,11 +139,9 @@ void CalSettingsManager::__changedCb(const char *key, void *userData)
        WENTER();
 
        CalEvent::Type* type = (CalEvent::Type*)&userData;
-       if (*type == CalEvent::TIME_CHANGED)
-       {
+       if (*type == CalEvent::TIME_CHANGED) {
                bool isLockTimeZone = CalSettingsManager::getInstance().getLockTimeZone();
-               if (isLockTimeZone == false)
-               {
+               if (isLockTimeZone == false) {
                        return;
                }
        }
@@ -203,8 +171,7 @@ void CalSettingsManager::__setHour24(void)
        // Indicates whether the 24-hour clock is used. If the value is false, the 12-hour clock is used
        //TODO: why set function using get function. Where is used bool parameter __isHour24?
        int error = system_settings_get_value_bool(SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR, &__isHour24);
-       if(error != SYSTEM_SETTINGS_ERROR_NONE)
-       {
+       if(error != SYSTEM_SETTINGS_ERROR_NONE) {
                WERROR("get SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR [%d]", error);
        }
 
@@ -217,19 +184,15 @@ void CalSettingsManager::__setLocaleTimeZone(void)
        bool isLockTimeZone = getLockTimeZone();
        std::string timeZone;
        std::string localeTimeZone;
-       if (isLockTimeZone == false)
-       {
+       if (isLockTimeZone == false) {
                getDeviceTimeZone(timeZone);
-       }
-       else
-       {
+       } else {
                getTimeZone(timeZone);
        }
 
        CalLocaleManager::getInstance().getTimeZone(localeTimeZone);
 
-       if (timeZone.compare(localeTimeZone) != 0)
-       {
+       if (timeZone.compare(localeTimeZone) != 0) {
                CalLocaleManager::getInstance().setTimeZone(timeZone);
        }
 
@@ -262,8 +225,7 @@ int CalSettingsManager::getFirstDayOfWeek(void)
        WENTER();
        int value = CAL_SETTING_FIRST_DAY_OF_WEEK_DEFAULT;
        int error = preference_get_int(CAL_SETTING_FIRST_DAY_OF_WEEK_KEY, &value);
-       if (error != PREFERENCE_ERROR_NONE)
-       {
+       if (error != PREFERENCE_ERROR_NONE) {
                WERROR("preference_get_int is failed(%x)", error);
                return CAL_SETTING_FIRST_DAY_OF_WEEK_DEFAULT;
        }
@@ -279,13 +241,10 @@ bool CalSettingsManager::getLockTimeZone(void)
        int error = 0;
 
        error = preference_get_int(CAL_SETTING_LOCK_TIME_ZONE_KEY, &value);
-       if (error != PREFERENCE_ERROR_NONE)
-       {
+       if (error != PREFERENCE_ERROR_NONE) {
                WERROR("preference_get_int is failed (%x)", error);
                return CAL_SETTING_LOCK_TIME_ZONE_DEFAULT;
-       }
-       else
-       {
+       } else {
                return (value != 0) ? true : false;
        }
        WLEAVE();
@@ -298,20 +257,16 @@ void CalSettingsManager::getTimeZone(std::string& timezone)
        bool isLockTimeZone = getLockTimeZone();
 
        int error = preference_get_string(CAL_SETTING_TIME_ZONE_KEY, &value);
-       if (error != PREFERENCE_ERROR_NONE || value == NULL || strlen(value) == 0 || isLockTimeZone == false)
-       {
+       if (error != PREFERENCE_ERROR_NONE || value == NULL || strlen(value) == 0 || isLockTimeZone == false) {
                std::string deviceTz;
                getDeviceTimeZone(deviceTz);
                setTimeZone(deviceTz);
                timezone = deviceTz;
-       }
-       else
-       {
+       } else {
                timezone = value;
        }
 
-       if (value)
-       {
+       if (value) {
                free(value);
                value = NULL;
        }
@@ -324,8 +279,7 @@ CalSettingsManager::AlertType CalSettingsManager::getAlertType(void)
        int error = 0;
 
        error = preference_get_int(CAL_SETTING_SELECT_ALERT_TYPE_KEY, &value);
-       if (error != PREFERENCE_ERROR_NONE)
-       {
+       if (error != PREFERENCE_ERROR_NONE) {
                WERROR("preference_get_int is failed(%x)", error);
                return CAL_SETTING_SELECT_ALERT_TYPE_DEFAULT;
        }
@@ -341,20 +295,15 @@ const char* CalSettingsManager::getAlertSound(void)
 
        __alertSound = std::string();
        int error = preference_get_string(CAL_SETTING_NOTIFICATION_SOUND_KEY, &value);
-       if (error != PREFERENCE_ERROR_NONE || value == NULL || strlen(value) == 0)
-       {
+       if (error != PREFERENCE_ERROR_NONE || value == NULL || strlen(value) == 0) {
                error = system_settings_get_value_string(SYSTEM_SETTINGS_KEY_SOUND_NOTIFICATION, &value);
                WDEBUG("get default ringtone(%s)", value);
-               if (error != SYSTEM_SETTINGS_ERROR_NONE)
-               {
+               if (error != SYSTEM_SETTINGS_ERROR_NONE) {
                        WERROR("CalSettingsManager::getAlertSound fail");
                        __alertSound = CAL_SETTING_NOTIFICATION_SILENT;
-               }
-               else
+               } else
                        __alertSound = value;
-       }
-       else
-       {
+       } else {
                __alertSound = value;
        }
 
@@ -371,8 +320,7 @@ int CalSettingsManager::getLastUsedCalendar(void)
        int error = 0;
 
        error = preference_get_int(CAL_SETTING_LAST_USED_CALENDAR_KEY, &value);
-       if (error != PREFERENCE_ERROR_NONE)
-       {
+       if (error != PREFERENCE_ERROR_NONE) {
                WERROR("preference_get_int is failed(%x)", error);
                return CAL_SETTING_LAST_USED_CALENDAR_DEFAULT;
        }
@@ -386,8 +334,7 @@ void CalSettingsManager::setFirstDayOfWeek(const FirstDayOfWeekType type)
        int error = 0;
 
        error = preference_set_int(CAL_SETTING_FIRST_DAY_OF_WEEK_KEY, type);
-       if (error != PREFERENCE_ERROR_NONE)
-       {
+       if (error != PREFERENCE_ERROR_NONE) {
                WERROR("preference_set_int is failed(%x)", error);
        }
 }
@@ -399,17 +346,14 @@ void CalSettingsManager::setLockTimeZone(const bool isOn)
        int value = isOn ? 1 : 0;
 
        error = preference_set_int(CAL_SETTING_LOCK_TIME_ZONE_KEY, value);
-       if (error != PREFERENCE_ERROR_NONE)
-       {
+       if (error != PREFERENCE_ERROR_NONE) {
                WERROR("preference_set_int is failed(%x)", error);
        }
 
-       if (isOn)
-       {
+       if (isOn) {
                char *value = NULL;
                int error = preference_get_string(CAL_SETTING_TIME_ZONE_KEY, &value);
-               if (error != PREFERENCE_ERROR_NONE || value == NULL || strlen(value) == 0)
-               {
+               if (error != PREFERENCE_ERROR_NONE || value == NULL || strlen(value) == 0) {
                        // this is first set
                        std::string deviceTz;
                        getDeviceTimeZone(deviceTz);
index e46daad..2d553cb 100644 (file)
@@ -35,8 +35,7 @@ CalSimpleListProvider::~CalSimpleListProvider()
 void CalSimpleListProvider::prefetch(bool fillBothBuffers)
 {
        __fetcher.prefetch(fillBothBuffers);
-       if (!__currentSchedule)
-       {
+       if (!__currentSchedule) {
                loadNext();
        }
 }
@@ -55,8 +54,7 @@ void CalSimpleListProvider::loadNext()
 {
        calendar_record_h record = __fetcher.getNext();
 
-       if (record == NULL)
-       {
+       if (record == NULL) {
                __currentSchedule = nullptr;
                return;
        }
index 7d788ac..04a97cf 100644 (file)
@@ -42,8 +42,7 @@ __CalTimeZoneImpl::__CalTimeZoneImpl(const std::string& tz)
 {
        int error = I18N_ERROR_NONE;
        error = i18n_timezone_create(&__timezone, tz.c_str());
-       if (error != I18N_ERROR_NONE)
-       {
+       if (error != I18N_ERROR_NONE) {
                WERROR("i18n_timezone_create error");
                throw std::runtime_error("i18n_timezone_create error");
        }
@@ -69,13 +68,10 @@ std::string __CalTimeZoneImpl::__getTzEasName() const
        char *tzname = NULL;
        int error = I18N_ERROR_NONE;
        error = i18n_timezone_get_display_name(__timezone, &tzname);
-       if (error != I18N_ERROR_NONE)
-       {
+       if (error != I18N_ERROR_NONE) {
                WERROR("i18n_timezone_get_display_name error");
                free(tzname);
-       }
-       else
-       {
+       } else {
                tzEasName = tzname;
        }
 
@@ -89,12 +85,9 @@ std::string __CalTimeZoneImpl::getScreenName() const
        std::string tz_offset = __getTzOffset(__offset);
        std::string tz_name = __getTzEasName();
 
-       if (__tz.find(TIMEZONE_UNKNOWN) == std::string::npos)
-       {
+       if (__tz.find(TIMEZONE_UNKNOWN) == std::string::npos) {
                snprintf(timezone, TIMEZONE_LABEL_BUFFER, "(%s) %s", tz_offset.c_str(), tz_name.c_str());
-       }
-       else
-       {
+       } else {
                snprintf(timezone, TIMEZONE_LABEL_BUFFER, "(%s)", tz_offset.c_str());
        }
        return timezone;
@@ -131,8 +124,7 @@ std::string __CalTimeZoneImpl::__getTzByOffsetFromWordclock(int offset) const
        sqlite3_stmt *stmt = NULL;
        int ret = 0;
 
-       do
-       {
+       do {
                ret = sqlite3_open(CAL_WORLDCLOCK_DB_FILE, &db);
                if (ret != SQLITE_OK) {
                        WERROR("sqlite3_open(%s) is failed(%d)", CAL_WORLDCLOCK_DB_FILE, ret);
@@ -144,22 +136,16 @@ std::string __CalTimeZoneImpl::__getTzByOffsetFromWordclock(int offset) const
                int timezone_offset_hour = timezone_offset / TIME_MINUTES_IN_HOUR;
                int timezone_offset_minute = timezone_offset % TIME_MINUTES_IN_HOUR;
 
-               if (0 <= timezone_offset_hour)
-               {
+               if (0 <= timezone_offset_hour) {
                        snprintf(offset_hour, sizeof(offset_hour), "+%d", timezone_offset_hour);
-               }
-               else
-               {
+               } else {
                        snprintf(offset_hour, sizeof(offset_hour), "%d", timezone_offset_hour);
                }
 
                char offset[offset_buffer];
-               if (timezone_offset_minute)
-               {
+               if (timezone_offset_minute) {
                        snprintf(offset, sizeof(offset), "GMT%s:%d", offset_hour, timezone_offset_minute);
-               }
-               else
-               {
+               } else {
                        snprintf(offset, sizeof(offset), "GMT%s", offset_hour);
                }
 
@@ -167,8 +153,7 @@ std::string __CalTimeZoneImpl::__getTzByOffsetFromWordclock(int offset) const
                snprintf(query, QUERY_DB_BUFFER, CAL_WORLDCLOCK_DB_TIMEZONE_QUERY, offset);
 
                ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
-               if (ret != SQLITE_OK)
-               {
+               if (ret != SQLITE_OK) {
                        WERROR("sqlite3_prepare_v2(%s) is failed(%d)", query, ret);
                        break;
                }
@@ -176,8 +161,7 @@ std::string __CalTimeZoneImpl::__getTzByOffsetFromWordclock(int offset) const
                ret = sqlite3_step(stmt);
                if (ret != SQLITE_ROW
                        && ret != SQLITE_OK
-                       && ret != SQLITE_DONE)
-               {
+                       && ret != SQLITE_DONE) {
                        WERROR("sqlite3_step is failed(%d) : %s", ret, sqlite3_errmsg(db));
                        break;
                }
@@ -186,12 +170,10 @@ std::string __CalTimeZoneImpl::__getTzByOffsetFromWordclock(int offset) const
        }
        while (0);
 
-       if (stmt)
-       {
+       if (stmt) {
                sqlite3_finalize(stmt);
        }
-       if (db)
-       {
+       if (db) {
                sqlite3_close(db);
        }
        return timeZone;
@@ -211,8 +193,7 @@ CalTimeZone::CalTimeZone(const CalTimeZone& obj)
 
 const CalTimeZone& CalTimeZone::operator=(const CalTimeZone& obj)
 {
-       if (this != &obj)
-       {
+       if (this != &obj) {
                __pv = obj.__pv;
        }
        return *this;
@@ -220,8 +201,7 @@ const CalTimeZone& CalTimeZone::operator=(const CalTimeZone& obj)
 
 std::string CalTimeZone::getString(LabelType typeFormat) const
 {
-       switch (typeFormat)
-       {
+       switch (typeFormat) {
        case TIMEZONE_TIZEN_FORMAT:
                return __pv->getTzDatabaseName();
                break;
index 15f649b..ab957e7 100644 (file)
@@ -161,44 +161,30 @@ void CalApp::onAppControl(app_control_h request, bool firstLaunch)
        char* viewParam = NULL;
        app_control_get_extra_data(request, CAL_APPSVC_PARAM_VIEW, &viewParam);
 
-       if (viewParam)
-       {
-               if (!strcmp(viewParam, CAL_APPSVC_PARAM_VIEW_MAIN))
-               {
+       if (viewParam) {
+               if (!strcmp(viewParam, CAL_APPSVC_PARAM_VIEW_MAIN)) {
                        __showMain(request, firstLaunch);
-               }
-               else if (!strcmp(viewParam, CAL_APPSVC_PARAM_VIEW_DETAIL))
-               {
+               } else if (!strcmp(viewParam, CAL_APPSVC_PARAM_VIEW_DETAIL)) {
                        __showDetail(request);
-               }
-               else
-               {
+               } else {
                        WASSERT(0);
                }
 
                free(viewParam);
-       }
-       else
-       {
-               if(firstLaunch)
-               {
+       } else {
+               if(firstLaunch) {
                        char* dateStringParam = NULL;
                        app_control_get_extra_data(request, CAL_APPSVC_PARAM_DATE, &dateStringParam);
 
-                       if(dateStringParam)
-                       {
+                       if(dateStringParam) {
                                CalDate date(dateStringParam);
                                free(dateStringParam);
 
                                naviframe.push(new CalMainView(date));
-                       }
-                       else
-                       {
+                       } else {
                                naviframe.push(new CalMainView(CalDate()));
                        }
-               }
-               else
-               {
+               } else {
                        CalEventManager::getInstance().resume();
 
                        CalEvent event(CalEvent::APP_RESUMED, CalEvent::REMOTE);
@@ -222,15 +208,11 @@ void CalApp::__showMain(app_control_h request, bool firstLaunch)
        CalNaviframe& naviframe = *(CalNaviframe*)getWindow()->getBaseUiObject();
 
        CalMainView* mainView = NULL;
-       if(!firstLaunch)
-       {
+       if(!firstLaunch) {
                WView* topView = naviframe.getTopView();
-               if(!topView || !strcmp(topView->getClassName(), "CalMainView"))
-               {
+               if(!topView || !strcmp(topView->getClassName(), "CalMainView")) {
                        mainView = (CalMainView*)topView;
-               }
-               else
-               {
+               } else {
                        WDEBUG("All stacked views will be destroyed");
                        naviframe.destroyAllViews();
                        CalEventManager::getInstance().clear();
@@ -241,33 +223,24 @@ void CalApp::__showMain(app_control_h request, bool firstLaunch)
        char* dateStringParam = NULL;
        app_control_get_extra_data(request, CAL_APPSVC_PARAM_DATE, &dateStringParam);
 
-       if(dateStringParam)
-       {
+       if(dateStringParam) {
                CalDate date(dateStringParam);
                WDEBUG("%s", date.dump().c_str());
                free(dateStringParam);
 
-               if (firstLaunch)
-               {
+               if (firstLaunch) {
                        mainView = new CalMainView(date);
                        naviframe.push(mainView);
                        mainView->focus(date);
-               }
-               else
-               {
-                       if(!mainView)
-                       {
+               } else {
+                       if(!mainView) {
                                WERROR("mainView is null");
                                elm_exit();
-                       }
-                       else
-                       {
+                       } else {
                                mainView->focus(date);
                        }
                }
-       }
-       else if(firstLaunch)
-       {
+       } else if(firstLaunch) {
                naviframe.push(new CalMainView(CalDate()));
        }
 }
@@ -286,14 +259,11 @@ void CalApp::__showDetail(app_control_h request)
        char* eventDateParam = NULL;
        app_control_get_extra_data(request, CAL_APPSVC_PARAM_DATE, &eventDateParam);
        std::shared_ptr<CalSchedule> schedule;
-       if(eventDateParam)
-       {
+       if(eventDateParam) {
                time_t timeFromParam = (time_t)atoll(eventDateParam);
                CalDateTime eventDate(*localtime(&timeFromParam));
                schedule = CalDataManager::getInstance().getInstanceSchedule(atoi(eventIdParam), eventDate);
-       }
-       else
-       {
+       } else {
                schedule = CalDataManager::getInstance().getSchedule(atoi(eventIdParam));
        }
 
index e73c90b..b955982 100644 (file)
@@ -89,8 +89,7 @@ void CalBookView::__update()
 {
        destroyPopup();
 
-       if(getNaviItem())
-       {
+       if(getNaviItem()) {
                elm_object_item_part_text_set(getNaviItem(), "elm.text.title", _L_("IDS_CLD_OPT_MANAGE_CALENDARS_ABB"));
        }
 
@@ -100,16 +99,13 @@ void CalBookView::__update()
        CalBookManager::getInstance().getBooks(__localBookMap);
 
        // My calendar books
-       for(auto it = __localBookMap.begin(); it != __localBookMap.end(); ++it)
-       {
+       for(auto it = __localBookMap.begin(); it != __localBookMap.end(); ++it) {
                auto node = it->second;
-               if(node && node->getStoreType() != CALENDAR_BOOK_TYPE_EVENT)
-               {
+               if(node && node->getStoreType() != CALENDAR_BOOK_TYPE_EVENT) {
                        continue;
                }
 
-               if(node->getIndex() != DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID)
-               {
+               if(node->getIndex() != DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID) {
                        CalDialogBookLocalItem* item = new CalDialogBookLocalItem(CalDialogBookLocalItem::LocalBookChange, node);
                        item->setSelectCb([this] (const std::shared_ptr<CalBook>& book) {
                                        CalBookManager::getInstance().updateBook(book);
@@ -121,12 +117,10 @@ void CalBookView::__update()
        }
 
        // My birthday books
-       for(auto it = __localBookMap.begin(); it != __localBookMap.end(); ++it)
-       {
+       for(auto it = __localBookMap.begin(); it != __localBookMap.end(); ++it) {
                auto node = it->second;
                WASSERT(node->getStoreType() == CALENDAR_BOOK_TYPE_EVENT);
-               if(node->getIndex() == DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID)
-               {
+               if(node->getIndex() == DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID) {
                        CalDialogBookLocalItem* item = new CalDialogBookLocalItem(CalDialogBookLocalItem::LocalBookChange,node);
                        item->setSelectCb([this] (const std::shared_ptr<CalBook>& book) {
                                        CalBookManager::getInstance().updateBook(book);
@@ -147,8 +141,7 @@ void CalBookView::onEvent(const CalEvent & event)
 {
        WENTER();
        WDEBUG("type = %u, source = %u", event.type, event.source);
-       switch (event.type)
-       {
+       switch (event.type) {
                case CalEvent::APP_PAUSED:
                case CalEvent::APP_RESUMED:
                case CalEvent::DB_CHANGED:
@@ -157,8 +150,7 @@ void CalBookView::onEvent(const CalEvent & event)
                case CalEvent::BOOK_DB_CHANGED:
                case CalEvent::TIME_CHANGED:
                case CalEvent::SETTING_CHANGED:
-                       if(event.source == CalEvent::REMOTE || getNaviItem() != elm_naviframe_top_item_get(getNaviframe()->getEvasObj()))
-                       {
+                       if(event.source == CalEvent::REMOTE || getNaviItem() != elm_naviframe_top_item_get(getNaviframe()->getEvasObj())) {
                                __update();
                        }
                        break;
index a044892..b55f85e 100644 (file)
@@ -43,31 +43,22 @@ Elm_Genlist_Item_Class* CalDialogBookLocalItem::getItemClassStatic()
 {
        WENTER();
        static Elm_Genlist_Item_Class itc = {}; // Implicitly 0-init in C++
-       if(__item_mode == LocalBookDisplay)
-       {
+       if(__item_mode == LocalBookDisplay) {
                itc.item_style = "1text.1colorbar";
-       }
-       else
-       {
+       } else {
                itc.item_style = "1text.1colorbar.1check";
        }
 
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
-               if(strcmp(part, "elm.text") == 0)
-               {
+               if(strcmp(part, "elm.text") == 0) {
                        CalDialogBookLocalItem* self = (CalDialogBookLocalItem*)data;
 
-                       if(self->__book->getIndex() == DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID)
-                       {
+                       if(self->__book->getIndex() == DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID) {
                                return strdup(_L_("IDS_CLD_BODY_CONTACTS_BIRTHDAYS_ABB"));
-                       }
-                       else if(self->__book->getIndex() == DEFAULT_EVENT_CALENDAR_BOOK_ID)
-                       {
+                       } else if(self->__book->getIndex() == DEFAULT_EVENT_CALENDAR_BOOK_ID) {
                                return strdup(_L_("IDS_CLD_OPT_MY_CALENDAR_ABB"));
-                       }
-                       else
-                       {
+                       } else {
                                return elm_entry_utf8_to_markup(self->__book->getName());
                        }
                }
@@ -76,23 +67,16 @@ Elm_Genlist_Item_Class* CalDialogBookLocalItem::getItemClassStatic()
 
        itc.func.content_get = [](void *data, Evas_Object *obj, const char *part)->Evas_Object*
        {
-               if(!strcmp(part, "elm.swallow.checkbox"))
-               {
+               if(!strcmp(part, "elm.swallow.checkbox")) {
                        CalDialogBookLocalItem *item = (CalDialogBookLocalItem *)data;
 
-                       if(item->__item_mode == LocalBookDisplay)
-                       {
+                       if(item->__item_mode == LocalBookDisplay) {
                                return NULL;
-                       }
-                       else if(item->__item_mode == LocalBookChange)
-                       {
+                       } else if(item->__item_mode == LocalBookChange) {
                                Evas_Object *check = elm_check_add(obj);
-                               if(item->__book->getVisibility())
-                               {
+                               if(item->__book->getVisibility()) {
                                        elm_check_state_set(check, EINA_TRUE);
-                               }
-                               else
-                               {
+                               } else {
                                        elm_check_state_set(check, EINA_FALSE);
                                }
                                evas_object_propagate_events_set(check, EINA_FALSE);
@@ -102,9 +86,7 @@ Elm_Genlist_Item_Class* CalDialogBookLocalItem::getItemClassStatic()
                                        }, item);
                                item->__check = check;
                                return check;
-                       }
-                       else if (item->__item_mode == LocalBookDelete)
-                       {
+                       } else if (item->__item_mode == LocalBookDelete) {
                                Evas_Object *check = elm_check_add(obj);
                                elm_check_state_set(check, EINA_FALSE);
                                evas_object_propagate_events_set(check, EINA_FALSE);
@@ -115,14 +97,11 @@ Elm_Genlist_Item_Class* CalDialogBookLocalItem::getItemClassStatic()
                                item->__check = check;
                                return check;
                        }
-               }
-               else if(!strcmp(part, "elm.swallow.color.bar"))
-               {
+               } else if(!strcmp(part, "elm.swallow.color.bar")) {
                        CalDialogBookLocalItem *item = (CalDialogBookLocalItem *)data;
 
                        if (item->__item_mode == LocalBookDisplay || item->__item_mode == LocalBookChange
-                               || item->__item_mode == LocalBookDelete ||  item->__item_mode == LocalBookOnlySelect)
-                       {
+                               || item->__item_mode == LocalBookDelete ||  item->__item_mode == LocalBookOnlySelect) {
                                Evas_Object* icon = evas_object_rectangle_add(evas_object_evas_get(obj));
                                evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
 
@@ -142,42 +121,28 @@ Elm_Genlist_Item_Class* CalDialogBookLocalItem::getItemClassStatic()
 
 void CalDialogBookLocalItem::onSelect()
 {
-       if(__item_mode == LocalBookDisplay)
-       {
-               if (__selectCb)
-               {
+       if(__item_mode == LocalBookDisplay) {
+               if (__selectCb) {
                        __selectCb(__book);
                }
-       }
-       else if(__item_mode == LocalBookChange)
-       {
+       } else if(__item_mode == LocalBookChange) {
                __book->setVisibility(!(__book->getVisibility()));
 
-               if(__book->getVisibility())
-               {
+               if(__book->getVisibility()) {
                        elm_check_state_set(__check, EINA_TRUE);
-               }
-               else
-               {
+               } else {
                        elm_check_state_set(__check, EINA_FALSE);
                }
 
-               if (__selectCb)
-               {
+               if (__selectCb) {
                        __selectCb(__book);
                }
-       }
-       else if(__item_mode == LocalBookOnlySelect)
-       {
-               if (__selectCb)
-               {
+       } else if(__item_mode == LocalBookOnlySelect) {
+               if (__selectCb) {
                        __selectCb(__book);
                }
-       }
-       else if(__item_mode == LocalBookDelete)
-       {
-               if (__deleteSelectCb)
-               {
+       } else if(__item_mode == LocalBookDelete) {
+               if (__deleteSelectCb) {
                        __deleteSelectCb(this);
                }
        }
@@ -185,8 +150,7 @@ void CalDialogBookLocalItem::onSelect()
 
 void CalDialogBookLocalItem::onCheckboxCb()
 {
-       if(__checkboxCb)
-       {
+       if(__checkboxCb) {
                __checkboxCb(this->getItemCheckState());
        }
 }
@@ -194,8 +158,7 @@ void CalDialogBookLocalItem::onCheckboxCb()
 
 bool CalDialogBookLocalItem::getItemCheckState()
 {
-       if(__check)
-       {
+       if(__check) {
                return elm_check_state_get(__check);
        }
 
@@ -204,8 +167,7 @@ bool CalDialogBookLocalItem::getItemCheckState()
 
 void CalDialogBookLocalItem::setItemCheckState(bool state)
 {
-       if(__check)
-       {
+       if(__check) {
                elm_check_state_set(__check, state);
        }
 }
index ab75fa8..6fd6ca4 100644 (file)
@@ -34,8 +34,7 @@ Elm_Genlist_Item_Class* CalDialogSimpleTitleItem::getItemClassStatic()
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogSimpleTitleItem *item = (CalDialogSimpleTitleItem*)data;
-               if (0 == strcmp(part, "elm.text"))
-               {
+               if (0 == strcmp(part, "elm.text")) {
                        return g_strdup(_L_G_(item->__title));
                }
                return NULL;
index 80bc2f6..421d264 100644 (file)
@@ -37,8 +37,7 @@ CalFilterView::CalFilterView(const char *name) : CalView(name),
 
 CalFilterView::~CalFilterView()
 {
-       if (__notificationTimer)
-       {
+       if (__notificationTimer) {
                ecore_timer_del(__notificationTimer);
                __notificationTimer = nullptr;
        }
@@ -52,8 +51,7 @@ Evas_Object *CalFilterView::onCreate(Evas_Object *parent, void *viewParam)
        evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
        elm_layout_file_set(layout, CalPath::getPath(CAL_EDJE).c_str(), "CalFilterView");
 
-       if(isBackButtonVisibile())
-       {
+       if(isBackButtonVisibile()) {
                Evas_Object *buttonBack = elm_button_add(layout);
                elm_object_style_set(buttonBack, "naviframe/back_btn/default");
                evas_object_size_hint_weight_set(buttonBack, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -78,8 +76,7 @@ Evas_Object *CalFilterView::onCreate(Evas_Object *parent, void *viewParam)
 void CalFilterView::onPushed(Elm_Object_Item *naviItem)
 {
        WENTER();
-       if(!__backButtonVisibility)
-       {
+       if(!__backButtonVisibility) {
                WDEBUG("Hide backButton");
                elm_layout_signal_emit(getEvasObj(), "searchbar,hide", "");
        }
@@ -89,8 +86,7 @@ void CalFilterView::onEvent(const CalEvent &event)
 {
        WENTER();
        WDEBUG("type = %u, source = %u", event.type, event.source);
-       switch (event.type)
-       {
+       switch (event.type) {
                case CalEvent::DB_CHANGED:
                case CalEvent::TIME_CHANGED:
                case CalEvent::LANGUAGE_CHANGED:
@@ -109,8 +105,7 @@ void CalFilterView::onDestroy()
 
        __deleteListModels();
 
-       if (!__isNoContents)
-       {
+       if (!__isNoContents) {
                evas_object_del(__noContents);
        }
 }
@@ -134,8 +129,7 @@ void CalFilterView::createList(EVENT_ITEM_ONSELECT_CB selectCb, bool useChecks)
 {
        WENTER();
 
-       if (__list)
-       {
+       if (__list) {
                delete __list;
                __list = NULL;
        }
@@ -166,12 +160,9 @@ Evas_Object *CalFilterView::createNoContent()
 void CalFilterView::showContent()
 {
        WENTER();
-       if (__list->isEmpty())
-       {
-               if (!__isNoContents)
-               {
-                       if (!__noContents)
-                       {
+       if (__list->isEmpty()) {
+               if (!__isNoContents) {
+                       if (!__noContents) {
                                __noContents = createNoContent();
                        }
                        elm_object_part_content_unset(getEvasObj(), "elm.swallow.content");
@@ -179,11 +170,8 @@ void CalFilterView::showContent()
                        evas_object_hide(__list->getEvasObj());
                        __isNoContents = true;
                }
-       }
-       else
-       {
-               if (__isNoContents)
-               {
+       } else {
+               if (__isNoContents) {
                        elm_object_part_content_unset(getEvasObj(), "elm.swallow.content");
                }
                elm_object_part_content_set(getEvasObj(), "elm.swallow.content", __list->getEvasObj());
@@ -208,8 +196,7 @@ CalUnderlineEditField *CalFilterView::createSearchBarEntry(Evas_Object *parent)
        searchBarEntry->setChangeCallback([this] (const char* text)->void
                {
                        WDEBUG("Search text: [%p] [%s]", text, text);
-                       if(text && strcasecmp(text, __searchText.c_str()))
-                       {
+                       if(text && strcasecmp(text, __searchText.c_str())) {
                                __searchText = text;
                                WDEBUG("Update list");
                                updateList();
@@ -218,8 +205,7 @@ CalUnderlineEditField *CalFilterView::createSearchBarEntry(Evas_Object *parent)
 
        searchBarEntry->setEntryMaxLenReachCallback([this]
                {
-                       if (__notificationTimer)
-                       {
+                       if (__notificationTimer) {
                                return;
                        }
 
@@ -241,8 +227,7 @@ CalUnderlineEditField *CalFilterView::createSearchBarEntry(Evas_Object *parent)
 void CalFilterView::updateList()
 {
        WENTER();
-       if(__list)
-       {
+       if(__list) {
                __deleteListModels();
 
                __list->updateSearchText(__searchText.c_str());
@@ -258,8 +243,7 @@ void CalFilterView::updateList()
 void CalFilterView::setFocusToSearchEntry()
 {
        WENTER();
-       if(__searchBarEntry)
-       {
+       if(__searchBarEntry) {
                __searchBarEntry->setFocusToEntry();
        }
        WLEAVE();
@@ -267,14 +251,12 @@ void CalFilterView::setFocusToSearchEntry()
 
 void CalFilterView::__deleteListModels()
 {
-       if(__forwardModel)
-       {
+       if(__forwardModel) {
                delete __forwardModel;
                __forwardModel = NULL;
        }
 
-       if(__backwardModel)
-       {
+       if(__backwardModel) {
                delete __backwardModel;
                __backwardModel = NULL;
        }
index a5599e7..b33737c 100644 (file)
@@ -57,13 +57,10 @@ Evas_Object* CalTimePickerPopup::__createContent(Evas_Object *parent)
        elm_object_part_content_set(layout, "elm.swallow.content", __dateTime);
        evas_object_show(layout);
 
-       if (CalSettingsManager::getInstance().isHour24())
-       {
+       if (CalSettingsManager::getInstance().isHour24()) {
                elm_object_style_set(__dateTime, "time_layout_24hr");
                elm_datetime_format_set(__dateTime, "%d/%b/%Y %H:%M");
-       }
-       else
-       {
+       } else {
                elm_object_style_set(__dateTime, "time_layout");
                elm_datetime_format_set(__dateTime, "%d/%b/%Y %I:%M %p");
        }
@@ -73,8 +70,7 @@ Evas_Object* CalTimePickerPopup::__createContent(Evas_Object *parent)
 
        elm_datetime_value_set(__dateTime, &time);
 
-       if(__isRepeat)
-       {
+       if(__isRepeat) {
                time.tm_hour = 0;
                time.tm_min = 0;
                elm_datetime_value_min_set(__dateTime, &time);
@@ -85,8 +81,7 @@ Evas_Object* CalTimePickerPopup::__createContent(Evas_Object *parent)
        setTextTranslatable(CALENDAR);
        elm_object_part_text_set(parent, "title,text", __title.c_str());
        addButton("IDS_CLD_BUTTON_CANCEL", NULL);
-       addButton("IDS_CLD_BUTTON_SET", [this](bool* destroyPopup)
-       {
+       addButton("IDS_CLD_BUTTON_SET", [this](bool* destroyPopup) {
                WHIT();
                struct tm time;
                elm_datetime_value_get(__dateTime, &time);
@@ -94,8 +89,7 @@ Evas_Object* CalTimePickerPopup::__createContent(Evas_Object *parent)
                CalDateTime newTime;
                newTime.set(time);
 
-               if(__changedCb)
-               {
+               if(__changedCb) {
                        __changedCb(newTime);
                }
 
index db35552..31b41f2 100644 (file)
@@ -37,25 +37,20 @@ CalUnderlineEditField::~CalUnderlineEditField()
 
 void CalUnderlineEditField::setText(const char* text)
 {
-       if (__entry)
-       {
+       if (__entry) {
                elm_entry_entry_set(__entry, text);
        }
 }
 
 void CalUnderlineEditField::setGuideText(const char* text, int font)
 {
-       if (__entry)
-       {
-               if(font)
-               {
+       if (__entry) {
+               if(font) {
                        std::stringstream ss;
                        ss << "<p font_size=" << font << ">" << _L_(text) << "</p>";
 
                        elm_object_part_text_set(__entry, "elm.guide", ss.str().c_str());
-               }
-               else
-               {
+               } else {
                        elm_object_part_text_set(__entry, "elm.guide", _L_(text));
                }
        }
@@ -63,8 +58,7 @@ void CalUnderlineEditField::setGuideText(const char* text, int font)
 
 void CalUnderlineEditField::setFontSize(int size)
 {
-       if (!__entry)
-       {
+       if (!__entry) {
                return;
        }
 
@@ -76,8 +70,7 @@ void CalUnderlineEditField::setFontSize(int size)
 
 const char* CalUnderlineEditField::getText()
 {
-       if (!__entry)
-       {
+       if (!__entry) {
                return NULL;
        }
 
@@ -86,8 +79,7 @@ const char* CalUnderlineEditField::getText()
 
 const char* CalUnderlineEditField::getGuideText()
 {
-       if (!__entry)
-       {
+       if (!__entry) {
                return NULL;
        }
 
@@ -106,10 +98,8 @@ void CalUnderlineEditField::setCompleteCallback(std::function<void ()> completeC
 
 void CalUnderlineEditField::setFocusToEntry(bool showKeypadIntentionally)
 {
-       if (__entry)
-       {
-               if (showKeypadIntentionally)
-               {
+       if (__entry) {
+               if (showKeypadIntentionally) {
                        elm_entry_input_panel_show_on_demand_set(__entry, EINA_FALSE);
                }
 
@@ -120,19 +110,14 @@ void CalUnderlineEditField::setFocusToEntry(bool showKeypadIntentionally)
 
 void CalUnderlineEditField::setEntryReturnKeyType(ReturnKeyType type)
 {
-       if (__multiLine)
-       {
+       if (__multiLine) {
                return;
        }
 
-       if (__entry)
-       {
-               if (type == DONE)
-               {
+       if (__entry) {
+               if (type == DONE) {
                        elm_entry_input_panel_return_key_type_set(__entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
-               }
-               else
-               {
+               } else {
                        elm_entry_input_panel_return_key_type_set(__entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT);
                }
        }
@@ -140,8 +125,7 @@ void CalUnderlineEditField::setEntryReturnKeyType(ReturnKeyType type)
 
 void CalUnderlineEditField::setEntryMaxLenReachCallback(std::function<void ()> maxLenReachCallback, unsigned int maxLength)
 {
-       if (__entry)
-       {
+       if (__entry) {
                static Elm_Entry_Filter_Limit_Size limit_filter_data = {0};
                limit_filter_data.max_char_count = maxLength;
 
@@ -171,56 +155,45 @@ Evas_Object* CalUnderlineEditField::onCreate( Evas_Object* parent, void* param )
        elm_object_focus_allow_set(button, EINA_FALSE);
        elm_object_part_content_set(__layout, "elm.swallow.button", button);
 
-       evas_object_smart_callback_add(button, "clicked", [](void *data, Evas_Object *obj, void *event_info)
-       {
+       evas_object_smart_callback_add(button, "clicked", [](void *data, Evas_Object *obj, void *event_info) {
                elm_entry_entry_set((Evas_Object*)data, "");
                elm_object_focus_set((Evas_Object*)data, EINA_TRUE);
        },
        __entry);
 
-       auto entryChangeCallback = [](void* data, Evas_Object* obj, void* event_info)
-       {
+       auto entryChangeCallback = [](void* data, Evas_Object* obj, void* event_info) {
                CalUnderlineEditField* self = (CalUnderlineEditField*)data;
                char *text = elm_entry_markup_to_utf8(elm_entry_entry_get(obj));
-               if (self->__changeCallback)
-               {
+               if (self->__changeCallback) {
                        self->__changeCallback(text);
                }
 
                free(text);
 
-               if (elm_entry_is_empty(obj))
-               {
+               if (elm_entry_is_empty(obj)) {
                        elm_object_signal_emit(self->__layout, "elm,action,hide,button", "");
-               }
-               else
-               {
+               } else {
                        elm_object_signal_emit(self->__layout, "elm,action,show,button", "");
                }
        };
 
        evas_object_smart_callback_add(__entry, "changed", entryChangeCallback, this);
        evas_object_smart_callback_add(__entry, "preedit,changed", entryChangeCallback, this);
-       evas_object_smart_callback_add(__entry, "activated", [](void *data, Evas_Object *obj, void *event_info)
-       {
+       evas_object_smart_callback_add(__entry, "activated", [](void *data, Evas_Object *obj, void *event_info) {
                CalUnderlineEditField* self = (CalUnderlineEditField*)data;
-               if (self->__entryCompleteCallback)
-               {
+               if (self->__entryCompleteCallback) {
                        self->__entryCompleteCallback();
                }
 
-               if (ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE == elm_entry_input_panel_return_key_type_get(obj))
-               {
+               if (ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE == elm_entry_input_panel_return_key_type_get(obj)) {
                        elm_entry_input_panel_hide(obj);
                }
        },
        this);
 
-       evas_object_smart_callback_add(__entry, "maxlength,reached", [](void *data, Evas_Object *obj, void *event_info)
-       {
+       evas_object_smart_callback_add(__entry, "maxlength,reached", [](void *data, Evas_Object *obj, void *event_info) {
                CalUnderlineEditField* self = (CalUnderlineEditField*)data;
-               if (self->__maxLenReachCallback)
-               {
+               if (self->__maxLenReachCallback) {
                        self->__maxLenReachCallback();
                }
        },
index 2fe37f9..2c59ce1 100644 (file)
@@ -39,8 +39,7 @@ Elm_Genlist_Item_Class *CalDialogDetailDescriptionItem::getItemClassStatic()
        {
                if (0 == strcmp(part, "elm.text.title"))
                        return g_strdup(_L_("IDS_CLD_BUTTON_NOTES_ABB"));
-               else if (0 == strcmp(part, "elm.text.multiline"))
-               {
+               else if (0 == strcmp(part, "elm.text.multiline")) {
                        CalDialogDetailDescriptionItem *item = (CalDialogDetailDescriptionItem*)data;
                        return g_strdup(item->__description);
                }
index 73c71fd..05b2e72 100644 (file)
@@ -36,8 +36,7 @@ Elm_Genlist_Item_Class *CalDialogDetailEventTimeItem::getItemClassStatic()
        itc.func.text_get = [](void *data, Evas_Object *obj, const char *part)->char*
        {
                CalDialogDetailEventTimeItem *item = (CalDialogDetailEventTimeItem*)data;
-               if (!strcmp(part, "elm.text.multiline"))
-               {
+               if (!strcmp(part, "elm.text.multiline")) {
                        std::string timeText;
                        item->__schedule->getFromToDisplayString(timeText);
                        return strdup(timeText.c_str());
index 76c1021..4a7dc8d 100644 (file)
@@ -39,8 +39,7 @@ Elm_Genlist_Item_Class *CalDialogDetailReminderItem::getItemClassStatic()
                CalDialogDetailReminderItem *item = (CalDialogDetailReminderItem*)data;
                if (0 == strcmp(part, "elm.text.title")) {
                        return g_strdup(_L_("IDS_CLD_BUTTON_REMINDER_ABB"));
-               }
-               else if (0 == strcmp(part, "elm.text.multiline")) {
+               } else if (0 == strcmp(part, "elm.text.multiline")) {
                        std::string strText;
                        std::string strResult;
                        for (auto it = item->__reminders.begin(); it != item->__reminders.end(); ++it) {
index 9c605d2..3d1a7ee 100644 (file)
@@ -70,10 +70,8 @@ Evas_Object* CalDatePickerPopup::__createContent(Evas_Object* parent)
        setTextTranslatable(CALENDAR);
        elm_object_part_text_set(parent, "title,text", _L_("IDS_CLD_HEADER_SET_DATE"));
        addButton("IDS_CLD_BUTTON_CANCEL", NULL);
-       addButton("IDS_CLD_BUTTON_SET", [this](bool* destroyPopup)
-       {
-               if (__changedCb)
-               {
+       addButton("IDS_CLD_BUTTON_SET", [this](bool* destroyPopup) {
+               if (__changedCb) {
                        struct tm time;
                        elm_datetime_value_get(__dateTime, &time);
                        __dateInitial.set(&time);
index e527806..d64f271 100644 (file)
@@ -42,8 +42,7 @@ CalDialogEditDateTimeItem::CalDialogEditDateTimeItem( int sortIndex,
        __isAllDay(false),
        __isStartSelected(true)
 {
-       if(startDateTime.getHour() == 0 && startDateTime.getMinute() == 0)
-       {
+       if(startDateTime.getHour() == 0 && startDateTime.getMinute() == 0) {
                struct tm tmStart;
                struct tm tmEnd;
                startDateTime.getTmFromUtime(&tmStart);
@@ -52,8 +51,7 @@ CalDialogEditDateTimeItem::CalDialogEditDateTimeItem( int sortIndex,
                double seconds = difftime(mktime(&tmEnd), mktime(&tmStart));
                double days = seconds/(60 * 60 * 24.0);
 
-               if((days > 0.0 && !(days - floor(days) > 0.0)) || __end == __start)
-               {
+               if((days > 0.0 && !(days - floor(days) > 0.0)) || __end == __start) {
                        __isAllDay = true;
                }
        }
@@ -71,16 +69,11 @@ Elm_Genlist_Item_Class* CalDialogEditDateTimeItem::getItemClassStatic()
        {
                WENTER();
                CalDialogEditDateTimeItem* item = (CalDialogEditDateTimeItem*)data;
-               if (!strcmp(part, "start_datetime"))
-               {
+               if (!strcmp(part, "start_datetime")) {
                        return item->__startDateTimeBox = item->onCreateDateTime(obj, true);
-               }
-               else if (!strcmp(part, "end_datetime"))
-               {
+               } else if (!strcmp(part, "end_datetime")) {
                        return item->__endDateTimeBox = item->onCreateDateTime(obj, false);
-               }
-               else if (!strcmp(part, "all_day_check"))
-               {
+               } else if (!strcmp(part, "all_day_check")) {
                        return item->__allDayCheckBox = item->onCreateAllDayCheckBox(obj);
                }
 
@@ -92,18 +85,13 @@ Elm_Genlist_Item_Class* CalDialogEditDateTimeItem::getItemClassStatic()
                char temp[FORMAT_BUFFER] = {0};
                CalDialogEditDateTimeItem* item = (CalDialogEditDateTimeItem*)data;
 
-               if (!strcmp(part, "start_title"))
-               {
+               if (!strcmp(part, "start_title")) {
                        snprintf(temp, sizeof(temp) - 1, LABEL_FORMAT, item->getSystemFontSize(), _L_("IDS_CLD_BODY_START_M_DATE"));
                        return strdup(temp);
-               }
-               else if (!strcmp(part, "end_title"))
-               {
+               } else if (!strcmp(part, "end_title")) {
                        snprintf(temp, sizeof(temp) - 1, LABEL_FORMAT, item->getSystemFontSize(), _L_("IDS_CLD_BODY_END_M_DATE"));
                        return strdup(temp);
-               }
-               else if (!strcmp(part, "all_day_title"))
-               {
+               } else if (!strcmp(part, "all_day_title")) {
                        snprintf(temp, sizeof(temp) - 1, LABEL_FORMAT, item->getSystemFontSize(), _L_("IDS_CLD_OPT_ALL_DAY_ABB2"));
                        return strdup(temp);
                }
@@ -136,18 +124,15 @@ void CalDialogEditDateTimeItem::setTimeZone(const std::string& timezone)
 
 void CalDialogEditDateTimeItem::getDateTime(CalDateTime* startDateTime, CalDateTime* endDateTime, Eina_Bool* allDay)
 {
-       if(startDateTime)
-       {
+       if(startDateTime) {
                *startDateTime = __start;
        }
 
-       if(endDateTime)
-       {
+       if(endDateTime) {
                *endDateTime = __end;
        }
 
-       if(allDay)
-       {
+       if(allDay) {
                *allDay = __isAllDay;
        }
 }
@@ -215,8 +200,7 @@ void CalDialogEditDateTimeItem::updateStartAndEndTime(const CalDateTime & startD
 void CalDialogEditDateTimeItem::__onDateButtonClicked(void* data, Evas_Object* obj, void* event_info)
 {
        CalDialogEditDateTimeItem* self = static_cast<CalDialogEditDateTimeItem*>(data);
-       if (self->__dateButtonClickedCb)
-       {
+       if (self->__dateButtonClickedCb) {
                self->__dateButtonClickedCb(obj);
        }
 }
@@ -224,8 +208,7 @@ void CalDialogEditDateTimeItem::__onDateButtonClicked(void* data, Evas_Object* o
 void CalDialogEditDateTimeItem::__onTimeButtonClicked(void* data, Evas_Object* obj, void* event_info)
 {
        CalDialogEditDateTimeItem* self = static_cast<CalDialogEditDateTimeItem*>(data);
-       if (self->__timeButtonClickedCb)
-       {
+       if (self->__timeButtonClickedCb) {
                self->__timeButtonClickedCb(obj);
        }
 }
@@ -233,11 +216,9 @@ void CalDialogEditDateTimeItem::__onTimeButtonClicked(void* data, Evas_Object* o
 void CalDialogEditDateTimeItem::__onStartDateClicked(void *data, Evas_Object *obj, void *event_info)
 {
        CalDialogEditDateTimeItem* self = static_cast<CalDialogEditDateTimeItem*>(data);
-       if(self)
-       {
+       if(self) {
                self->__isStartSelected = true;
-               if(self->__dateButtonClickedCb)
-               {
+               if(self->__dateButtonClickedCb) {
                        self->__dateButtonClickedCb(obj);
                }
        }
@@ -246,11 +227,9 @@ void CalDialogEditDateTimeItem::__onStartDateClicked(void *data, Evas_Object *ob
 void CalDialogEditDateTimeItem::__onEndDateClicked(void *data, Evas_Object *obj, void *event_info)
 {
        CalDialogEditDateTimeItem* self = static_cast<CalDialogEditDateTimeItem*>(data);
-       if(self)
-       {
+       if(self) {
                self->__isStartSelected = false;
-               if(self->__dateButtonClickedCb)
-               {
+               if(self->__dateButtonClickedCb) {
                        self->__dateButtonClickedCb(obj);
                }
        }
@@ -259,11 +238,9 @@ void CalDialogEditDateTimeItem::__onEndDateClicked(void *data, Evas_Object *obj,
 void CalDialogEditDateTimeItem::__onStartTimeClicked(void *data, Evas_Object *obj, void *event_info)
 {
        CalDialogEditDateTimeItem* self = static_cast<CalDialogEditDateTimeItem*>(data);
-       if(self)
-       {
+       if(self) {
                self->__isStartSelected = true;
-               if (self->__timeButtonClickedCb)
-               {
+               if (self->__timeButtonClickedCb) {
                        self->__timeButtonClickedCb(obj);
                }
        }
@@ -272,11 +249,9 @@ void CalDialogEditDateTimeItem::__onStartTimeClicked(void *data, Evas_Object *ob
 void CalDialogEditDateTimeItem::__onEndTimeClicked(void *data, Evas_Object *obj, void *event_info)
 {
        CalDialogEditDateTimeItem* self = static_cast<CalDialogEditDateTimeItem*>(data);
-       if(self)
-       {
+       if(self) {
                self->__isStartSelected = false;
-               if (self->__timeButtonClickedCb)
-               {
+               if (self->__timeButtonClickedCb) {
                        self->__timeButtonClickedCb(obj);
                }
        }
@@ -288,13 +263,10 @@ Evas_Object* CalDialogEditDateTimeItem::onCreateDateTime(Evas_Object* parent, bo
        WENTER();
        std::string strTime;
        std::string strDate;
-       if (start)
-       {
+       if (start) {
                __start.getTimeString(strTime);
                __start.getDateString(strDate);
-       }
-       else
-       {
+       } else {
                __end.getTimeString(strTime);
                __end.getDateString(strDate);
        }
@@ -312,8 +284,7 @@ Evas_Object* CalDialogEditDateTimeItem::onCreateDateTime(Evas_Object* parent, bo
        evas_object_show(dateBtn);
 
        int fontSize = getSystemFontSize();
-       if(fontSize > TEXT_ITEM_DEFAULT_SIZE)
-       {
+       if(fontSize > TEXT_ITEM_DEFAULT_SIZE) {
                fontSize = TEXT_ITEM_DEFAULT_SIZE;
        }
 
@@ -322,8 +293,7 @@ Evas_Object* CalDialogEditDateTimeItem::onCreateDateTime(Evas_Object* parent, bo
 
        elm_object_text_set(dateBtn, temp);
 
-       if (!__isAllDay)
-       {
+       if (!__isAllDay) {
                Evas_Object* timeBtn = elm_button_add(layout);
                evas_object_size_hint_align_set(timeBtn, EVAS_HINT_FILL, EVAS_HINT_FILL);
                Evas_Smart_Cb timeCB = start ? __onStartTimeClicked : __onEndTimeClicked;
@@ -334,12 +304,9 @@ Evas_Object* CalDialogEditDateTimeItem::onCreateDateTime(Evas_Object* parent, bo
                snprintf(temp, sizeof(temp) - 1, LABEL_FORMAT, fontSize, strTime.c_str());
                elm_object_text_set(timeBtn, temp);
 
-               if (start)
-               {
+               if (start) {
                        __timeStartButton = timeBtn;
-               }
-               else
-               {
+               } else {
                        __timeEndButton = timeBtn;
                }
        }
@@ -361,8 +328,7 @@ Evas_Object* CalDialogEditDateTimeItem::onCreateAllDayCheckBox(Evas_Object* pare
                        item->__end.setAllDay(isAllDay);
                        item->__isAllDay= isAllDay;
 
-                       if (item->__changedCb)
-                       {
+                       if (item->__changedCb) {
                                item->__changedCb(item->__start, item->__end);
                        }
 
index b35fdd8..6f3fd50 100644 (file)
@@ -68,24 +68,15 @@ Elm_Genlist_Item_Class* CalDialogEditMoreItem::getItemClassStatic()
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditMoreItem* item = (CalDialogEditMoreItem*) data;
-               if (!strcmp(part, "button1"))
-               {
+               if (!strcmp(part, "button1")) {
                        return item->__button1 = item->onCreateIcon(obj, CalPath::getPath("icon_button_location.png", CalPath::IMAGE).c_str(), LOCATION);
-               }
-               else if (!strcmp(part, "button3"))
-               {
+               } else if (!strcmp(part, "button3")) {
                        return item->__button3 = item->onCreateIcon(obj, CalPath::getPath("icon_button_repeat.png", CalPath::IMAGE).c_str(), REPEAT);
-               }
-               else if (!strcmp(part, "button2"))
-               {
+               } else if (!strcmp(part, "button2")) {
                        return item->__button2 = item->onCreateIcon(obj, CalPath::getPath("icon_button_reminder.png", CalPath::IMAGE).c_str(), REMINDER);
-               }
-               else if (!strcmp(part, "button4"))
-               {
+               } else if (!strcmp(part, "button4")) {
                        return item->__button4 = item->onCreateIcon(obj, CalPath::getPath("icon_button_more.png", CalPath::IMAGE).c_str(), MORE);
-               }
-               else
-               {
+               } else {
                        return NULL;
                }
        };
@@ -114,8 +105,7 @@ Evas_Object* CalDialogEditMoreItem::onCreateIcon(Evas_Object* parent, const char
        //evas_object_data_set(image, "buttonType", buttonType);
 
        bool result = (EINA_TRUE == elm_image_file_set(image, icon_name, NULL));
-       if (!result)
-       {
+       if (!result) {
                ERR("error with elm_image_file_set, image path %s", icon_name);
        }
        evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
index ca70509..6a60c45 100644 (file)
@@ -46,8 +46,7 @@ Elm_Genlist_Item_Class* CalDialogEditMoreMenuItem::getItemClassStatic()
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogEditMoreMenuItem *item = (CalDialogEditMoreMenuItem*)data;
-               if (0 == strcmp("elm.text", part))
-               {
+               if (0 == strcmp("elm.text", part)) {
                        return g_strdup(item->__text);
                }
                return NULL;
index 74f2c8f..b127b04 100644 (file)
@@ -24,18 +24,14 @@ CalDialogEditOneTextRemoveIconItem::CalDialogEditOneTextRemoveIconItem(int sortI
        :CalDialogControl::Item(sortIndex),
        __selectCb(nullptr)
 {
-       if(subText)
-       {
+       if(subText) {
                int fontSize = getSystemFontSize();
-               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE)
-               {
+               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE) {
                        std::stringstream ss;
                        ss << "<p font_size=" << fontSize << ">" << subText << "</p>";
 
                        __subText = ss.str();
-               }
-               else
-               {
+               } else {
                        __subText = subText;
                }
        }
@@ -54,8 +50,7 @@ Elm_Genlist_Item_Class* CalDialogEditOneTextRemoveIconItem::getItemClassStatic()
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditOneTextRemoveIconItem* item = (CalDialogEditOneTextRemoveIconItem*)data;
-               if(!strcmp(part, "elm.swallow.end"))
-               {
+               if(!strcmp(part, "elm.swallow.end")) {
                        Evas_Object* box = elm_box_add(obj);
                        evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                        evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -80,8 +75,7 @@ Elm_Genlist_Item_Class* CalDialogEditOneTextRemoveIconItem::getItemClassStatic()
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogEditOneTextRemoveIconItem* item = (CalDialogEditOneTextRemoveIconItem*)data;
-               if(!strcmp(part, "elm.text") && !item->__subText.empty())
-               {
+               if(!strcmp(part, "elm.text") && !item->__subText.empty()) {
                        return strdup(_L_(item->__subText.c_str()));
                }
 
@@ -93,8 +87,7 @@ Elm_Genlist_Item_Class* CalDialogEditOneTextRemoveIconItem::getItemClassStatic()
 
 void CalDialogEditOneTextRemoveIconItem::setSubText(const char* text)
 {
-       if(text)
-       {
+       if(text) {
                __subText = text;
        }
 }
@@ -102,8 +95,7 @@ void CalDialogEditOneTextRemoveIconItem::setSubText(const char* text)
 void CalDialogEditOneTextRemoveIconItem::onSelect()
 {
        WENTER();
-       if(__selectCb)
-       {
+       if(__selectCb) {
                __selectCb();
        }
 }
index 7a34d70..7ed142a 100644 (file)
@@ -45,8 +45,7 @@ Evas_Object* CalDialogEditOptionalTextFieldItem::createEntry(Evas_Object* parent
        __editField = new CalUnderlineEditField(__multiLine);
        __editField->create(parent, NULL);
 
-       if (__onCreateEditField)
-       {
+       if (__onCreateEditField) {
                __onCreateEditField(__editField);
        }
 
@@ -60,12 +59,9 @@ Elm_Genlist_Item_Class* CalDialogEditOptionalTextFieldItem::getItemClassStatic()
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditOptionalTextFieldItem* item = (CalDialogEditOptionalTextFieldItem*)data;
-               if (!strcmp(part, "elm.icon.entry"))
-               {
+               if (!strcmp(part, "elm.icon.entry")) {
                        return item->createEntry(obj);
-               }
-               else if (!strcmp(part, "elm.icon"))
-               {
+               } else if (!strcmp(part, "elm.icon")) {
                        return item->createRemoveButton(obj);
                }
 
index 59b7f69..2b1f2f8 100644 (file)
@@ -97,8 +97,7 @@ Elm_Genlist_Item_Class* CalDialogEditReminderRadioItem::getItemClassStatic()
                                elm_radio_value_set(radio, item->__radioIndex);
 
                        evas_object_smart_callback_add(radio, "changed",
-                               [](void *data, Evas_Object *obj, void *event_info)
-                               {
+                               [](void *data, Evas_Object *obj, void *event_info) {
                                        CalDialogEditReminderRadioItem *item = (CalDialogEditReminderRadioItem*)data;
                                        if (item->__radioIndex == elm_radio_value_get(obj) && item->__changeCb) {
                                                item->__changeCb(item->__reminder);
index 76bdebc..df89bc3 100644 (file)
@@ -44,8 +44,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatMonthUnitItem::getItemClassStatic()
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogEditRepeatMonthUnitItem *item = (CalDialogEditRepeatMonthUnitItem*) data;
-               if (0 == strcmp("elm.text", part))
-               {
+               if (0 == strcmp("elm.text", part)) {
                        std::string text;
                        CalScheduleRepeat::Date date;
                        const char* tz = item->__timezone.c_str();
index 9a14cc5..ea0d6e0 100644 (file)
@@ -40,8 +40,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatRadioItem::getItemClassStatic()
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogEditRepeatRadioItem *item = (CalDialogEditRepeatRadioItem*) data;
-               if (0 == strcmp("elm.text", part))
-               {
+               if (0 == strcmp("elm.text", part)) {
                        std::string repeatText;
                        CalScheduleRepeat repeat;
                        repeat.unitType = item->__repeatType;
@@ -53,8 +52,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatRadioItem::getItemClassStatic()
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditRepeatRadioItem *item = (CalDialogEditRepeatRadioItem*)data;
-               if (0 == strcmp("elm.swallow.end", part))
-               {
+               if (0 == strcmp("elm.swallow.end", part)) {
                        Evas_Object *radio_main = (Evas_Object *)evas_object_data_get(obj, "radio_main");
                        c_retv_if(NULL == radio_main, NULL);
 
@@ -71,8 +69,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatRadioItem::getItemClassStatic()
                                elm_radio_value_set(radio, item->__radioIndex);
 
                        evas_object_smart_callback_add(radio, "changed",
-                               [](void *data, Evas_Object *obj, void *event_info)
-                               {
+                               [](void *data, Evas_Object *obj, void *event_info) {
                                        CalDialogEditRepeatRadioItem *item = (CalDialogEditRepeatRadioItem*)data;
                                        if (item->__radioIndex == elm_radio_value_get(obj)) {
                                                item->__changeCb(item->__repeatType);
index 16a19b9..a5964cb 100644 (file)
@@ -45,12 +45,9 @@ CalDialogEditRepeatUnitItem::CalDialogEditRepeatUnitItem(std::function<void (Cal
        , __unitType(unitType)
        , __button(NULL)
 {
-       if (repeat.unitType == unitType)
-       {
+       if (repeat.unitType == unitType) {
                __unitInterval = repeat.unitInterval;
-       }
-       else
-       {
+       } else {
                __unitInterval = 0;
        }
 }
@@ -74,8 +71,7 @@ void CalDialogEditRepeatUnitItem::setDateButtonTime(const CalScheduleRepeat repe
        __unitInterval = repeat.unitInterval;
 
        int times = 1;
-       if (repeat.unitInterval)
-       {
+       if (repeat.unitInterval) {
                times = repeat.unitInterval;
        }
 
@@ -88,31 +84,24 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUnitItem::getItemClassStatic()
 {
        static Elm_Genlist_Item_Class itc = {};
 
-       if (CalLocaleManager::getInstance().isRTL())
-       {
+       if (CalLocaleManager::getInstance().isRTL()) {
                itc.item_style = "CalDialogEditRepeatUnitItemRTL";
-       }
-       else
-       {
+       } else {
                itc.item_style = "CalDialogEditRepeatUnitItem";
        }
 
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogEditRepeatUnitItem *item = (CalDialogEditRepeatUnitItem*)data;
-               if (0 == strcmp("elm.text.left", part))
-               {
+               if (0 == strcmp("elm.text.left", part)) {
                        char temp[FORMAT_BUFFER] = {0};
                        snprintf(temp, sizeof(temp) - 1, LABEL_FORMAT, item->getSystemFontSize(), _L_("IDS_CLD_OPT_EVERY"));
 
                        return strdup(temp);
-               }
-               else if (0 == strcmp("elm.text.right", part))
-               {
+               } else if (0 == strcmp("elm.text.right", part)) {
                        int form = item->__unitInterval == 1 ? SINGULAR : PLURAL;
 
-                       switch (item->__unitType)
-                       {
+                       switch (item->__unitType) {
                                case CalScheduleRepeat::DAY:
                                        return strdup(_L_(unitLabels[DAY_LABEL][form]));
                                case CalScheduleRepeat::WEEK:
@@ -132,25 +121,21 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUnitItem::getItemClassStatic()
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditRepeatUnitItem *item = (CalDialogEditRepeatUnitItem*)data;
-               if (0 == strcmp("elm.swallow.unit", part))
-               {
+               if (0 == strcmp("elm.swallow.unit", part)) {
                        Evas_Object *button = elm_button_add(obj);
                        evas_object_propagate_events_set(button, EINA_FALSE);
                        evas_object_size_hint_min_set(button, ELM_SCALE_SIZE(60), ELM_SCALE_SIZE(60));
                        evas_object_smart_callback_add(button, "clicked",
-                               [](void* data, Evas_Object* obj, void* event_info)
-                               {
+                               [](void* data, Evas_Object* obj, void* event_info) {
                                        CalDialogEditRepeatUnitItem *item = (CalDialogEditRepeatUnitItem*)data;
-                                       if(item->__dateButtonClickedCb)
-                                       {
+                                       if(item->__dateButtonClickedCb) {
                                                item->__dateButtonClickedCb();
                                        }
                                }, item
                        );
 
                        int times = 1;
-                       if (item->__unitInterval)
-                       {
+                       if (item->__unitInterval) {
                                times = item->__unitInterval;
                        }
 
index 8f293b1..ff4704d 100644 (file)
@@ -33,27 +33,17 @@ CalDialogEditRepeatUntilDueDateItem::CalDialogEditRepeatUntilDueDateItem(std::fu
        , __radio(NULL)
        , __button(NULL)
 {
-       if (repeat.untilType == CalScheduleRepeat::DUE_DATE)
-       {
+       if (repeat.untilType == CalScheduleRepeat::DUE_DATE) {
                __untilInfo.date = repeat.untilInfo.date;
                __dateTime.set(__untilInfo.date.year, __untilInfo.date.month, __untilInfo.date.mday);
-       }
-       else
-       {
-               if (repeat.unitType == CalScheduleRepeat::DAY)
-               {
+       } else {
+               if (repeat.unitType == CalScheduleRepeat::DAY) {
                        __dateTime.addDays(7);
-               }
-               else if (repeat.unitType == CalScheduleRepeat::WEEK)
-               {
+               } else if (repeat.unitType == CalScheduleRepeat::WEEK) {
                        __dateTime.addMonths(1);
-               }
-               else if (repeat.unitType == CalScheduleRepeat::MONTH)
-               {
+               } else if (repeat.unitType == CalScheduleRepeat::MONTH) {
                        __dateTime.addYears(1);
-               }
-               else if (repeat.unitType == CalScheduleRepeat::YEAR)
-               {
+               } else if (repeat.unitType == CalScheduleRepeat::YEAR) {
                        __dateTime.addYears(5);
                }
 
@@ -76,8 +66,7 @@ CalDateTime& CalDialogEditRepeatUntilDueDateItem::getUntilDate()
 void CalDialogEditRepeatUntilDueDateItem::__onDateButtonClicked(void *data, Evas_Object *obj, void *event_info)
 {
        CalDialogEditRepeatUntilDueDateItem* item = static_cast<CalDialogEditRepeatUntilDueDateItem*>(data);
-       if(item)
-       {
+       if(item) {
                item->__dateButtonClickedCb(obj);
 
                elm_radio_value_set(item->__radio, item->__radioIndex);
@@ -99,11 +88,9 @@ void CalDialogEditRepeatUntilDueDateItem::setDateButtonTime(const CalScheduleRep
 
        std::string dateString;
        __dateTime.getDateString(dateString);
-       if(!dateString.empty())
-       {
+       if(!dateString.empty()) {
                int fontSize = getSystemFontSize();
-               if(fontSize > TEXT_ITEM_DEFAULT_SIZE)
-               {
+               if(fontSize > TEXT_ITEM_DEFAULT_SIZE) {
                        fontSize = TEXT_ITEM_DEFAULT_SIZE;
                }
 
@@ -117,20 +104,16 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilDueDateItem::getItemClassStatic(
 {
        static Elm_Genlist_Item_Class itc = {}; // Implicitly 0-init in C++
 
-       if (CalLocaleManager::getInstance().isRTL())
-       {
+       if (CalLocaleManager::getInstance().isRTL()) {
                itc.item_style = "CalDialogEditRepeatUntilDueDateItemRTL";
-       }
-       else
-       {
+       } else {
                itc.item_style = "CalDialogEditRepeatUntilDueDateItem";
        }
 
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogEditRepeatUntilDueDateItem *item = (CalDialogEditRepeatUntilDueDateItem*)data;
-               if (!strcmp("elm.text", part))
-               {
+               if (!strcmp("elm.text", part)) {
                        char temp[FORMAT_BUFFER] = {0};
                        snprintf(temp, sizeof(temp) - 1, LABEL_FORMAT, item->getSystemFontSize(), "~");
 
@@ -142,8 +125,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilDueDateItem::getItemClassStatic(
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditRepeatUntilDueDateItem *item = (CalDialogEditRepeatUntilDueDateItem*)data;
-               if (!strcmp("elm.swallow.date", part))
-               {
+               if (!strcmp("elm.swallow.date", part)) {
                        Evas_Object *button = elm_button_add(obj);
                        evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                        evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
@@ -153,11 +135,9 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilDueDateItem::getItemClassStatic(
 
                        std::string dateString;
                        item->__dateTime.getDateString(dateString);
-                       if(!dateString.empty())
-                       {
+                       if(!dateString.empty()) {
                                int fontSize = item->getSystemFontSize();
-                               if(fontSize > TEXT_ITEM_DEFAULT_SIZE)
-                               {
+                               if(fontSize > TEXT_ITEM_DEFAULT_SIZE) {
                                        fontSize = TEXT_ITEM_DEFAULT_SIZE;
                                }
 
@@ -169,9 +149,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilDueDateItem::getItemClassStatic(
                        item->__button = button;
 
                        return button;
-               }
-               else if (!strcmp("elm.icon.right", part))
-               {
+               } else if (!strcmp("elm.icon.right", part)) {
                        Evas_Object *radio_main = (Evas_Object *)evas_object_data_get(obj, "radio_main");
                        c_retv_if(NULL == radio_main, NULL);
 
@@ -182,8 +160,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilDueDateItem::getItemClassStatic(
                        evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
                        evas_object_smart_callback_add(radio, "changed", [](void *data, Evas_Object *obj, void *event_info)->void {
                                        CalDialogEditRepeatUntilDueDateItem *item = (CalDialogEditRepeatUntilDueDateItem *)data;
-                                       if (item->__radioIndex == elm_radio_value_get(obj) && item->__changedCb)
-                                       {
+                                       if (item->__radioIndex == elm_radio_value_get(obj) && item->__changedCb) {
                                                item->__changedCb(CalScheduleRepeat::DUE_DATE, item->__untilInfo);
                                        }
                                }, item
@@ -191,8 +168,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilDueDateItem::getItemClassStatic(
                        elm_radio_state_value_set(radio, item->__radioIndex);
                        elm_radio_group_add(radio, radio_main);
 
-                       if (item->__repeat.untilType == CalScheduleRepeat::DUE_DATE)
-                       {
+                       if (item->__repeat.untilType == CalScheduleRepeat::DUE_DATE) {
                                elm_radio_value_set(radio, item->__radioIndex);
                        }
 
index 3c5a473..81094f9 100644 (file)
@@ -41,8 +41,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilForeverItem::getItemClassStatic(
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogEditRepeatUntilForeverItem *item = (CalDialogEditRepeatUntilForeverItem*)data;
-               if (0 == strcmp("elm.text", part))
-               {
+               if (0 == strcmp("elm.text", part)) {
                        char temp[FORMAT_BUFFER] = {0};
                        snprintf(temp, sizeof(temp) - 1, LABEL_FORMAT, item->getSystemFontSize(), _L_("IDS_CLD_OPT_FOREVER"));
 
@@ -54,8 +53,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilForeverItem::getItemClassStatic(
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditRepeatUntilForeverItem *item = (CalDialogEditRepeatUntilForeverItem*)data;
-               if (0 == strcmp("elm.swallow.end", part))
-               {
+               if (0 == strcmp("elm.swallow.end", part)) {
                        Evas_Object *radio_main = (Evas_Object *)evas_object_data_get(obj, "radio_main");
                        c_retv_if(NULL == radio_main, NULL);
 
index b0867de..6dab415 100644 (file)
@@ -34,12 +34,9 @@ CalDialogEditRepeatUntilTimesItem::CalDialogEditRepeatUntilTimesItem(std::functi
        , __radio(NULL)
        , __button(NULL)
 {
-       if (repeat.untilType == CalScheduleRepeat::TIMES)
-       {
+       if (repeat.untilType == CalScheduleRepeat::TIMES) {
                __untilInfo.times = repeat.untilInfo.times;
-       }
-       else
-       {
+       } else {
                __untilInfo.times = DEFAULT_VALUE;
        }
 }
@@ -58,8 +55,7 @@ void CalDialogEditRepeatUntilTimesItem::setDateButtonTime(const CalScheduleRepea
        __untilInfo.times = repeat.untilInfo.times;
 
        int times = DEFAULT_VALUE;
-       if (__untilInfo.times)
-       {
+       if (__untilInfo.times) {
                times = __untilInfo.times;
        }
 
@@ -72,20 +68,16 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilTimesItem::getItemClassStatic()
 {
        static Elm_Genlist_Item_Class itc = {};
 
-       if (CalLocaleManager::getInstance().isRTL())
-       {
+       if (CalLocaleManager::getInstance().isRTL()) {
                itc.item_style = "CalDialogEditRepeatUntilTimesItemRTL";
-       }
-       else
-       {
+       } else {
                itc.item_style = "CalDialogEditRepeatUntilTimesItem";
        }
 
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogEditRepeatUntilTimesItem *item = (CalDialogEditRepeatUntilTimesItem*) data;
-               if (0 == strcmp("elm.text", part))
-               {
+               if (0 == strcmp("elm.text", part)) {
                        char temp[FORMAT_BUFFER] = {0};
                        snprintf(temp, sizeof(temp) - 1, LABEL_FORMAT, item->getSystemFontSize(), _L_("IDS_CLD_OPT_TIMES_LC"));
 
@@ -98,8 +90,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilTimesItem::getItemClassStatic()
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditRepeatUntilTimesItem *item = (CalDialogEditRepeatUntilTimesItem*) data;
-               if (0 == strcmp("elm.swallow.times", part))
-               {
+               if (0 == strcmp("elm.swallow.times", part)) {
                        Evas_Object *button = elm_button_add(obj);
                        evas_object_propagate_events_set(button, EINA_FALSE);
                        evas_object_size_hint_weight_set(button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -111,16 +102,14 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilTimesItem::getItemClassStatic()
                                        elm_radio_value_set(item->__radio, item->__radioIndex);
                                        Evas_Object* radio = elm_radio_selected_object_get(item->__radio);
                                        evas_object_smart_callback_call(radio, "changed", NULL);
-                                       if(item->__dateButtonClickedCb)
-                                       {
+                                       if(item->__dateButtonClickedCb) {
                                                item->__dateButtonClickedCb(obj);
                                        }
                                }, item
                        );
 
                        int times = DEFAULT_VALUE;
-                       if (item->__untilInfo.times)
-                       {
+                       if (item->__untilInfo.times) {
                                times = item->__untilInfo.times;
                        }
 
@@ -131,9 +120,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilTimesItem::getItemClassStatic()
                        item->__button = button;
 
                        return button;
-               }
-               else if (0 == strcmp("elm.icon.right", part))
-               {
+               } else if (0 == strcmp("elm.icon.right", part)) {
                        Evas_Object *radio_main = (Evas_Object *)evas_object_data_get(obj, "radio_main");
                        c_retv_if(NULL == radio_main, NULL);
 
@@ -146,8 +133,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilTimesItem::getItemClassStatic()
                                [](void *data, Evas_Object *obj, void *event_info)->void
                                {
                                        CalDialogEditRepeatUntilTimesItem *item = (CalDialogEditRepeatUntilTimesItem *)data;
-                                       if (item->__radioIndex == elm_radio_value_get(obj) && item->__changedCb)
-                                       {
+                                       if (item->__radioIndex == elm_radio_value_get(obj) && item->__changedCb) {
                                                item->__changedCb(CalScheduleRepeat::TIMES, item->__untilInfo);
                                        }
                                }, item
@@ -155,8 +141,7 @@ Elm_Genlist_Item_Class* CalDialogEditRepeatUntilTimesItem::getItemClassStatic()
                        elm_radio_state_value_set(radio, item->__radioIndex);
                        elm_radio_group_add(radio, radio_main);
 
-                       if (item->__repeat.untilType == CalScheduleRepeat::TIMES)
-                       {
+                       if (item->__repeat.untilType == CalScheduleRepeat::TIMES) {
                                elm_radio_value_set(radio, item->__radioIndex);
                        }
 
@@ -175,8 +160,7 @@ void CalDialogEditRepeatUntilTimesItem::onSelect()
 
        Elm_Object_Item* item = Item::getElmObjectItem();
        Evas_Object* genlist = elm_object_item_widget_get(item);
-       if(genlist)
-       {
+       if(genlist) {
                Evas_Object *radio_main = (Evas_Object *)evas_object_data_get(genlist, "radio_main");
                WPRET_M(!radio_main, "radio_main NULL");
 
index 95d02be..8fac691 100644 (file)
@@ -60,8 +60,7 @@ Evas_Object* CalDialogEditRepeatWeeklyUnitInfoItem::createCheck(Evas_Object *par
                        CalDialogEditRepeatWeeklyUnitInfoItem *item = (CalDialogEditRepeatWeeklyUnitInfoItem*)data;
                        long long day = reinterpret_cast<long long>(evas_object_data_get(obj, "day"));
                        item->__unitInfo.weekly.selected[day] = elm_check_state_get(obj);
-                       if (item->__changedCb)
-                       {
+                       if (item->__changedCb) {
                                item->__changedCb(item->__unitInfo);
                        }
                }, item
index d3604fd..1d80a17 100644 (file)
@@ -45,12 +45,9 @@ Elm_Genlist_Item_Class* CalDialogEditTextFieldItem::getItemClassStatic()
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditTextFieldItem* item = (CalDialogEditTextFieldItem*)data;
-               if (strcmp(part, "elm.swallow.content") == 0)
-               {
+               if (strcmp(part, "elm.swallow.content") == 0) {
                        return item->createEntry(obj);
-               }
-               else
-               {
+               } else {
                        return NULL;
                }
        };
@@ -65,8 +62,7 @@ Evas_Object* CalDialogEditTextFieldItem::createEntry(Evas_Object* parent)
 
        evas_object_event_callback_add(__editField->getEvasObj(), EVAS_CALLBACK_DEL, onEditFieldDestroyed, this);
 
-       if (__onCreateEditField)
-       {
+       if (__onCreateEditField) {
                __onCreateEditField(__editField);
        }
 
@@ -80,8 +76,7 @@ CalUnderlineEditField* CalDialogEditTextFieldItem::getEditField()
 
 void CalDialogEditTextFieldItem::onRealized()
 {
-       if (__onFocusSet)
-       {
+       if (__onFocusSet) {
                __onFocusSet(__editField);
                __onFocusSet = nullptr;
        }
index 73b4aa5..7fa4dd2 100644 (file)
@@ -24,13 +24,11 @@ CalDialogEditTwoTextRemoveIconItem::CalDialogEditTwoTextRemoveIconItem(int sortI
        :CalDialogControl::Item(sortIndex),
         __selectCb(nullptr)
 {
-       if(mainText)
-       {
+       if(mainText) {
                __mainText = mainText;
        }
 
-       if(subText)
-       {
+       if(subText) {
                setSubText(subText);
        }
 }
@@ -46,8 +44,7 @@ Elm_Genlist_Item_Class* CalDialogEditTwoTextRemoveIconItem::getItemClassStatic()
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogEditTwoTextRemoveIconItem* item = (CalDialogEditTwoTextRemoveIconItem*)data;
-               if(!strcmp(part, "elm.swallow.end"))
-               {
+               if(!strcmp(part, "elm.swallow.end")) {
                        Evas_Object* button = elm_button_add(obj);
                        elm_object_style_set(button, "icon_expand_delete");
                        evas_object_propagate_events_set(button, EINA_FALSE);
@@ -67,17 +64,12 @@ Elm_Genlist_Item_Class* CalDialogEditTwoTextRemoveIconItem::getItemClassStatic()
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogEditTwoTextRemoveIconItem* item = (CalDialogEditTwoTextRemoveIconItem*)data;
-               if(!strcmp(part, "elm.text.sub"))
-               {
-                       if(!item->__mainText.empty())
-                       {
+               if(!strcmp(part, "elm.text.sub")) {
+                       if(!item->__mainText.empty()) {
                                return strdup(_L_G_(item->__mainText.c_str()));
                        }
-               }
-               else if(!strcmp(part, "elm.text"))
-               {
-                       if(!item->__subText.empty())
-                       {
+               } else if(!strcmp(part, "elm.text")) {
+                       if(!item->__subText.empty()) {
                                return strdup(_L_G_(item->__subText.c_str()));
                        }
                }
@@ -90,26 +82,21 @@ Elm_Genlist_Item_Class* CalDialogEditTwoTextRemoveIconItem::getItemClassStatic()
 
 void CalDialogEditTwoTextRemoveIconItem::setMainText(const char* text)
 {
-       if(text)
-       {
+       if(text) {
                __mainText = text;
        }
 }
 
 void CalDialogEditTwoTextRemoveIconItem::setSubText(const char* text)
 {
-       if(text)
-       {
+       if(text) {
                int fontSize = getSystemFontSize();
-               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE)
-               {
+               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE) {
                        std::stringstream ss;
                        ss << "<p font_size=" << fontSize << ">" << text << "</p>";
 
                        __subText = ss.str();
-               }
-               else
-               {
+               } else {
                        __subText = text;
                }
        }
@@ -118,8 +105,7 @@ void CalDialogEditTwoTextRemoveIconItem::setSubText(const char* text)
 void CalDialogEditTwoTextRemoveIconItem::onSelect()
 {
        WENTER();
-       if(__selectCb)
-       {
+       if(__selectCb) {
                __selectCb();
        }
 }
index 8aaa5b0..7e427e8 100644 (file)
@@ -40,23 +40,20 @@ Elm_Object_Item* CalEditDialogControl::add(CalDialogControl::Item* item)
        Elm_Object_Item* objectItem = NULL;
        Evas_Object* genlist = getEvasObj();
        WPRET_VM((genlist == NULL),NULL,"get fail");
-       if (item == NULL)
-       {
+       if (item == NULL) {
                WERROR("item is NULL");
                return NULL;
        }
 
        int sortIndex = item->getSortIndex();
        WDEBUG("sortIndex:%d", sortIndex);
-       if (sortIndex == 0)
-       {
+       if (sortIndex == 0) {
                WERROR("fail");
                return NULL;
        }
 
        std::set<int>::iterator it=__sortedSet.find(sortIndex);
-       if (it != __sortedSet.end())
-       {
+       if (it != __sortedSet.end()) {
                WERROR("already add");
                return NULL;
        }
@@ -64,22 +61,17 @@ Elm_Object_Item* CalEditDialogControl::add(CalDialogControl::Item* item)
        Elm_Object_Item* curObj = NULL;
 
        curObj = elm_genlist_first_item_get(genlist);
-       if (curObj == NULL)
-       {
+       if (curObj == NULL) {
                objectItem = elm_genlist_item_append(genlist, item->getItemClassStatic(), item, NULL, ELM_GENLIST_ITEM_NONE,
-                               [](void *data, Evas_Object *obj, void *event_info)
-                               {
+                               [](void *data, Evas_Object *obj, void *event_info) {
                                        Elm_Object_Item* genlistItem = (Elm_Object_Item*) event_info;
                                        elm_genlist_item_selected_set(genlistItem, EINA_FALSE);
 
                                        CalDialogControl::Item* item = (CalDialogControl::Item*)data;
                                        item->onSelect();
                                }, item);
-       }
-       else
-       {
-               do
-               {
+       } else {
+               do {
                        Elm_Object_Item* nextObj = NULL;
                        CalDialogControl::Item* curItem = (CalDialogControl::Item*)elm_object_item_data_get(curObj);
                        CalDialogControl::Item* nextItem = NULL;
@@ -88,26 +80,20 @@ Elm_Object_Item* CalEditDialogControl::add(CalDialogControl::Item* item)
 
                        nextObj = elm_genlist_item_next_get(curObj);
 
-                       if (nextObj == NULL)
-                       {
-                               if (sortIndex > curIndex)
-                               {
+                       if (nextObj == NULL) {
+                               if (sortIndex > curIndex) {
                                        objectItem = elm_genlist_item_append(genlist, item->getItemClassStatic(), item, NULL, ELM_GENLIST_ITEM_NONE,
-                                                       [](void *data, Evas_Object *obj, void *event_info)
-                                                       {
+                                                       [](void *data, Evas_Object *obj, void *event_info) {
                                                                Elm_Object_Item* genlistItem = (Elm_Object_Item*) event_info;
                                                                elm_genlist_item_selected_set(genlistItem, EINA_FALSE);
 
                                                                CalDialogControl::Item* item = (CalDialogControl::Item*)data;
                                                                item->onSelect();
                                                        }, item);
-                               }
-                               else
-                               {
+                               } else {
                                        objectItem = elm_genlist_item_insert_before(genlist, item->getItemClassStatic(), item, NULL,
                                                        curObj, ELM_GENLIST_ITEM_NONE,
-                                                       [](void *data, Evas_Object *obj, void *event_info)
-                                                       {
+                                                       [](void *data, Evas_Object *obj, void *event_info) {
                                                                Elm_Object_Item* genlistItem = (Elm_Object_Item*) event_info;
                                                                elm_genlist_item_selected_set(genlistItem, EINA_FALSE);
 
@@ -116,17 +102,13 @@ Elm_Object_Item* CalEditDialogControl::add(CalDialogControl::Item* item)
                                                        }, item);
                                }
                                break;
-                       }
-                       else
-                       {
+                       } else {
                                nextItem = (CalDialogControl::Item*)elm_object_item_data_get(nextObj);
                                nextIndex = nextItem->getSortIndex();
-                               if (curIndex < sortIndex && sortIndex < nextIndex)
-                               {
+                               if (curIndex < sortIndex && sortIndex < nextIndex) {
                                        objectItem = elm_genlist_item_insert_after(genlist, item->getItemClassStatic(), item, NULL,
                                                        curObj, ELM_GENLIST_ITEM_NONE,
-                                                       [](void *data, Evas_Object *obj, void *event_info)
-                                                       {
+                                                       [](void *data, Evas_Object *obj, void *event_info) {
                                                                Elm_Object_Item* genlistItem = (Elm_Object_Item*) event_info;
                                                                elm_genlist_item_selected_set(genlistItem, EINA_FALSE);
 
@@ -134,13 +116,10 @@ Elm_Object_Item* CalEditDialogControl::add(CalDialogControl::Item* item)
                                                                item->onSelect();
                                                        }, item);
                                        break;
-                               }
-                               else if (curIndex > sortIndex)
-                               {
+                               } else if (curIndex > sortIndex) {
                                        objectItem = elm_genlist_item_insert_before(genlist, item->getItemClassStatic(), item, NULL,
                                                        curObj, ELM_GENLIST_ITEM_NONE,
-                                                       [](void *data, Evas_Object *obj, void *event_info)
-                                                       {
+                                                       [](void *data, Evas_Object *obj, void *event_info) {
                                                                Elm_Object_Item* genlistItem = (Elm_Object_Item*) event_info;
                                                                elm_genlist_item_selected_set(genlistItem, EINA_FALSE);
 
@@ -170,13 +149,10 @@ void CalEditDialogControl::remove(CalDialogControl::Item* item)
 {
        WENTER();
        const Elm_Object_Item* objectItem = item->getElmObjectItem();
-       if (objectItem)
-       {
+       if (objectItem) {
                __sortedSet.erase(item->getSortIndex());
                elm_object_item_del((Elm_Object_Item*)objectItem);
-       }
-       else
-       {
+       } else {
                WDEBUG("already remove or not yet add");
        }
 }
index ada8b90..04f1ccc 100644 (file)
@@ -52,17 +52,13 @@ void CalEditField::setText(const char* text)
 
 void CalEditField::setGuideText(const char* text, int font)
 {
-       if (__entry)
-       {
-               if(font)
-               {
+       if (__entry) {
+               if(font) {
                        std::stringstream ss;
                        ss << "<p font_size=" << font << ">" << _L_(text) << "</p>";
 
                        elm_object_part_text_set(__entry, "elm.guide", ss.str().c_str());
-               }
-               else
-               {
+               } else {
                        elm_object_part_text_set(__entry, "elm.guide", _L_(text));
                }
        }
@@ -70,8 +66,7 @@ void CalEditField::setGuideText(const char* text, int font)
 
 void CalEditField::setFontSize(int size)
 {
-       if (!__entry)
-       {
+       if (!__entry) {
                return;
        }
 
index 483c49e..4d18e87 100644 (file)
@@ -35,19 +35,14 @@ CalEditReminderPopup::CalEditReminderPopup(const CalScheduleReminder& reminderOr
                __reminder.unitType = CalScheduleReminder::MIN;
                __reminder.unitValue = 10;
                __reminder.isCustom = false;
-       }
-       else if (__reminder.unitType == CalScheduleReminder::NONE)
-       {
+       } else if (__reminder.unitType == CalScheduleReminder::NONE) {
                __radio_index = 1;
                __reminder.isCustom = false;
-       }
-       else
-       {
+       } else {
                __reminder.isCustom = true;
 
                int minuteValue = __reminder.getMinuteValue();
-               switch(minuteValue)
-               {
+               switch(minuteValue) {
                        case 0:
                                __reminder.unitType = CalScheduleReminder::MIN;
                                __reminder.unitValue = minuteValue;
@@ -139,8 +134,7 @@ Evas_Object* CalEditReminderPopup::__createContent(Evas_Object* parent)
 
        elm_radio_value_set(radio_main, __radio_index);
 
-       if(__reminder.isCustom)
-       {
+       if(__reminder.isCustom) {
                __addRadioItem(dialog, radio_main, radio_index, __reminder.unitType, __reminder.unitValue);
        }
 
@@ -165,16 +159,13 @@ Evas_Object* CalEditReminderPopup::onCreate(Evas_Object* parent, void* viewParam
 void CalEditReminderPopup::__addRadioItem(CalDialogControl *dialog, Evas_Object* radioObj, int& radioIndex, CalScheduleReminder::UnitType type, int unitValue)
 {
        bool setRadio = false;
-       if (__isEditReminder && __reminder.unitType == type && __reminder.unitValue == unitValue)
-       {
+       if (__isEditReminder && __reminder.unitType == type && __reminder.unitValue == unitValue) {
                setRadio = true;
        }
        CalDialogEditReminderRadioItem* radioItem = new CalDialogEditReminderRadioItem(__reminder, radioIndex, type, unitValue, setRadio, type == CalScheduleReminder::NONE);
        radioItem->setSelectCb([this, radioObj, radioIndex](void)->void{
-                       if (__radio_index == radioIndex)
-                       {
-                               if (__doneCb)
-                               {
+                       if (__radio_index == radioIndex) {
+                               if (__doneCb) {
                                        __doneCb(__reminder, __radio_index);
                                }
 
@@ -215,8 +206,7 @@ void CalEditReminderPopup::__addRadioCustomItem(CalDialogControl *dialog, Evas_O
                }
        );
        __customItem->setRadioChangeCb([this](const CalScheduleReminder& reminder)->void{
-                       if (__customSelectedCb)
-                       {
+                       if (__customSelectedCb) {
                                __radio_index = 10;
                                __customSelectedCb(__reminder, __radio_index);
                        }
index 211ef18..db538e8 100644 (file)
@@ -131,16 +131,14 @@ void CalEditRepeatMonthlyView::__createGenlist()
        int radioIndex = 1;
 
        __dialog->add(new CalDialogEditRepeatMonthUnitItem(
-               [this](CalScheduleRepeat::MonthlyType monthlyType)
-               {
+               [this](CalScheduleRepeat::MonthlyType monthlyType) {
                        // TODO: Set date
                        __repeat.unitInfo.monthly.type = monthlyType;
                }, __repeat, __startTime, __timezone, radioIndex++, CalScheduleRepeat::MONTHDAY)
        );
 
        __dialog->add(new CalDialogEditRepeatMonthUnitItem(
-               [this](CalScheduleRepeat::MonthlyType monthlyType)
-               {
+               [this](CalScheduleRepeat::MonthlyType monthlyType) {
                        // TODO: Set date
                        __repeat.unitInfo.monthly.type = monthlyType;
                }, __repeat, __startTime, __timezone, radioIndex++, CalScheduleRepeat::WEEKDAY)
index c29c74a..1559b7c 100644 (file)
@@ -38,14 +38,12 @@ CalEditRepeatPopup::~CalEditRepeatPopup()
 CalDialogEditRepeatRadioItem* CalEditRepeatPopup::__addRadioItem(Evas_Object *radio_main, int radio_index, CalScheduleRepeat::UnitType unitType)
 {
        return new CalDialogEditRepeatRadioItem(
-               [radio_main, radio_index]()
-               {
+               [radio_main, radio_index]() {
                        elm_radio_value_set(radio_main, radio_index);
                        Evas_Object *radio = elm_radio_selected_object_get(radio_main);
                        evas_object_smart_callback_call(radio, "changed", NULL);
                },
-               [this](const CalScheduleRepeat::UnitType repeatType)
-               {
+               [this](const CalScheduleRepeat::UnitType repeatType) {
                        WDEBUG("repeat.unitType=%d", repeatType);
                        __repeatUnitType = repeatType;
                        __doneCb(__repeatUnitType);
index cf4a127..f2065c6 100644 (file)
@@ -52,8 +52,7 @@ CalEditRepeatWeeklyView::~CalEditRepeatWeeklyView()
 
 static bool __isNoDaySelected(CalScheduleRepeat::UnitInfo unitInfo)
 {
-       for ( auto index = 0; index < 7; index++)
-       {
+       for ( auto index = 0; index < 7; index++) {
                if (unitInfo.weekly.selected[index])
                        return false;
        }
index 6c75e38..71de0f6 100644 (file)
@@ -67,8 +67,7 @@ CalEditView::CalEditView() : CalView("CalEditView")
        __workingCopy = CalSchedule::makeDefaultSchedule();
 
        const int bookId = CalSettingsManager::getInstance().getLastUsedCalendar();
-       if (CalBookManager::getInstance().getBook(bookId))
-       {
+       if (CalBookManager::getInstance().getBook(bookId)) {
                __workingCopy->setBookId(bookId);
        }
 }
@@ -82,8 +81,7 @@ CalEditView::CalEditView(const CalDate& focusedDate) : CalView("CalEditView")
        __workingCopy = CalSchedule::makeDefaultSchedule(focusedDate);
 
        const int bookId = CalSettingsManager::getInstance().getLastUsedCalendar();
-       if (CalBookManager::getInstance().getBook(bookId))
-       {
+       if (CalBookManager::getInstance().getBook(bookId)) {
                __workingCopy->setBookId(bookId);
        }
 
@@ -100,8 +98,7 @@ CalEditView::CalEditView(std::shared_ptr<CalSchedule> schedule, CalEditMode mode
 
        __inputSchedule = schedule;
        __mode = mode;
-       switch(__mode)
-       {
+       switch(__mode) {
                case CREATE:
                case EDIT_EXTERNAL:
                        __workingCopy = __inputSchedule;
@@ -124,11 +121,9 @@ CalEditView::CalEditView(std::shared_ptr<CalSchedule> schedule, CalEditMode mode
        }
 
        bool isReadOnly = CalBookManager::getInstance().getBook(__workingCopy->getBookId())->isReadOnly();
-       if( (__mode == CREATE && setLastUsedCalendar == true) || (__mode == COPY && isReadOnly))
-       {
+       if( (__mode == CREATE && setLastUsedCalendar == true) || (__mode == COPY && isReadOnly)) {
                const int bookId = CalSettingsManager::getInstance().getLastUsedCalendar();
-               if (CalBookManager::getInstance().getBook(bookId))
-               {
+               if (CalBookManager::getInstance().getBook(bookId)) {
                        __workingCopy->setBookId(bookId);
                }
        }
@@ -142,8 +137,7 @@ CalEditView::~CalEditView()
 
        free(__currentParticipantKeyword);
 
-       if (__idler)
-       {
+       if (__idler) {
                ecore_timer_del(__idler);
                __idler = NULL;
        }
@@ -196,8 +190,7 @@ void CalEditView::createRepeatPopup(WNaviframe *naviframe, CalScheduleRepeat &re
                        repeat.print();
                        CalScheduleRepeat tmpRepeat(repeat);
                        tmpRepeat.setDefault(repeatUnitType,dateTime,timezone);
-                       switch (repeatUnitType)
-                       {
+                       switch (repeatUnitType) {
                                case CalScheduleRepeat::DAY:
                                        view = new CalEditRepeatDailyView(
                                                        tmpRepeat, dateTime, doneCb
@@ -226,8 +219,7 @@ void CalEditView::createRepeatPopup(WNaviframe *naviframe, CalScheduleRepeat &re
                                        break;
                        }
 
-                       if (!view)
-                       {
+                       if (!view) {
                                return;
                        }
 
@@ -241,8 +233,7 @@ void CalEditView::createRepeatPopup(WNaviframe *naviframe, CalScheduleRepeat &re
 
 void CalEditView::__removeLocation()
 {
-       if(!__location)
-       {
+       if(!__location) {
                return;
        }
 
@@ -258,49 +249,38 @@ void CalEditView::__removeLocation()
 void CalEditView::__onAddLocationField()
 {
        WENTER();
-       if (__location)
-       {
+       if (__location) {
                return;
        }
 
-       __location = new CalDialogEditOptionalTextFieldItem(LOCATION, [this](CalUnderlineEditField* editField)
-       {
+       __location = new CalDialogEditOptionalTextFieldItem(LOCATION, [this](CalUnderlineEditField* editField) {
                std::string location;
                __workingCopy->getDisplayLocation(-1, location);
 
                editField->setText(location.c_str());
 
                int fontSize = __location->getSystemFontSize();
-               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE)
-               {
+               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE) {
                        editField->setFontSize(fontSize);
                        editField->setGuideText(_L_G_("IDS_CLD_BUTTON_LOCATION_ABB"), fontSize);
-               }
-               else
-               {
+               } else {
                        editField->setGuideText(_L_G_("IDS_CLD_BUTTON_LOCATION_ABB"), 0);
                }
 
-               editField->setChangeCallback([this](const char* text)
-               {
+               editField->setChangeCallback([this](const char* text) {
                        WDEBUG("Location : %s", text);
                        __workingCopy->setLocation(text);
                });
 
-               editField->setCompleteCallback([this]()
-               {
-                       if (__description)
-                       {
+               editField->setCompleteCallback([this]() {
+                       if (__description) {
                                __description->getEditField()->setFocusToEntry();
-                       }
-                       else
-                       {
+                       } else {
                                elm_object_focus_next(getNaviframe()->getEvasObj(), ELM_FOCUS_NEXT);
                        }
                });
 
-               editField->setEntryMaxLenReachCallback([this]()
-               {
+               editField->setEntryMaxLenReachCallback([this]() {
                        char warningText[CAL_WARNING_MAX_LENGTH] = {0};
                        snprintf(warningText, sizeof(warningText)-1, _L_("IDS_CLD_TPOP_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_REACHED"), CAL_EVENT_TITLE_MAX_CHAR_LIMIT);
                        notification_status_message_post(warningText);
@@ -309,17 +289,13 @@ void CalEditView::__onAddLocationField()
                editField->setEntryReturnKeyType(CalUnderlineEditField::DONE);
 
                CalUnderlineEditField* titleEditField = __title->getEditField();
-               if (titleEditField)
-               {
+               if (titleEditField) {
                        titleEditField->setEntryReturnKeyType(CalUnderlineEditField::NEXT);
                }
 
-               if (__description == NULL)
-               {
+               if (__description == NULL) {
                        editField->setEntryReturnKeyType(CalUnderlineEditField::DONE);
-               }
-               else
-               {
+               } else {
                        editField->setEntryReturnKeyType(CalUnderlineEditField::NEXT);
                }
        });
@@ -339,16 +315,14 @@ void CalEditView::__onAddLocationButton()
        __onAddLocationField();
        __setFocusToField(__location);
 
-       if (__more)
-       {
+       if (__more) {
                __more->setButtonDisable(CalDialogEditMoreItem::LOCATION, true);
        }
 }
 
 void CalEditView::__removeRepeatItem()
 {
-       if(!__repeat)
-       {
+       if(!__repeat) {
                return;
        }
 
@@ -411,13 +385,11 @@ void CalEditView::__addRepeat()
        );
 
        Elm_Object_Item* itemOjbect = __dialog->add(__repeat);
-       if (__mode == EDIT_INSTANCE)
-       {
+       if (__mode == EDIT_INSTANCE) {
                elm_object_item_disabled_set(itemOjbect, EINA_TRUE);
        }
 
-       if (__more)
-       {
+       if (__more) {
                __more->setButtonDisable(CalDialogEditMoreItem::REPEAT, true);
        }
 }
@@ -507,11 +479,9 @@ CalDialogEditOneTextRemoveIconItem* CalEditView::__createReminderItem(const CalS
 
                CalScheduleReminder reminder;
                const int count = __workingCopy->getRemindersCount();
-               for (int i = 0; i < count; i++)
-               {
+               for (int i = 0; i < count; i++) {
                        __workingCopy->getReminder(i, reminder);
-                       if(reminder.getMinuteValue() == reminderInterval)
-                       {
+                       if(reminder.getMinuteValue() == reminderInterval) {
                                break;
                        }
                }
@@ -564,19 +534,16 @@ CalDialogEditOneTextRemoveIconItem* CalEditView::__createReminderOffItem()
 void CalEditView::__addReminder(const CalScheduleReminder& reminder)
 {
        bool needToAdd = true;
-       for(int i = 0; i < MAX_REMINDER_COUNT; i++)
-       {
+       for(int i = 0; i < MAX_REMINDER_COUNT; i++) {
                CalScheduleReminder existReminder;
                __workingCopy->getReminder(i, existReminder);
-               if(existReminder.unitType != CalScheduleReminder::NONE && existReminder.getMinuteValue() == reminder.getMinuteValue())
-               {
+               if(existReminder.unitType != CalScheduleReminder::NONE && existReminder.getMinuteValue() == reminder.getMinuteValue()) {
                        needToAdd = false;
                        break;
                }
        }
 
-       if(needToAdd)
-       {
+       if(needToAdd) {
                __removeAllReminderItems();
                __workingCopy->addReminder(reminder);
                __addAllReminderItems();
@@ -589,10 +556,8 @@ void CalEditView::__addAllReminderItems()
        const int count = __workingCopy->getRemindersCount();
        WDEBUG("Count: %d", count);
 
-       if(!count)
-       {
-               if(__reminderTitleItem)
-               {
+       if(!count) {
+               if(__reminderTitleItem) {
                        __removeReminderTitleItem();
                }
 
@@ -604,27 +569,23 @@ void CalEditView::__addAllReminderItems()
        memset(__reminderItems, 0, sizeof(__reminderItems));
 
        std::set<CalScheduleReminder> reminders;
-       for (int i = 0; i < count; i++)
-       {
+       for (int i = 0; i < count; i++) {
                CalScheduleReminder reminder;
                __workingCopy->getReminder(i, reminder);
                reminders.insert(reminder);
        }
 
        int reminderIndex = 0;
-       for(auto it = reminders.begin(); it != reminders.end() && reminderIndex < MAX_REMINDER_COUNT; ++it)
-       {
+       for(auto it = reminders.begin(); it != reminders.end() && reminderIndex < MAX_REMINDER_COUNT; ++it) {
                __reminderItems[reminderIndex] = __createReminderItem((*it), reminderIndex + REMINDER1);
-               if(__reminderItems[reminderIndex])
-               {
+               if(__reminderItems[reminderIndex]) {
                        __reminderItems[reminderIndex]->setCustomData((void*)(intptr_t)((*it).getMinuteValue()));
                        __dialog->add(__reminderItems[reminderIndex]);
                        ++reminderIndex;
                }
        }
 
-       if (__more)
-       {
+       if (__more) {
                __more->setButtonDisable(CalDialogEditMoreItem::REMINDER, count == MAX_REMINDER_COUNT);
        }
 }
@@ -636,10 +597,8 @@ void CalEditView::__removeAllReminderItems()
        WASSERT(count >= 0);
        WDEBUG("Count: %d", count);
 
-       for (int i = 0; i < MAX_REMINDER_COUNT; i++)
-       {
-               if (__reminderItems[i] == NULL)
-               {
+       for (int i = 0; i < MAX_REMINDER_COUNT; i++) {
+               if (__reminderItems[i] == NULL) {
                        continue;
                }
 
@@ -654,8 +613,7 @@ void CalEditView::__removeAllReminderItems()
 
 void CalEditView::__addReminderTitleItem()
 {
-       if (__reminderTitleItem)
-       {
+       if (__reminderTitleItem) {
                return;
        }
 
@@ -665,8 +623,7 @@ void CalEditView::__addReminderTitleItem()
 
 void CalEditView::__removeReminderTitleItem()
 {
-       if (!__reminderTitleItem)
-       {
+       if (!__reminderTitleItem) {
                return;
        }
 
@@ -680,11 +637,9 @@ int CalEditView::__getReminderIndexFromInterval(const int reminderInterval)
 
        CalScheduleReminder reminder;
        const int count = __workingCopy->getRemindersCount();
-       for (int i = 0; i < count; i++)
-       {
+       for (int i = 0; i < count; i++) {
                __workingCopy->getReminder(i, reminder);
-               if(reminder.getMinuteValue() == reminderInterval)
-               {
+               if(reminder.getMinuteValue() == reminderInterval) {
                        reminderIndex = i;
                        break;
                }
@@ -697,12 +652,9 @@ void CalEditView::__applyChangesToReminder(const CalScheduleReminder& reminder,
 {
        const int reminderIndex = __getReminderIndexFromInterval((intptr_t)(reminderItem->getCustomData()));
 
-       if(reminder.unitType == CalScheduleReminder::NONE)
-       {
+       if(reminder.unitType == CalScheduleReminder::NONE) {
                __workingCopy->removeReminder(reminderIndex);
-       }
-       else
-       {
+       } else {
                __workingCopy->setReminder(reminderIndex, reminder);
        }
 
@@ -716,8 +668,7 @@ void CalEditView::__onAddReminderButton()
        WENTER();
 
        const int count = __workingCopy->getRemindersCount();
-       if (__more)
-       {
+       if (__more) {
                __more->setButtonDisable(CalDialogEditMoreItem::REMINDER, count == MAX_REMINDER_COUNT);
        }
 
@@ -728,8 +679,7 @@ void CalEditView::__onAddReminderButton()
        CalEditReminderPopup* popup = new CalEditReminderPopup(reminder, false);
        popup->setDoneCb(
                [this](const CalScheduleReminder& reminder, int radio_index) {
-                       if(radio_index > 1)
-                       {
+                       if(radio_index > 1) {
                                __addReminder(reminder);
                        }
                }
@@ -753,8 +703,7 @@ void CalEditView::__clearMoreSubItems()
        WENTER();
        __isMoreShown = false;
 
-       if(__more)
-       {
+       if(__more) {
                __more->setButtonDisable(CalDialogEditMoreItem::REMINDER, false);
        }
 
@@ -764,30 +713,20 @@ void CalEditView::__clearMoreSubItems()
 
 void CalEditView::__resetAllEntryState(CalDialogControl::Item* item)
 {
-       if (!item)
-       {
+       if (!item) {
                return;
        }
 
-       if (item->getSortIndex() == LOCATION)
-       {
-               if (__description)
-               {
+       if (item->getSortIndex() == LOCATION) {
+               if (__description) {
                        return;
-               }
-               else if (__title && __title->getEditField())
-               {
+               } else if (__title && __title->getEditField()) {
                        __title->getEditField()->setEntryReturnKeyType(CalUnderlineEditField::DONE);
                }
-       }
-       else if (item->getSortIndex() == DESCRIPTION)
-       {
-               if (__location)
-               {
+       } else if (item->getSortIndex() == DESCRIPTION) {
+               if (__location) {
                        __location->getEditField()->setEntryReturnKeyType(CalUnderlineEditField::DONE);
-               }
-               else if (__title && __title->getEditField())
-               {
+               } else if (__title && __title->getEditField()) {
                        __title->getEditField()->setEntryReturnKeyType(CalUnderlineEditField::DONE);
                }
        }
@@ -829,8 +768,7 @@ gboolean CalEditView::__onIdlerToFreeItem(gpointer data)
 
 void CalEditView::__removeTimezoneItem()
 {
-       if(!__timezone)
-       {
+       if(!__timezone) {
                return;
        }
 
@@ -845,8 +783,7 @@ void CalEditView::__removeTimezoneItem()
 
 void CalEditView::__onAddTimezoneField()
 {
-       if (__timezone)
-       {
+       if (__timezone) {
                return;
        }
 
@@ -854,21 +791,17 @@ void CalEditView::__onAddTimezoneField()
        std::string tz;
        std::string dT;
 
-       if (!defaultTz || strlen(defaultTz) == 0)
-       {
+       if (!defaultTz || strlen(defaultTz) == 0) {
                tz.clear();
                CalSettingsManager::getInstance().getCalendarTimeZone(tz);
-       }
-       else
-       {
+       } else {
                tz = defaultTz;
        }
 
        CalLocaleManager::getInstance().getDisplayTextTimeZone(tz, dT);
        __timezone = new CalDialogEditTwoTextRemoveIconItem(TIMEZONE, _L_S_("IDS_CLD_HEADER_TIME_ZONE_ABB"), dT.c_str());
        __timezone->setSelectCb(
-               [this]()
-               {
+               [this]() {
                        app_control_h service;
                        app_control_create(&service);
                        app_control_set_operation(service, APP_CONTROL_OPERATION_PICK);
@@ -876,8 +809,7 @@ void CalEditView::__onAddTimezoneField()
                        app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
 
                        CalAppControlLauncher::getInstance().sendLaunchRequest(service,
-                               [](app_control_h request, app_control_h reply, app_control_result_e result, void *data)
-                               {
+                               [](app_control_h request, app_control_h reply, app_control_result_e result, void *data) {
                                        CalEditView *self = (CalEditView *)data;
 
                                        char* timezone = NULL;
@@ -918,8 +850,7 @@ void CalEditView::__onAddTimezoneField()
 
 void CalEditView::__removeDescription()
 {
-       if(!__description)
-       {
+       if(!__description) {
                return;
        }
 
@@ -935,37 +866,30 @@ void CalEditView::__removeDescription()
 void CalEditView::__onAddDescriptionField()
 {
        WENTER();
-       if (__description)
-       {
+       if (__description) {
                return;
        }
 
        __description = new CalDialogEditOptionalTextFieldItem(DESCRIPTION,
-               [this](CalUnderlineEditField* editField)
-       {
+               [this](CalUnderlineEditField* editField) {
                std::string description;
                __workingCopy->getDisplayDescription(description);
 
                editField->setText(description.c_str());
 
                int fontSize = __description->getSystemFontSize();
-               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE)
-               {
+               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE) {
                        editField->setFontSize(fontSize);
                        editField->setGuideText(_L_G_("IDS_CLD_BUTTON_NOTES_ABB"), fontSize);
-               }
-               else
-               {
+               } else {
                        editField->setGuideText(_L_G_("IDS_CLD_BUTTON_NOTES_ABB"), 0);
                }
 
-               editField->setChangeCallback([this](const char* text)
-               {
+               editField->setChangeCallback([this](const char* text) {
                        __workingCopy->setDescription(text);
                });
 
-               editField->setEntryMaxLenReachCallback([this]()
-               {
+               editField->setEntryMaxLenReachCallback([this]() {
                        char warningText[CAL_WARNING_MAX_LENGTH] = {0};
                        snprintf(warningText, sizeof(warningText)-1, _L_("IDS_CLD_TPOP_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_REACHED"), CAL_EVENT_TITLE_MAX_CHAR_LIMIT);
                        notification_status_message_post(warningText);
@@ -973,12 +897,9 @@ void CalEditView::__onAddDescriptionField()
 
                editField->setEntryReturnKeyType(CalUnderlineEditField::DONE);
 
-               if (__location)
-               {
+               if (__location) {
                        __location->getEditField()->setEntryReturnKeyType(CalUnderlineEditField::NEXT);
-               }
-               else if(__title && __title->getEditField())
-               {
+               } else if(__title && __title->getEditField()) {
                        __title->getEditField()->setEntryReturnKeyType(CalUnderlineEditField::NEXT);
                }
        },
@@ -993,24 +914,18 @@ void CalEditView::__onAddDescriptionField()
 
 bool CalEditView::__isTitleChanged()
 {
-       switch(__mode)
-       {
+       switch(__mode) {
                case EDIT_INSTANCE:
                case EDIT_THIS_AND_FURTURE:
                case EDIT:
                {
                        const char* before = __inputSchedule->getSummary();
                        const char* after = __workingCopy->getSummary();
-                       if (before && after && !strcmp(before, after))
-                       {
+                       if (before && after && !strcmp(before, after)) {
                                return false;
-                       }
-                       else if (before == NULL && after == NULL)
-                       {
+                       } else if (before == NULL && after == NULL) {
                                return false;
-                       }
-                       else
-                       {
+                       } else {
                                return true;
                        }
                }
@@ -1019,17 +934,12 @@ bool CalEditView::__isTitleChanged()
                case CREATE:
                {
                        char *summary = elm_entry_utf8_to_markup(__workingCopy->getSummary());
-                       if (!summary)
-                       {
+                       if (!summary) {
                                return false;
-                       }
-                       else if (!strcmp(summary, ""))
-                       {
+                       } else if (!strcmp(summary, "")) {
                                free(summary);
                                return false;
-                       }
-                       else
-                       {
+                       } else {
                                free(summary);
                                return true;
                        }
@@ -1044,12 +954,10 @@ void CalEditView::__updateMoreButtonStatus()
 {
        CalDateTime startTime;
        __workingCopy->getStart(startTime);
-       if(__more != NULL)
-       {
+       if(__more != NULL) {
                bool is_disabled = false;
 
-               if (__description && (__timezone || (startTime.isAllDay() || (__time && __time->isAllDay())) ) )
-               {
+               if (__description && (__timezone || (startTime.isAllDay() || (__time && __time->isAllDay())) ) ) {
                        is_disabled = true;
                }
 
@@ -1060,12 +968,9 @@ void CalEditView::__updateMoreButtonStatus()
 void CalEditView::__updateMoreItemButtonStatus()
 {
        //update location
-       if (__location)
-       {
+       if (__location) {
                __more->setButtonDisable(CalDialogEditMoreItem::LOCATION, true);
-       }
-       else
-       {
+       } else {
                __more->setButtonDisable(CalDialogEditMoreItem::LOCATION, false);
        }
 
@@ -1074,12 +979,9 @@ void CalEditView::__updateMoreItemButtonStatus()
        __more->setButtonDisable(CalDialogEditMoreItem::REMINDER, count == MAX_REMINDER_COUNT);
 
        //update repeat
-       if (__repeat)
-       {
+       if (__repeat) {
                __more->setButtonDisable(CalDialogEditMoreItem::REPEAT, true);
-       }
-       else
-       {
+       } else {
                __more->setButtonDisable(CalDialogEditMoreItem::REPEAT, false);
        }
 }
@@ -1094,8 +996,7 @@ void CalEditView::__onAddMoreButton()
        CalDateTime startTime;
        __workingCopy->getStart(startTime);
 
-       if (__timezone || startTime.isAllDay() || __time->isAllDay())
-       {
+       if (__timezone || startTime.isAllDay() || __time->isAllDay()) {
                showTimezone = false;
        }
 
@@ -1106,8 +1007,7 @@ void CalEditView::__onAddMoreButton()
                                __onAddDescriptionField();
                                if (__description) {
                                        elm_genlist_item_bring_in((Elm_Object_Item*)__description->getElmObjectItem(), ELM_GENLIST_ITEM_SCROLLTO_TOP);
-                                       if (__description->getEditField())
-                                       {
+                                       if (__description->getEditField()) {
                                                 __setFocusToField(__description);
                                        }
                                }
@@ -1119,14 +1019,12 @@ void CalEditView::__onAddMoreButton()
                        }
                        __updateMoreButtonStatus();
 
-                       if (type != CalDialogEditMoreMenuItem::DESCRIPTION)
-                       {
+                       if (type != CalDialogEditMoreMenuItem::DESCRIPTION) {
                                Ecore_IMF_Context *ctx = ecore_imf_context_add(ecore_imf_context_default_id_get());
                                Ecore_IMF_Input_Panel_State imf_state = ecore_imf_context_input_panel_state_get(ctx);
                                ecore_imf_context_del(ctx);
 
-                               if (imf_state != ECORE_IMF_INPUT_PANEL_STATE_HIDE)
-                               {
+                               if (imf_state != ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
                                        ecore_imf_input_panel_hide();
                                }
                        }
@@ -1140,30 +1038,25 @@ void CalEditView::__onAddMoreButton()
 void CalEditView::__addItemsForNoEmptyField()
 {
        const char* loc = __workingCopy->getLocation();
-       if (loc && strlen(loc))
-       {
+       if (loc && strlen(loc)) {
                __onAddLocationButton();
        }
 
        CalScheduleRepeat repeat = __workingCopy->getRepeat();
-       if (repeat.unitType != CalScheduleRepeat::ONE_TIME)
-       {
+       if (repeat.unitType != CalScheduleRepeat::ONE_TIME) {
                __addRepeat();
        }
 
        const char* desc = __workingCopy->getDescription();
-       if (desc && strlen(desc))
-       {
+       if (desc && strlen(desc)) {
                __onAddDescriptionField();
        }
 
        const char* defaultTz = __workingCopy->getTimeZone();
        std::string tz;
-       if (defaultTz)
-       {
+       if (defaultTz) {
                CalSettingsManager::getInstance().getTimeZone(tz);
-               if (tz.compare(defaultTz) != 0)
-               {
+               if (tz.compare(defaultTz) != 0) {
                        __onAddTimezoneField();
                }
        }
@@ -1180,8 +1073,7 @@ void CalEditView::__update()
 
        //first, to check if the record is deleted in db;
        std::shared_ptr<CalBook> book;
-       switch(__mode)
-       {
+       switch(__mode) {
                case EDIT_INSTANCE:
                case EDIT_THIS_AND_FURTURE:
                case EDIT:
@@ -1195,8 +1087,7 @@ void CalEditView::__update()
                        break;
                case CREATE:
                        book = CalBookManager::getInstance().getBook(__workingCopy->getBookId());
-                       if (book == NULL)
-                       {
+                       if (book == NULL) {
                                __workingCopy = CalSchedule::makeDefaultSchedule(__focusedDate);
                        }
                        break;
@@ -1209,37 +1100,31 @@ void CalEditView::__update()
        elm_genlist_item_update((Elm_Object_Item*)__title->getElmObjectItem());
 
        //update "start time, end time, all day"
-       if (__time)
-       {
+       if (__time) {
                __time->update();
        }
 
        //update more item
-       if (__more)
-       {
+       if (__more) {
                bool disableLocation = false;
                bool disableReminder = false;
                bool disableRepeat = false;
                bool disableMore = false;
 
-               if (__location)
-               {
+               if (__location) {
                        disableLocation= true;
                }
 
                int count = __workingCopy->getRemindersCount();
-               if (count == MAX_REMINDER_COUNT)
-               {
+               if (count == MAX_REMINDER_COUNT) {
                        disableReminder = true;
                }
 
-               if (__repeat)
-               {
+               if (__repeat) {
                        disableRepeat = true;
                }
 
-               if (__description && __timezone)
-               {
+               if (__description && __timezone) {
                        disableMore = true;
                }
 
@@ -1249,19 +1134,15 @@ void CalEditView::__update()
        }
 
        //update location
-       if (__location)
-       {
+       if (__location) {
                elm_genlist_item_update((Elm_Object_Item*)__location->getElmObjectItem());
        }
 
        //update reminder title
-       if (__reminderTitleItem)
-       {
+       if (__reminderTitleItem) {
                elm_genlist_item_update((Elm_Object_Item*)__reminderTitleItem->getElmObjectItem());
-               for (int i = 0; i< MAX_REMINDER_COUNT; i++)
-               {
-                       if (__reminderItems[i])
-                       {
+               for (int i = 0; i< MAX_REMINDER_COUNT; i++) {
+                       if (__reminderItems[i]) {
                                CalScheduleReminder reminder;
                                __workingCopy->getReminder(i, reminder);
                                std::string reminderText;
@@ -1273,8 +1154,7 @@ void CalEditView::__update()
        }
 
        //update repeat
-       if (__repeat)
-       {
+       if (__repeat) {
                CalScheduleRepeat repeat = __workingCopy->getRepeat();
                std::string repeatString;
 
@@ -1296,10 +1176,8 @@ void CalEditView::__update()
        std::string currentTz;
        CalSettingsManager::getInstance().getCalendarTimeZone(currentTz);
 
-       if (__timezone && __isChanged)
-       {
-               if (eventTz != currentTz)
-               {
+       if (__timezone && __isChanged) {
+               if (eventTz != currentTz) {
                        __workingCopy->setTimeZone(currentTz.c_str());
                        eventTz = currentTz.c_str();
                }
@@ -1309,26 +1187,21 @@ void CalEditView::__update()
 
                __timezone->setSubText(displayTimeZone.c_str());
                elm_genlist_item_update((Elm_Object_Item*)__timezone->getElmObjectItem());
-       }
-       else
-       {
-               if (eventTz != currentTz)
-               {
+       } else {
+               if (eventTz != currentTz) {
                        __onAddTimezoneField();
                }
        }
 
        //update description
-       if (__description)
-       {
+       if (__description) {
                elm_genlist_item_update((Elm_Object_Item*)__description->getElmObjectItem());
        }
 }
 
 void CalEditView::__onAddTitleField()
 {
-       __title = new CalDialogEditTextFieldItem(TITLE, [this](CalUnderlineEditField* editField)
-       {
+       __title = new CalDialogEditTextFieldItem(TITLE, [this](CalUnderlineEditField* editField) {
                char *summary = NULL;
                summary = elm_entry_utf8_to_markup(__workingCopy->getSummary());
 
@@ -1337,51 +1210,38 @@ void CalEditView::__onAddTitleField()
                summary = NULL;
 
                int fontSize = __title->getSystemFontSize();
-               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE)
-               {
+               if(abs(fontSize) > TEXT_ITEM_DEFAULT_SIZE) {
                        editField->setFontSize(fontSize);
                        editField->setGuideText(_L_G_("IDS_CLD_BODY_TITLE"), fontSize);
-               }
-               else
-               {
+               } else {
                        editField->setGuideText(_L_G_("IDS_CLD_BODY_TITLE"), 0);
                }
 
-               editField->setChangeCallback([this](const char* text)
-               {
+               editField->setChangeCallback([this](const char* text) {
                        __workingCopy->setSummary(text);
                });
 
-               editField->setEntryMaxLenReachCallback([this]()
-               {
+               editField->setEntryMaxLenReachCallback([this]() {
                        char warningText[CAL_WARNING_MAX_LENGTH] = {0};
                        snprintf(warningText, sizeof(warningText)-1, _L_("IDS_CLD_TPOP_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_REACHED"), CAL_EVENT_TITLE_MAX_CHAR_LIMIT);
                        notification_status_message_post(warningText);
                });
 
-               editField->setCompleteCallback([this]()
-               {
-                       if (__location)
-                       {
+               editField->setCompleteCallback([this]() {
+                       if (__location) {
                                __location->getEditField()->setFocusToEntry();
-                       }
-                       else if (__description)
-                       {
+                       } else if (__description) {
                                __description->getEditField()->setFocusToEntry();
                        }
                });
 
-               if (__location || __description)
-               {
+               if (__location || __description) {
                        editField->setEntryReturnKeyType(CalUnderlineEditField::NEXT);
-               }
-               else
-               {
+               } else {
                        editField->setEntryReturnKeyType(CalUnderlineEditField::DONE);
                }
        }, [this](CalUnderlineEditField* editField) {
-               if (__mode == CREATE)
-               {
+               if (__mode == CREATE) {
                        editField->setFocusToEntry();
                }
        });
@@ -1396,16 +1256,13 @@ void CalEditView::__setTime()
        Eina_Bool allDay = EINA_TRUE;
        __time->getDateTime(&startDateTime, &endDateTime, &allDay);
 
-       if (allDay)
-       {
-               if(startDateTime > endDateTime)
-               {
+       if (allDay) {
+               if(startDateTime > endDateTime) {
                        notification_status_message_post(_L_("IDS_CLD_TPOP_END_TIME_SHOULD_BE_LATER_THAN_START_TIME"));
                        endDateTime = startDateTime;
                }
        } else {
-               if(startDateTime >= endDateTime)
-               {
+               if(startDateTime >= endDateTime) {
                        notification_status_message_post(_L_("IDS_CLD_TPOP_END_TIME_SHOULD_BE_LATER_THAN_START_TIME"));
                        endDateTime = startDateTime;
                        endDateTime.addHours(1);
@@ -1422,24 +1279,18 @@ void CalEditView::__setTime()
 
 void CalEditView::__setFocusToField(CalDialogControl::Item *field)
 {
-       if(field == __location || field == __description)
-       {
-       __idler = ecore_idler_add([](void* data)
-               {
+       if(field == __location || field == __description) {
+       __idler = ecore_idler_add([](void* data) {
                        CalDialogEditOptionalTextFieldItem *self = (CalDialogEditOptionalTextFieldItem*) data;
                        self->getEditField()->setFocusToEntry();
                        return ECORE_CALLBACK_CANCEL;
                }, field);
-       }
-       else if(field == __title)
-       {
-               __idler = ecore_idler_add([](void* data)
-                       {
+       } else if(field == __title) {
+               __idler = ecore_idler_add([](void* data) {
                                CalDialogEditTextFieldItem *self = (CalDialogEditTextFieldItem*) data;
 
                                CalUnderlineEditField *editField = self->getEditField();
-                               if (editField)
-                               {
+                               if (editField) {
                                        self->getEditField()->setFocusToEntry();
                                }
                                return ECORE_CALLBACK_CANCEL;
@@ -1462,8 +1313,7 @@ void CalEditView::__onAddTimeField()
        __time->setChangeCb([this](CalDateTime &startDateTime, CalDateTime &endDateTime){
                Eina_Bool isAllDay = EINA_TRUE;
                __time->getDateTime(NULL, NULL, &isAllDay);
-               if (__timezone && isAllDay)
-               {
+               if (__timezone && isAllDay) {
                        WDEBUG("Remove timezone");
                        __dialog->remove(__timezone);
                        __timezone = NULL;
@@ -1483,8 +1333,7 @@ void CalEditView::__onAddTimeField()
        });
 
        const char* tz = __workingCopy->getTimeZone();
-       if (tz)
-       {
+       if (tz) {
                __time->setTimeZone(tz);
        }
 
@@ -1516,8 +1365,7 @@ void CalEditView::__onAddMoreField()
                __workingCopy->getRemindersCount() >= MAX_REMINDER_COUNT
        );
 
-       if(__more)
-       {
+       if(__more) {
                __dialog->add(__more);
        }
 }
@@ -1552,8 +1400,7 @@ Evas_Object* CalEditView::onCreate(Evas_Object* parent, void* viewParam)
        // add location and other fields on edit mode or create mode with extra params from appcontrol
        __addItemsForNoEmptyField();
 
-       if (__workingCopy->hasReminder())
-       {
+       if (__workingCopy->hasReminder()) {
                __addAllReminderItems();
        }
 
@@ -1572,12 +1419,9 @@ void CalEditView::onPushed(Elm_Object_Item* naviItem)
 {
        WENTER();
 
-       if (__mode == CREATE || __mode == COPY)
-       {
+       if (__mode == CREATE || __mode == COPY) {
                elm_object_item_part_text_set(getNaviItem(), "elm.text.title", _L_("IDS_CLD_OPT_CREATE"));
-       }
-       else
-       {
+       } else {
                elm_object_item_part_text_set(getNaviItem(), "elm.text.title", _L_("IDS_CLD_OPT_EDIT"));
        }
 
@@ -1601,12 +1445,9 @@ void CalEditView::onPushed(Elm_Object_Item* naviItem)
                        pCalEditView->__isPrepareExit = true;
                        pCalEditView->__onSave();
                        pCalEditView->__isDiscard = true;
-                       if (((CalNaviframe*)pCalEditView->getNaviframe())->getTopView() == pCalEditView)
-                       {
+                       if (((CalNaviframe*)pCalEditView->getNaviframe())->getTopView() == pCalEditView) {
                                pCalEditView->popOut();
-                       }
-                       else
-                       {
+                       } else {
                                pCalEditView->destroy();
                        }
                }, this
@@ -1623,8 +1464,7 @@ void CalEditView::__onNaviframeTransitionFinished(void* data, Evas_Object* obj,
        CalEditView* self = (CalEditView* )data;
        self->__updateMoreItemButtonStatus();/*for location, reminder, repeat 3 buttons*/
        self->__updateMoreButtonStatus(); /*for more button*/
-       if (self->__title && self->__title->getEditField())
-       {
+       if (self->__title && self->__title->getEditField()) {
                self->__title->getEditField()->setFocusToEntry();
        }
        evas_object_smart_callback_del(self->getNaviframe()->getEvasObj(), "transition,finished", __onNaviframeTransitionFinished);
@@ -1640,20 +1480,16 @@ void CalEditView::onEvent(const CalEvent& event)
 {
        WENTER();
        WDEBUG("type = %u, source = %u", event.type, event.source);
-       switch (event.type)
-       {
+       switch (event.type) {
                case CalEvent::DB_CHANGED:
                        break;
                case CalEvent::TIME_CHANGED:
                case CalEvent::LANGUAGE_CHANGED:
                case CalEvent::SETTING_CHANGED:
                case CalEvent::CONTACTS_EMAIL_CHANGED:
-                       if (__mode == CREATE || __mode == COPY)
-                       {
+                       if (__mode == CREATE || __mode == COPY) {
                                elm_object_item_part_text_set(getNaviItem(), "elm.text.title", _L_("IDS_CLD_OPT_CREATE"));
-                       }
-                       else
-                       {
+                       } else {
                                elm_object_item_part_text_set(getNaviItem(), "elm.text.title", _L_("IDS_CLD_OPT_EDIT"));
                        }
                        elm_object_text_set(elm_object_item_part_content_get(getNaviItem(), "title_left_btn"), _L_("IDS_TPLATFORM_ACBUTTON_CANCEL_ABB"));
@@ -1676,14 +1512,12 @@ void CalEditView::onEvent(const CalEvent& event)
 
 void CalEditView::__toastPopupWarning(const bool isOverlapped, const int ret)
 {
-       if (ret != 0)
-       {
+       if (ret != 0) {
                notification_status_message_post(_L_("IDS_CLD_TPOP_FAILED_TO_SAVE_EVENT_UNKNOWN_ERROR_OCCURRED"));
                return;
        }
 
-       switch (__mode)
-       {
+       switch (__mode) {
                case EDIT:
                case EDIT_INSTANCE:
                case EDIT_THIS_AND_FURTURE:
@@ -1692,12 +1526,9 @@ void CalEditView::__toastPopupWarning(const bool isOverlapped, const int ret)
                        break;
                case CREATE:
                case COPY:
-                       if (isOverlapped == true)
-                       {
+                       if (isOverlapped == true) {
                                notification_status_message_post(_L_("IDS_CLD_TPOP_EVENT_OVERLAPS_WITH_ANOTHER_EVENT"));
-                       }
-                       else
-                       {
+                       } else {
                                notification_status_message_post(_L_("IDS_CLD_TPOP_EVENT_SAVED"));
                        }
                        break;
@@ -1711,29 +1542,23 @@ void CalEditView::__onSave()
        bool isOverlapped = false;
        int eventId = 0;
 
-       if (__more)
-       {
+       if (__more) {
                elm_object_focus_set(__more->getButton(CalDialogEditMoreItem::MORE), true);/*to avoid keyboard is shown again*/
        }
 
-       if (__isChanged || __isTitleChanged() || __mode == CREATE || __mode == COPY)
-       {
+       if (__isChanged || __isTitleChanged() || __mode == CREATE || __mode == COPY) {
                const char *summary = __workingCopy->getSummary();
-               if (!(summary && strlen(summary)))
-               {
+               if (!(summary && strlen(summary))) {
                        __workingCopy->setSummary(_L_("IDS_CLD_MBODY_MY_EVENT"));
                }
 
-               if(__time->isAllDay())
-               {
+               if(__time->isAllDay()) {
                        CalDateTime startDateTime, endDateTime;
                        Eina_Bool allDay = EINA_TRUE;
                        __time->getDateTime(&startDateTime, &endDateTime, &allDay);
                        __workingCopy->setStart(startDateTime);
                        __workingCopy->setEnd(endDateTime);
-               }
-               else
-               {
+               } else {
                        struct tm time = {};
                        CalDateTime startDateTime;
                        __workingCopy->getStart(startDateTime);
@@ -1748,8 +1573,7 @@ void CalEditView::__onSave()
                        __workingCopy->setEnd(endDateTime);
                }
 
-               switch(__mode)
-               {
+               switch(__mode) {
                        case CREATE:
                        case COPY:
                                isOverlapped = CalDataManager::getInstance().isOverlapped(*__workingCopy);
@@ -1767,15 +1591,13 @@ void CalEditView::__onSave()
                                break;
                }
 
-               if (!ret)
-               {
+               if (!ret) {
                        __postProcessAddButtons();
                }
 
                __toastPopupWarning(isOverlapped, ret);
 
-               if (__savedCb)
-               {
+               if (__savedCb) {
                        __savedCb(eventId);
                }
        }
@@ -1787,21 +1609,18 @@ bool CalEditView::onPop()
        Ecore_IMF_Input_Panel_State imf_state = ecore_imf_context_input_panel_state_get(ctx);
        ecore_imf_context_del(ctx);
 
-       if (imf_state != ECORE_IMF_INPUT_PANEL_STATE_HIDE)
-       {
+       if (imf_state != ECORE_IMF_INPUT_PANEL_STATE_HIDE) {
                // Hide IME if it exists.
                // When pop naviframe with the keypad shown, naviframe pop effect can be cracked. (the animation works for only upper side of composer)
                // It's because keypad process and calendar process works asynchronously.
                ecore_imf_input_panel_hide();
        }
 
-       if (__isDiscard)
-       {
+       if (__isDiscard) {
                return true;
        }
 
-       if(__isChanged || __isTitleChanged())
-       {
+       if(__isChanged || __isTitleChanged()) {
                WPopup *popup = new WPopup(
                                _L_("IDS_CLD_HEADER_DISCARD_CHANGES_ABB"),
                                _L_("IDS_CLD_POP_ALL_CHANGES_WILL_BE_DISCARDED"));
@@ -1826,12 +1645,9 @@ void CalEditView::__createDatePickerPopup(Evas_Object* dateTime)
        CalDateTime startInitialDate, startDateTime, endDateTime;
        __time->getDateTime(&startDateTime, &endDateTime, &allDay);
 
-       if(__time->isStartSelected())
-       {
+       if(__time->isStartSelected()) {
                startInitialDate = startDateTime;
-       }
-       else
-       {
+       } else {
                startInitialDate = endDateTime;
        }
 
@@ -1850,12 +1666,9 @@ void CalEditView::__createTimePickerPopup(Evas_Object* dateTime)
 {
        CalDateTime startInitialTime;
 
-       if(__time->isStartSelected())
-       {
+       if(__time->isStartSelected()) {
                __workingCopy->getStart(startInitialTime);
-       }
-       else
-       {
+       } else {
                __workingCopy->getEnd(startInitialTime);
        }
 
@@ -1871,43 +1684,36 @@ void CalEditView::__createTimePickerPopup(Evas_Object* dateTime)
 
 void CalEditView::__preProcessAddButtons()
 {
-       if (__mode != CREATE)
-       {
+       if (__mode != CREATE) {
                return;
        }
 
-       if (__model.isOn(CalEditModel::LOCATION))
-       {
+       if (__model.isOn(CalEditModel::LOCATION)) {
                __onAddLocationField();
        }
 
-       if (__model.isOn(CalEditModel::REMINDER))
-       {
+       if (__model.isOn(CalEditModel::REMINDER)) {
                __addReminderTitleItem();
                __reminderItems[0] = __createReminderOffItem();
                __dialog->add(__reminderItems[0]);
        }
 
-       if (__model.isOn(CalEditModel::REPEAT))
-       {
+       if (__model.isOn(CalEditModel::REPEAT)) {
                __addRepeatOff();
        }
 
-       if (__model.isOn(CalEditModel::DESCRIPTION))
-       {
+       if (__model.isOn(CalEditModel::DESCRIPTION)) {
                __onAddDescriptionField();
        }
 
-       if (__model.isOn(CalEditModel::TIME_ZONE))
-       {
+       if (__model.isOn(CalEditModel::TIME_ZONE)) {
                __onAddTimezoneField();
        }
 }
 
 void CalEditView::__postProcessAddButtons()
 {
-       if (__mode != CREATE)
-       {
+       if (__mode != CREATE) {
                return;
        }
 
index 0e95e35..9ffd5a0 100644 (file)
@@ -833,8 +833,7 @@ void CalScheduleListControl::processEventItemTap(CalListGroupTitleItem *containe
                Elm_Object_Item *it = __getFirstItem();
                while (it) {
                        Item *item = (Item *)elm_object_item_data_get(it);
-                       if (item && item->isGroupTitle())
-                       {
+                       if (item && item->isGroupTitle()) {
                                CalListGroupTitleItem *groupItem = (CalListGroupTitleItem *)item;
                                __selectedCount += groupItem->getSelectedItemsCount();
                        }
index b0493b6..e3514a8 100644 (file)
@@ -180,14 +180,11 @@ CalMonthControl2* CalMainView::__constructMonthControl(int dir)
 
                        __updateTitle();
 
-                       if (__isCutomFocus)
-                       {
+                       if (__isCutomFocus) {
                                __isCutomFocus = false;
                                __focusedDate = __customFocusDate;
                                getMonth(0).focus(__focusedDate.getMday());
-                       }
-                       else
-                       {
+                       } else {
                                getMonth(0).focus(firstDayOfMonth);
                        }
 
@@ -380,8 +377,7 @@ void CalMainView::onMenuButton()
                        __focusMonth(CalDate());
                        __focusList();
                });
-       if (__list && !__list->isEmpty())
-       {
+       if (__list && !__list->isEmpty()) {
                popup->appendItem(_L_("IDS_CLD_OPT_SEARCH"), [this]() {getNaviframe()->push(new CalSearchView());});
        }
        popup->appendItem(_L_("IDS_CLD_OPT_MANAGE_CALENDARS_ABB"), [this]() {getNaviframe()->push(new CalBookView);});
@@ -398,21 +394,17 @@ void CalMainView::onEvent(const CalEvent& event)
 {
        WENTER();
        WDEBUG("type = %u, source = %u", event.type, event.source);
-       switch (event.type)
-       {
+       switch (event.type) {
                case CalEvent::LANGUAGE_CHANGED:
                case CalEvent::DB_CHANGED:
                case CalEvent::SETTING_CHANGED:
                case CalEvent::TIME_CHANGED:
                case CalEvent::FIRST_DAY_OF_WEEK_CHANGED:
-                       if (__userInteractionInProgress())
-                       {
-                               if (!__updateTimer)
-                               {
+                       if (__userInteractionInProgress()) {
+                               if (!__updateTimer) {
                                        __updateTimer = ecore_timer_add(1.0, [](void* data)->Eina_Bool {
                                                CalMainView* self = (CalMainView*)data;
-                                               if (self->__userInteractionInProgress())
-                                               {
+                                               if (self->__userInteractionInProgress()) {
                                                        WDEBUG("Defer again!");
                                                        return ECORE_CALLBACK_RENEW;
                                                }
@@ -422,11 +414,8 @@ void CalMainView::onEvent(const CalEvent& event)
                                                return ECORE_CALLBACK_CANCEL;
                                        }, this);
                                }
-                       }
-                       else
-                       {
-                               if (__updateTimer)
-                               {
+                       } else {
+                               if (__updateTimer) {
                                        ecore_timer_del(__updateTimer);
                                        __updateTimer = NULL;
                                }
@@ -512,23 +501,19 @@ bool CalMainView::__userInteractionInProgress()
  */
 void CalMainView::__terminateUserInteraction()
 {
-       if (__monthSlideAnimator && __monthSlideAnimator->isActive())
-       {
+       if (__monthSlideAnimator && __monthSlideAnimator->isActive()) {
                __monthSlideAnimator->cancel(true);
        }
 
-       if (__listSlideAnimator && __listSlideAnimator->isActive())
-       {
+       if (__listSlideAnimator && __listSlideAnimator->isActive()) {
                __listSlideAnimator->cancel(true);
        }
 
-       if (__monthDragRecognizer && __monthDragRecognizer->isActive())
-       {
+       if (__monthDragRecognizer && __monthDragRecognizer->isActive()) {
                __monthDragRecognizer->terminate((Evas_Object*)edje_object_part_object_get(elm_layout_edje_get(__mainViewLayout), "month/touch"));
        }
 
-       if (__listDragRecognizer && __listDragRecognizer->isActive())
-       {
+       if (__listDragRecognizer && __listDragRecognizer->isActive()) {
                __listDragRecognizer->terminate((Evas_Object*)edje_object_part_object_get(elm_layout_edje_get(__mainViewLayout), "list/touch"));
        }
 }
@@ -565,8 +550,7 @@ void CalMainView::__createListControl()
                                __listIsBeingDragged = false;
                        }
                        __unblockTouch("__list.onScrollStop");
-                       if(topShowingGroupItem)
-                       {
+                       if(topShowingGroupItem) {
                                const CalDate& topShowingDate = topShowingGroupItem->getDate();
                                __focusMonth(topShowingDate);
                        }
@@ -749,12 +733,9 @@ void CalMainView::__showOnlyFocusedRow()
 void CalMainView::__focusList()
 {
        TRACK_MODE_CHANGE_FLOW(__func__);
-       if (!__list->scrollTo(__focusedDate))
-       {
+       if (!__list->scrollTo(__focusedDate)) {
                __createListControl();
-       }
-       else
-       {
+       } else {
                __terminateUserInteraction();
        }
 }
@@ -765,8 +746,7 @@ void CalMainView::__focusList()
 void CalMainView::__updateTitle()
 {
        setTitle(__focusedDate.getMonthString());
-       if (getNaviItem())
-       {
+       if (getNaviItem()) {
                elm_object_item_part_text_set(getNaviItem(), "elm.text.title", getTitle());
        }
 }
@@ -875,8 +855,7 @@ void CalMainView::__resetMonth(CalMonthControl2& month, int dir)
  */
 void CalMainView::__showNoContent(bool isShow)
 {
-       if (isShow)
-       {
+       if (isShow) {
                Evas_Object* noContents = elm_layout_add(__mainViewLayout);
                elm_layout_theme_set(noContents, "layout", "nocontents", "default");
                evas_object_size_hint_weight_set(noContents, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -887,9 +866,7 @@ void CalMainView::__showNoContent(bool isShow)
                elm_layout_signal_emit(noContents, "align.center", "elm");
                evas_object_show(noContents);
                elm_object_part_content_set(__mainViewLayout, "list/no-events", noContents);
-       }
-       else
-       {
+       } else {
                evas_object_del(elm_object_part_content_unset(__mainViewLayout, "list/no-events"));
        }
 }
index 3f698fe..b415ccc 100644 (file)
@@ -80,8 +80,7 @@ void CalSearchView::onEvent(const CalEvent& event)
 {
        WENTER();
        WDEBUG("type = %u, source = %u", event.type, event.source);
-       switch (event.type)
-       {
+       switch (event.type) {
                case CalEvent::DB_CHANGED:
                case CalEvent::TIME_CHANGED:
                case CalEvent::LANGUAGE_CHANGED:
index 78901ad..cf06b1d 100644 (file)
@@ -43,8 +43,7 @@ Elm_Genlist_Item_Class* CalDialogSettingsMultilSubItem::getItemClassStatic()
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogSettingsMultilSubItem *item = (CalDialogSettingsMultilSubItem*)data;
-               if (0 == strcmp("elm.text.multiline", part))
-               {
+               if (0 == strcmp("elm.text.multiline", part)) {
                        return g_strdup(_L_G_(item->__text));
                }
                return NULL;
index 43f78bf..a56fb7d 100644 (file)
@@ -26,8 +26,7 @@ CalDialogSettingsOneTextOneIconItem::CalDialogSettingsOneTextOneIconItem(std::fu
        , __selectCb(selectCb)
        , __radioCb(nullptr)
 {
-       if(text)
-       {
+       if(text) {
                __text = strdup(text);
        }
 }
@@ -58,8 +57,7 @@ Elm_Genlist_Item_Class* CalDialogSettingsOneTextOneIconItem::getItemClassStatic(
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogSettingsOneTextOneIconItem* item = (CalDialogSettingsOneTextOneIconItem*) data;
-               if (!strcmp(part, "elm.text"))
-               {
+               if (!strcmp(part, "elm.text")) {
                        return strdup(_L_G_(item->__text));
                }
 
@@ -67,8 +65,7 @@ Elm_Genlist_Item_Class* CalDialogSettingsOneTextOneIconItem::getItemClassStatic(
        };
        itc.func.content_get = [](void *data, Evas_Object *obj, const char *part)->Evas_Object*
                {
-                       if (strcmp(part, "elm.swallow.end") == 0)
-                       {
+                       if (strcmp(part, "elm.swallow.end") == 0) {
                                CalDialogSettingsOneTextOneIconItem *item = (CalDialogSettingsOneTextOneIconItem *) data;
 
                                Evas_Object *check = elm_check_add(obj);
@@ -81,8 +78,7 @@ Elm_Genlist_Item_Class* CalDialogSettingsOneTextOneIconItem::getItemClassStatic(
                                evas_object_smart_callback_add(check, "changed", [](void *data, Evas_Object *obj, void *event_info) {
                                                CalSettingsManager::getInstance().setLockTimeZone(!CalSettingsManager::getInstance().getLockTimeZone());
                                                CalDialogSettingsOneTextOneIconItem *item = (CalDialogSettingsOneTextOneIconItem *)data;
-                                               if (item && item->__radioCb)
-                                               {
+                                               if (item && item->__radioCb) {
                                                        item->__radioCb();
                                                }
                                        }
@@ -97,13 +93,11 @@ Elm_Genlist_Item_Class* CalDialogSettingsOneTextOneIconItem::getItemClassStatic(
 void CalDialogSettingsOneTextOneIconItem::onSelect()
 {
        WENTER();
-       if (__checkbox)
-       {
+       if (__checkbox) {
                elm_check_state_set(__checkbox, !elm_check_state_get(__checkbox));
        }
 
-       if (__selectCb)
-       {
+       if (__selectCb) {
                __selectCb();
        }
 }
@@ -111,8 +105,7 @@ void CalDialogSettingsOneTextOneIconItem::onSelect()
 
 void CalDialogSettingsOneTextOneIconItem::setText(const char* text)
 {
-       if(text)
-       {
+       if(text) {
                free(__text);
                __text = strdup(text);
        }
index fe963a3..83d7c69 100644 (file)
@@ -50,34 +50,20 @@ Elm_Genlist_Item_Class* CalDialogSettingsRadioItem::getItemClassStatic()
        itc.func.text_get = [](void* data, Evas_Object* obj, const char* part)->char*
        {
                CalDialogSettingsRadioItem *item = (CalDialogSettingsRadioItem*)data;
-               if (!strcmp("elm.text", part))
-               {
-                       if (item->__type == SUB_LOCALE_DEFAULT)
-                       {
+               if (!strcmp("elm.text", part)) {
+                       if (item->__type == SUB_LOCALE_DEFAULT) {
                                return strdup(_L_("IDS_CLD_OPT_LOCALE_DEFAULT_ABB"));
-                       }
-                       else if(item->__type == SUB_SATURDAY)
-                       {
+                       } else if(item->__type == SUB_SATURDAY) {
                                return strdup(_L_("IDS_CLD_OPT_SATURDAY"));
-                       }
-                       else if (item->__type == SUB_SUNDAY)
-                       {
+                       } else if (item->__type == SUB_SUNDAY) {
                                return strdup(_L_("IDS_CLD_OPT_SUNDAY"));
-                       }
-                       else if (item->__type == SUB_MONDAY)
-                       {
+                       } else if (item->__type == SUB_MONDAY) {
                                return strdup(_L_("IDS_CLD_OPT_MONDAY"));
-                       }
-                       else if (item->__type == SUB_ALERTS)
-                       {
+                       } else if (item->__type == SUB_ALERTS) {
                                return strdup(_L_("IDS_CLD_OPT_POP_UP_NOTIFICATIONS_ABB"));
-                       }
-                       else if (item->__type == SUB_NOTIFICATION)
-                       {
+                       } else if (item->__type == SUB_NOTIFICATION) {
                                return strdup(_L_("IDS_CLD_OPT_STATUS_BAR_NOTIFICATIONS_ABB"));
-                       }
-                       else if (item->__type == SUB_OFF)
-                       {
+                       } else if (item->__type == SUB_OFF) {
                                return strdup(_L_("IDS_CLD_OPT_NO_ALERTS"));
                        }
                }
@@ -86,16 +72,12 @@ Elm_Genlist_Item_Class* CalDialogSettingsRadioItem::getItemClassStatic()
        itc.func.content_get = [](void* data, Evas_Object* obj, const char* part)->Evas_Object*
        {
                CalDialogSettingsRadioItem *item = (CalDialogSettingsRadioItem*)data;
-               if (!strcmp("elm.swallow.end", part))
-               {
+               if (!strcmp("elm.swallow.end", part)) {
                        Evas_Object *radio_main = nullptr;
 
-                       if (item->__type >= CalDialogSettingsRadioItem::SUB_LOCALE_DEFAULT && item->__type <= CalDialogSettingsRadioItem::SUB_MONDAY)
-                       {
+                       if (item->__type >= CalDialogSettingsRadioItem::SUB_LOCALE_DEFAULT && item->__type <= CalDialogSettingsRadioItem::SUB_MONDAY) {
                                radio_main = (Evas_Object *)evas_object_data_get(obj, "radio_firstday");
-                       }
-                       else
-                       {
+                       } else {
                                radio_main = (Evas_Object *)evas_object_data_get(obj, "alert");
                        }
 
@@ -109,57 +91,40 @@ Elm_Genlist_Item_Class* CalDialogSettingsRadioItem::getItemClassStatic()
                        elm_radio_state_value_set(radio, item->__radioIndex);
                        elm_radio_group_add(radio, radio_main);
 
-                       if (item->__type >= CalDialogSettingsRadioItem::SUB_LOCALE_DEFAULT && item->__type <= CalDialogSettingsRadioItem::SUB_MONDAY)
-                       {
+                       if (item->__type >= CalDialogSettingsRadioItem::SUB_LOCALE_DEFAULT && item->__type <= CalDialogSettingsRadioItem::SUB_MONDAY) {
                                int weekType = CalSettingsManager::getInstance().getFirstDayOfWeek();
                                if((weekType == CalSettingsManager::SUN && item->__type == SUB_SUNDAY) ||
                                        (weekType == CalSettingsManager::MON && item->__type == SUB_MONDAY) ||
                                        (weekType == CalSettingsManager::SAT && item->__type == SUB_SATURDAY) ||
-                                       (weekType == CalSettingsManager::LOCALES && item->__type == SUB_LOCALE_DEFAULT))
-                               {
+                                       (weekType == CalSettingsManager::LOCALES && item->__type == SUB_LOCALE_DEFAULT)) {
                                        elm_radio_value_set(radio, item->__radioIndex);
                                }
-                       }
-                       else
-                       {
+                       } else {
                                CalSettingsManager::AlertType alertType;
                                alertType = CalSettingsManager::getInstance().getAlertType();
-                               if (alertType == (CalSettingsManager::AlertType)item->__radioIndex)
-                               {
+                               if (alertType == (CalSettingsManager::AlertType)item->__radioIndex) {
                                        elm_radio_value_set(radio, item->__radioIndex);
                                }
                        }
 
                        evas_object_smart_callback_add(radio, "changed", [](void *data, Evas_Object *obj, void *event_info) {
                                        CalDialogSettingsRadioItem *item = (CalDialogSettingsRadioItem*)data;
-                                       if (item->__radioIndex == elm_radio_value_get(obj))
-                                       {
-                                               if (item->__type >= CalDialogSettingsRadioItem::SUB_LOCALE_DEFAULT && item->__type <= CalDialogSettingsRadioItem::SUB_MONDAY)
-                                               {
-                                                       if (item->__radioIndex == 7)
-                                                       {
+                                       if (item->__radioIndex == elm_radio_value_get(obj)) {
+                                               if (item->__type >= CalDialogSettingsRadioItem::SUB_LOCALE_DEFAULT && item->__type <= CalDialogSettingsRadioItem::SUB_MONDAY) {
+                                                       if (item->__radioIndex == 7) {
                                                                CalSettingsManager::getInstance().setFirstDayOfWeek(CalSettingsManager::LOCALES);
-                                                       }
-                                                       else if (item->__radioIndex == 6)
-                                                       {
+                                                       } else if (item->__radioIndex == 6) {
                                                                CalSettingsManager::getInstance().setFirstDayOfWeek(CalSettingsManager::SAT);
-                                                       }
-                                                       else if (item->__radioIndex == 0)
-                                                       {
+                                                       } else if (item->__radioIndex == 0) {
                                                                CalSettingsManager::getInstance().setFirstDayOfWeek(CalSettingsManager::SUN);
-                                                       }
-                                                       else if (item->__radioIndex == 1)
-                                                       {
+                                                       } else if (item->__radioIndex == 1) {
                                                                CalSettingsManager::getInstance().setFirstDayOfWeek(CalSettingsManager::MON);
                                                        }
-                                               }
-                                               else
-                                               {
+                                               } else {
                                                        CalSettingsManager::getInstance().setAlertType((CalSettingsManager::AlertType)item->__radioIndex);
                                                }
                                        }
-                                       if (item->__radioCb)
-                                       {
+                                       if (item->__radioCb) {
                                                item->__radioCb();
                                        }
                                }, item
@@ -174,8 +139,7 @@ Elm_Genlist_Item_Class* CalDialogSettingsRadioItem::getItemClassStatic()
 
 void CalDialogSettingsRadioItem::onSelect()
 {
-       if(__selectCb)
-       {
+       if(__selectCb) {
                __selectCb();
        }
 }
index fc5beb0..d14539e 100644 (file)
@@ -51,10 +51,8 @@ Elm_Genlist_Item_Class* CalDialogSettingsTwoTextItem::getItemClassStatic()
                CalDialogSettingsTwoTextItem* item = (CalDialogSettingsTwoTextItem*)data;
                if (strcmp(part, "elm.text") == 0)
                        return strdup(_L_G_(item->__mainText));
-               else if (strcmp(part, "elm.text.sub") == 0)
-               {
-                       if (item->__type == CalDialogSettingsTwoTextItem::SUB_FIRST_DAY_OF_WEEK)
-                       {
+               else if (strcmp(part, "elm.text.sub") == 0) {
+                       if (item->__type == CalDialogSettingsTwoTextItem::SUB_FIRST_DAY_OF_WEEK) {
                                int result = CalSettingsManager::getInstance().getFirstDayOfWeek();
                                if (result == CalSettingsManager::LOCALES)
                                        return strdup(_L_("IDS_CLD_OPT_LOCALE_DEFAULT_ABB"));
@@ -64,13 +62,11 @@ Elm_Genlist_Item_Class* CalDialogSettingsTwoTextItem::getItemClassStatic()
                                        return strdup(_L_("IDS_CLD_OPT_SUNDAY"));
                                else if (result == CalSettingsManager::MON)
                                        return strdup(_L_("IDS_CLD_OPT_MONDAY"));
-                       }
-                       else if (item->__type == CalDialogSettingsTwoTextItem::SUB_TIME_ZONE ||
+                       } else if (item->__type == CalDialogSettingsTwoTextItem::SUB_TIME_ZONE ||
                                         item->__type == CalDialogSettingsTwoTextItem::SUB_REMINDER_TYPE ||
                                         item->__type == CalDialogSettingsTwoTextItem::SUB_NOTIFICATION_SOUND)
                                return strdup(_L_G_(item->__subText));
-                       else if (item->__type == CalDialogSettingsTwoTextItem::SUB_ALERT_TYPE)
-                       {
+                       else if (item->__type == CalDialogSettingsTwoTextItem::SUB_ALERT_TYPE) {
                                int result = CalSettingsManager::getInstance().getAlertType();
                                if (result == CalSettingsManager::ALERT)
                                        return strdup(_L_("IDS_CLD_OPT_POP_UP_NOTIFICATIONS_ABB"));
index 0b44ef7..4f8b7f0 100644 (file)
@@ -104,8 +104,7 @@ void CalSettingsView::onTimeZone(void)
        app_control_set_app_id(service, PKG_3DPARTIES_WORLDCLOCK);
        app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
        CalAppControlLauncher::getInstance().sendLaunchRequest(service,
-               [](app_control_h request, app_control_h reply, app_control_result_e result, void* data)
-               {
+               [](app_control_h request, app_control_h reply, app_control_result_e result, void* data) {
                        WHIT();
                        CalSettingsView *self = (CalSettingsView *)data;
 
@@ -149,12 +148,9 @@ void CalSettingsView::onNotificationSound(void)
 
        const char *ringtone_file = CalSettingsManager::getInstance().getAlertSound();
 
-       if(!strcmp(ringtone_file, CAL_SETTING_NOTIFICATION_SOUND_DEFAULT))
-       {
+       if(!strcmp(ringtone_file, CAL_SETTING_NOTIFICATION_SOUND_DEFAULT)) {
                app_control_add_extra_data(service, CAL_APPSETT_PARAM_MARKED_MODE, CAL_APPSETT_PARAM_MARKED_MODE_DEFAULT);
-       }
-       else
-       {
+       } else {
                app_control_add_extra_data(service, CAL_APPSETT_PARAM_MARKED_MODE, ringtone_file);
        }
 
@@ -162,38 +158,30 @@ void CalSettingsView::onNotificationSound(void)
        app_control_set_launch_mode(service, APP_CONTROL_LAUNCH_MODE_GROUP);
 
        CalAppControlLauncher::getInstance().sendLaunchRequest(service,
-               [](app_control_h request, app_control_h reply, app_control_result_e result, void* data)
-               {
+               [](app_control_h request, app_control_h reply, app_control_result_e result, void* data) {
                        CalSettingsView *self = (CalSettingsView *)data;
 
                        char* ringtone = NULL;
                        int error = 0;
                        error = app_control_get_extra_data(reply, APP_CONTROL_SETTING_RINGTONE_KEY_RESULT, &ringtone);
-                       if (error != APP_CONTROL_ERROR_NONE)
-                       {
+                       if (error != APP_CONTROL_ERROR_NONE) {
                                WERROR("get extra data by key result is failed(%x)", error);
                                return;
                        }
-                       if (ringtone == NULL)
-                       {
+                       if (ringtone == NULL) {
                                WERROR("get extra data by key result return rington NULL");
                                return;
                        }
                        std::string displayText;
                        self->__getAlertDisplayText(ringtone, displayText);
 
-                       if (!strcmp(ringtone, CAL_SETTING_NOTIFICATION_SILENT))
-                       {
+                       if (!strcmp(ringtone, CAL_SETTING_NOTIFICATION_SILENT)) {
                                self->__noti_sound_item->setSubText(_L_S_("IDS_CLD_OPT_NONE"));
                                CalSettingsManager::getInstance().setAlertSound(CAL_SETTING_NOTIFICATION_SILENT);
-                       }
-                       else if (!strcmp(ringtone, CAL_SETTING_NOTIFICATION_SOUND_DEFAULT))
-                       {
+                       } else if (!strcmp(ringtone, CAL_SETTING_NOTIFICATION_SOUND_DEFAULT)) {
                                self->__noti_sound_item->setSubText(_L_S_("IDS_COM_BODY_DEFAULT"));
                                CalSettingsManager::getInstance().setAlertSound(CAL_SETTING_NOTIFICATION_SOUND_DEFAULT);
-                       }
-                       else
-                       {
+                       } else {
                                self->__noti_sound_item->setSubText(displayText.c_str());
                                CalSettingsManager::getInstance().setAlertSound(ringtone);
                        }
@@ -215,8 +203,7 @@ void CalSettingsView::onNotificationSound(void)
  */
 void CalSettingsView::onSelect(CalSettingsView::SettingSelectType settingType)
 {
-       switch(settingType)
-       {
+       switch(settingType) {
                case SETTING_FIRST_DAY_OF_WEEK_SELECT://first day of week
                        onCreateFirstdayPopup();
                        break;
@@ -287,24 +274,16 @@ Evas_Object* CalSettingsView::onCreate(Evas_Object* parent, void* viewParam)
        );
 
        const char *ringtone_file = CalSettingsManager::getInstance().getAlertSound();
-       if (ringtone_file)
-       {
+       if (ringtone_file) {
                displayText.clear();
-               if (!strcmp(ringtone_file, CAL_SETTING_NOTIFICATION_SILENT))
-               {
+               if (!strcmp(ringtone_file, CAL_SETTING_NOTIFICATION_SILENT)) {
                        displayText = _L_S_("IDS_CLD_OPT_NONE");
-               }
-               else if (!strcmp(ringtone_file, CAL_SETTING_NOTIFICATION_SOUND_DEFAULT))
-               {
+               } else if (!strcmp(ringtone_file, CAL_SETTING_NOTIFICATION_SOUND_DEFAULT)) {
                        displayText = _L_S_("IDS_COM_BODY_DEFAULT");
-               }
-               else
-               {
+               } else {
                        __getAlertDisplayText(ringtone_file, displayText);
                }
-       }
-       else
-       {
+       } else {
                WERROR("fail");
                displayText = _L_S_("IDS_CLD_OPT_NONE");
        }
@@ -368,8 +347,7 @@ void CalSettingsView::__update()
        CalSettingsManager::getInstance().getTimeZone(tz);
 
        CalLocaleManager::getInstance().getDisplayTextTimeZone(tz, dT);
-       if(__time_zone_item)
-       {
+       if(__time_zone_item) {
                __time_zone_item->setSubText(dT.c_str());
        }
 
@@ -385,8 +363,7 @@ void CalSettingsView::onEvent(const CalEvent& event)
 {
        WENTER();
        WDEBUG("type = %u, source = %u", event.type, event.source);
-       switch (event.type)
-       {
+       switch (event.type) {
                case CalEvent::DB_CHANGED:
                case CalEvent::APP_PAUSED:
                case CalEvent::APP_RESUMED:
@@ -431,31 +408,23 @@ void CalSettingsView::__getAlertDisplayText(const char* ringtone, std::string& d
 {
        metadata_extractor_h metadata = NULL;
        int ret = metadata_extractor_create(&metadata);
-       if(ret == METADATA_EXTRACTOR_ERROR_NONE && metadata)
-       {
+       if(ret == METADATA_EXTRACTOR_ERROR_NONE && metadata) {
                ret = metadata_extractor_set_path(metadata, ringtone);
-               if(ret == METADATA_EXTRACTOR_ERROR_NONE)
-               {
+               if(ret == METADATA_EXTRACTOR_ERROR_NONE) {
                        char *title = NULL;
                        ret = metadata_extractor_get_metadata(metadata, METADATA_TITLE, &title);
                        metadata_extractor_destroy(metadata);
-                       if(title)
-                       {
+                       if(title) {
                                displayText = title;
                                free(title);
                                return ;
-                       }
-                       else
+                       } else
                                WDEBUG("metadata title is null");
-               }
-               else
-               {
+               } else {
                        WDEBUG("metadata title get NULL");
                        metadata_extractor_destroy(metadata);
                }
-       }
-       else
-       {
+       } else {
                WDEBUG("metadata title get NULL");
        }
 
@@ -464,12 +433,9 @@ void CalSettingsView::__getAlertDisplayText(const char* ringtone, std::string& d
        unsigned foundDot = tmp.find_last_of(".");
        unsigned foundName = tmp.find_last_of("/\\");
 
-       if (foundDot != tmp.npos && foundName != tmp.npos)
-       {
+       if (foundDot != tmp.npos && foundName != tmp.npos) {
                displayText = tmp.substr(foundName+1, (foundDot-foundName-1));
-       }
-       else
-       {
+       } else {
                displayText = tmp;
        }
 }
index 4a4ca4b..cc29988 100644 (file)
@@ -49,8 +49,7 @@ CalWidget::~CalWidget()
 
 void CalWidget::create(widget_context_h context, bundle *content, int w, int h)
 {
-       if (content)
-       {
+       if (content) {
                // Recover the previous status with the bundle object
        }
 
@@ -59,8 +58,7 @@ void CalWidget::create(widget_context_h context, bundle *content, int w, int h)
 
        // Window
        int ret = widget_app_get_elm_win(context, &__window);
-       if (ret == WIDGET_ERROR_NONE)
-       {
+       if (ret == WIDGET_ERROR_NONE) {
                evas_object_resize(__window, w, h);
                evas_object_color_set(__window, 255, 255, 255, 0);
 
@@ -73,17 +71,14 @@ void CalWidget::create(widget_context_h context, bundle *content, int w, int h)
 
                evas_object_show(__conform);
                evas_object_show(__window);
-       }
-       else
-       {
+       } else {
                WERROR("failed to get window. err = %d", ret);
        }
 }
 
 void CalWidget::destroy(widget_app_destroy_type_e reason)
 {
-       if(__monthCalendar)
-       {
+       if(__monthCalendar) {
                __monthCalendar->destroy();
                __monthCalendar = NULL;
        }
@@ -123,16 +118,14 @@ void CalWidget::__createCalendar()
        elm_box_homogeneous_set(boxTop, EINA_FALSE);
 
        __addBoxButton(boxTop, "IDS_CLD_ACBUTTON_CREATE_ABB",
-               [](void* data, Evas_Object* obj, void* event_info)
-               {
+               [](void* data, Evas_Object* obj, void* event_info) {
                        CalWidget* self = (CalWidget*)data;
                        self->__AddEvent();
                }
        );
 
        __buttonToday = __addBoxButton(boxTop, "IDS_CLD_ACBUTTON_TODAY",
-               [](void* data, Evas_Object* obj, void* event_info)
-               {
+               [](void* data, Evas_Object* obj, void* event_info) {
                        CalWidget* self = (CalWidget*)data;
                        self->__focusToday();
                }
@@ -166,39 +159,28 @@ void CalWidget::__createCalendar()
        __monthCalendar->create(layout, NULL);
        __monthCalendar->resetByBound();
        __monthCalendar->focus(__dateTime.getMday());
-       __monthCalendar->setScrollCb([this]() { }, [this](int dir)
-       {
-               if (dir == 0)
-               {
+       __monthCalendar->setScrollCb([this]() { }, [this](int dir) {
+               if (dir == 0) {
                        return;
                }
 
-               if (dir > 0)
-               {
+               if (dir > 0) {
                        __dateTime.incrementMonth();
-               }
-               else
-               {
+               } else {
                        __dateTime.decrementMonth();
                }
 
-               if(__isCutomFocus)
-               {
+               if(__isCutomFocus) {
                        __isCutomFocus = false;
                        __dateTime = __customFocusDate;
                        __monthCalendar->focus(__dateTime.getMday());
-               }
-               else
-               {
+               } else {
                        __monthCalendar->focus(1);
                }
 
-               if(__dateTime < __lowerBound)
-               {
+               if(__dateTime < __lowerBound) {
                        __dateTime = __lowerBound;
-               }
-               else if(__dateTime > __upperBound)
-               {
+               } else if(__dateTime > __upperBound) {
                        __dateTime = __upperBound;
                }
 
@@ -206,36 +188,29 @@ void CalWidget::__createCalendar()
                __monthCalendar->resetByBound();
        });
 
-       __monthCalendar->setTapCellCb([this](int i, int j)
-       {
+       __monthCalendar->setTapCellCb([this](int i, int j) {
                CalDate newFocusDate;
                __monthCalendar->getDate(i, j, newFocusDate);
 
-               if(newFocusDate < __lowerBound || newFocusDate > __upperBound)
-               {
+               if(newFocusDate < __lowerBound || newFocusDate > __upperBound) {
                        WDEBUG("Invalid date %s", newFocusDate.getString());
                        return;
                }
 
-               if (newFocusDate.getMonth() == __dateTime.getMonth())
-               {
+               if (newFocusDate.getMonth() == __dateTime.getMonth()) {
                        __dateTime = newFocusDate;
                        __monthCalendar->focus(newFocusDate.getMday());
-               }
-               else
-               {
+               } else {
                        __isCutomFocus = true;
                        __customFocusDate = newFocusDate;
-                       if(!__monthCalendar->slide(newFocusDate > __dateTime ? 1 : -1))
-                       {
+                       if(!__monthCalendar->slide(newFocusDate > __dateTime ? 1 : -1)) {
                                __isCutomFocus = false;
                        }
 
                        return;
                }
 
-               if (__timer)
-               {
+               if (__timer) {
                        ecore_timer_del(__timer);
                }
 
@@ -277,8 +252,7 @@ Evas_Object* CalWidget::__addBoxButton(Evas_Object* box, const char *text, Evas_
 int CalWidget::__getFirstDayOfWeek()
 {
        int result = CalSettingsManager::getInstance().getFirstDayOfWeek();
-       if (result == CalSettingsManager::LOCALES)
-       {
+       if (result == CalSettingsManager::LOCALES) {
                return CalLocaleManager::getInstance().getLocaleFirstDayOfWeek();
        }
 
@@ -295,8 +269,7 @@ Eina_Bool CalWidget::__onTimer(void* data)
        } else {
                app_control_h service = NULL;
                app_control_create(&service);
-               if(service)
-               {
+               if(service) {
                        app_control_add_extra_data(service, CAL_APPSVC_PARAM_VIEW, CAL_APPSVC_PARAM_VIEW_MAIN);
                        app_control_add_extra_data(service, CAL_APPSVC_PARAM_DATE, widget->__dateTime.getUnixTimeString());
                        app_control_set_operation(service, APP_CONTROL_OPERATION_MAIN);
@@ -313,8 +286,7 @@ void CalWidget::__AddEvent(CalDate *dateTime)
 {
        app_control_h service = NULL;
        app_control_create(&service);
-       if(service)
-       {
+       if(service) {
                app_control_set_operation(service, APP_CONTROL_OPERATION_ADD);
                app_control_set_mime(service, APP_CONTROL_MIME_CALENDAR);
                if (dateTime) {
@@ -365,14 +337,11 @@ void CalWidget::__focusToday()
        int month = __originDate.getMonth();
 
        __monthCalendar->getMonth(year, month);
-       if (month != __originDate.getMonth())
-       {
+       if (month != __originDate.getMonth()) {
                __dateTime = __originDate;
                __monthCalendar->reset(__getFirstDayOfWeek(), __originDate.getYear(), __originDate.getMonth());
                __displayCurrentDate();
-       }
-       else if (year != __originDate.getYear())
-       {
+       } else if (year != __originDate.getYear()) {
                __dateTime = __originDate;
                __setMonthLabel();
        }
@@ -406,8 +375,7 @@ void CalWidget::onEvent(const CalEvent& event)
 
        c_retm_if(!__monthCalendar, "__monthCalendar is null onEvent()");
 
-       switch (event.type)
-       {
+       switch (event.type) {
                case CalEvent::LANGUAGE_CHANGED:
                        __setMonthLabel();
                        break;
index d029a6f..62406ed 100644 (file)
@@ -27,8 +27,7 @@
 
 namespace
 {
-       inline CalWidget *getWidget(widget_context_h context)
-       {
+       inline CalWidget *getWidget(widget_context_h context) {
                void *tag = NULL;
                widget_app_context_get_tag(context, &tag);
                return static_cast<CalWidget*>(tag);
@@ -52,8 +51,7 @@ int CalWidgetApp::start(int argc, char *argv[])
        ops.terminate = CalWidgetApp::onAppTerminate;
 
        result = widget_app_main(argc, argv, &ops, NULL);
-       if (result != WIDGET_ERROR_NONE)
-       {
+       if (result != WIDGET_ERROR_NONE) {
                WERROR("widget_app_main() is failed. err = %d", result);
        }
 
@@ -120,8 +118,7 @@ void CalWidgetApp::onAppRegionChanged(app_event_info_h event_info, void *data)
 int CalWidgetApp::onWidgetCreate(widget_context_h context, bundle *content, int w, int h, void *data)
 {
        CalWidget *widget = new CalWidget();
-       if (!widget)
-       {
+       if (!widget) {
                return WIDGET_ERROR_OUT_OF_MEMORY;
        }
 
@@ -140,8 +137,7 @@ int CalWidgetApp::onWidgetCreate(widget_context_h context, bundle *content, int
 int CalWidgetApp::onWidgetDestroy(widget_context_h context, widget_app_destroy_type_e reason, bundle *content, void *data)
 {
        CalWidget *widget = getWidget(context);
-       if(widget)
-       {
+       if(widget) {
                widget->destroy(reason);
                delete widget;
        }
@@ -163,8 +159,7 @@ int CalWidgetApp::onWidgetResume(widget_context_h context, void *data)
 int CalWidgetApp::onWidgetResize(widget_context_h context, int w, int h, void *data)
 {
        CalWidget *widget = getWidget(context);
-       if(widget)
-       {
+       if(widget) {
                widget->resize(w, h);
        }