Revert "Resolved issue N_SE-38574"
[apps/osp/Calendar.git] / src / ClImportForm.cpp
index 045c5eb..bc85d06 100644 (file)
@@ -92,16 +92,13 @@ ImportForm::OnInitializing(void)
        __pCalendarSelectorPopup = new (std::nothrow) CalendarSelectorPopup();
        __pCalendarSelectorPopup->Initialize();
 
-       __pProgressPopup = new (std::nothrow) ProgressPopup();
-       __pProgressPopup->Construct(false, false);
-
        return E_SUCCESS;
 }
 
 result
 ImportForm::OnTerminating(void)
 {
-       if (__pThread)
+       if (__pThread != null)
        {
                __pThread->Join();
                delete __pThread;
@@ -112,11 +109,11 @@ ImportForm::OnTerminating(void)
        delete __pDateFormatter;
        delete __pTimeFormatter;
        delete __pCalendarbook;
-       if (__pCalendarSelectorPopup)
+       if (__pCalendarSelectorPopup != null)
        {
                __pCalendarSelectorPopup->Destroy();
        }
-       if (__pProgressPopup)
+       if (__pProgressPopup != null)
        {
                __pProgressPopup->Destroy();
        }
@@ -129,17 +126,21 @@ ImportForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
        switch (requestId)
        {
        case IDA_CALENDAR_SELECTOR_POPUP_DONE:
-               if (pArgs)
+               if (pArgs != null)
                {
                        __calendarId = static_cast<Integer*>(pArgs->GetAt(0))->value;
 
-                       if (__pThread)
+                       if (__pThread != null)
                        {
                                __pThread->Join();
                                delete __pThread;
-                               __pThread = null;
                        }
 
+                       if (__pProgressPopup == null)
+                       {
+                               __pProgressPopup = new (std::nothrow) ProgressPopup();
+                               __pProgressPopup->Construct(false, false);
+                       }
                        __pProgressPopup->SetShowState(true);
                        __pProgressPopup->Show();
 
@@ -154,20 +155,20 @@ ImportForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                __pThread = null;
                __pProgressPopup->SetShowState(false);
 
-               if (IsTodoItemChecked())
+               if (IsTodoItemChecked() == true)
                {
                        __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_TODO, this);
                }
 
                __pListViewContents->UpdateList();
 
-               if (IsNoItemChecked())
+               if (IsNoItemChecked() == true)
                {
                        GetFooter()->SetItemEnabled(0, false);
                        GetFooter()->Invalidate(true);
                }
 
-               if (IsAllItemAdded())
+               if (IsAllItemAdded() == true)
                {
                        GetHeader()->RemoveAllButtons();
                        GetHeader()->Invalidate(true);
@@ -177,7 +178,7 @@ ImportForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
                break;
        }
 
-       if (pArgs)
+       if (pArgs != null)
        {
                pArgs->RemoveAll(true);
                delete pArgs;
@@ -187,9 +188,6 @@ ImportForm::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
 Object*
 ImportForm::Run(void)
 {
-       // Todo: temporary solution for lock-up.
-       Thread::Sleep(300);
-
        Calendar* pCalendar = __pCalendarbook->GetCalendarN(__calendarId);
        if (pCalendar != null)
        {
@@ -252,7 +250,7 @@ ImportForm::OnActionPerformed(const Control& source, int actionId)
        {
        case IDA_IMPORT_FORM_SELECT_ALL:
        {
-               bool checkFlag = (IsAllItemChecked() == false);
+               bool checkFlag = IsAllItemChecked() == false;
                int count = __pList->GetCount();
                for (int i = 0; i < count; ++i)
                {
@@ -265,11 +263,11 @@ ImportForm::OnActionPerformed(const Control& source, int actionId)
                break;
        }
        case IDA_IMPORT_FORM_ADD_TO_CALENDAR:
-               if (IsEventItemChecked())
+               if (IsEventItemChecked() == true)
                {
                        __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_EVENT, this);
                }
-               else if (IsTodoItemChecked())
+               else if (IsTodoItemChecked() == true)
                {
                        __pCalendarSelectorPopup->RequestCalendar(CALENDAR_SELECTOR_POPUP_STYLE_TODO, this);
                }
@@ -287,17 +285,18 @@ ImportForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
        IEnumerator* pEnum = __pList->GetEnumeratorN();
        while (pEnum->MoveNext() == E_SUCCESS)
        {
-               if (dynamic_cast<CalEvent*>(pEnum->GetCurrent()))
+               if (dynamic_cast<CalEvent*>(pEnum->GetCurrent()) != null)
                {
                        pArgs->Add(new (std::nothrow) CalEvent(static_cast<CalEvent&>(*pEnum->GetCurrent())));
                }
-               else if (dynamic_cast<CalTodo*>(pEnum->GetCurrent()))
+               else if (dynamic_cast<CalTodo*>(pEnum->GetCurrent()) != null)
                {
                        pArgs->Add(new (std::nothrow) CalTodo(static_cast<CalTodo&>(*pEnum->GetCurrent())));
                }
        }
        delete pEnum;
        SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT), pArgs);
+       AppLogDebug("Exit.");
 }
 
 void
@@ -334,7 +333,7 @@ ImportForm::OnListViewContextItemStateChanged(ListView& listView, int index, int
 int
 ImportForm::GetItemCount(void)
 {
-       if (!__pList)
+       if (__pList == null)
        {
                return 0;
        }
@@ -358,6 +357,7 @@ ImportForm::CreateItem(int index, int itemWidth)
                pItem->SetReminder(pEvent->GetAllReminders().GetCount() > 0);
                pItem->SetRepeat(pEvent->IsRecurring());
                pItem->SetPriority(pEvent->GetPriority());
+       //      pItem->SetFacebookEvent(false);
                pItem->UpdateElements();
                return pItem;
        }
@@ -372,6 +372,7 @@ ImportForm::CreateItem(int index, int itemWidth)
                pItem->SetLocation(pTodo->GetLocation());
                pItem->SetDueDate(ResourceManager::ConvertUtcTimeToWallTime(pTodo->GetDueDate()), __pDateTimeFormatter);
                pItem->SetReminder(pTodo->GetAllReminders().GetCount() > 0);
+       //      pItem->SetFacebookEvent(false);
 
                switch (pTodo->GetPriority())
                {
@@ -427,7 +428,7 @@ ImportForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& cur
        }
 
        __pListViewContents->UpdateList();
-       if (IsAllItemAdded())
+       if (IsAllItemAdded() == true)
        {
                GetHeader()->RemoveAllButtons();
                GetFooter()->RemoveAllItems();
@@ -443,6 +444,7 @@ void
 ImportForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId)
 {
        AppLogDebug("Enter.");
+       AppLogDebug("Exit.");
 }
 
 Color