Tizen 2.4.0 rev3 SDK Public Release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20160307.015842 submit/tizen_2.4/20160306.235729
authorjk7744.park <jk7744.park@samsung.com>
Fri, 4 Mar 2016 11:06:08 +0000 (20:06 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Fri, 4 Mar 2016 11:06:08 +0000 (20:06 +0900)
cluster/cluster-view-impl.cpp
cluster/widget-data-provider.cpp
main/homescreen.cpp
main/homescreen.h
mainmenu/mainmenu-presenter.cpp

index 341f991..7f01d07 100755 (executable)
@@ -18,7 +18,6 @@
  */
 #include <sstream>
 #include <feedback.h>
-#include <boost/shared_ptr.hpp>
 
 #include "cluster-view-impl.h"
 #include "custom-cluster-impl.h"
index 783b7e1..744a293 100755 (executable)
@@ -325,7 +325,31 @@ static void WidgetDataProviderBadgeCB(unsigned int action, const char *pkgname,
 
        if(widgetDataProvider)
        {
-               widgetDataProvider->updateBoxBadgeCnt(pkgname, count);
+               if(action == BADGE_ACTION_UPDATE)
+               {
+                       widgetDataProvider->updateBoxBadgeCnt(pkgname, count);
+               }
+               else if(action == BADGE_ACTION_CHANGED_DISPLAY)
+               {
+                       if(count == 0)
+                       {
+                               widgetDataProvider->updateBoxBadgeCnt(pkgname, 0);
+                       }
+                       else if(count == 1)
+                       {
+                               unsigned int nCount=0;
+                               if(badge_get_count(pkgname, &nCount) != BADGE_ERROR_NONE)
+                               {
+                                       HOME_ERR("Failed to get badge count [%s]", pkgname);
+                                       nCount=0;
+                               }
+                               widgetDataProvider->updateBoxBadgeCnt(pkgname, nCount);
+                       }
+               }
+               else if(action == BADGE_ACTION_REMOVE)
+               {
+                       widgetDataProvider->updateBoxBadgeCnt(pkgname, 0);
+               }
        }
 
        return ;
index 3f98633..cbef037 100755 (executable)
@@ -54,7 +54,7 @@ CHomeScreen::CHomeScreen(Dali::Application& application)
        mApplication.PauseSignal().Connect( this, &CHomeScreen::OnPause );
        mApplication.ResumeSignal().Connect( this, &CHomeScreen::OnResume );
        mApplication.LanguageChangedSignal().Connect( this, &CHomeScreen::OnLanguageChanged);
-       mApplication.AppControlSignal().Connect( this, &CHomeScreen::OnAppsConstrol);
+       mApplication.AppControlSignal().Connect( this, &CHomeScreen::OnAppsControl);
 }
 
 CHomeScreen::~CHomeScreen()
@@ -124,8 +124,9 @@ void CHomeScreen::OnLanguageChanged( Dali::Application& application)
 }
 
 
-void CHomeScreen::OnAppsConstrol( Dali::Application& application, void * data)
+void CHomeScreen::OnAppsControl( Dali::Application& application, void * data)
 {
+       HOME_ERR("app control");
        app_control_h app_control = (app_control_h)data;
        char *ret_data = NULL;
        app_control_get_operation(app_control, &ret_data);
index 68970aa..441931d 100755 (executable)
@@ -49,7 +49,7 @@ public:
        void OnPause(Dali::Application& application);
        void OnResume(Dali::Application& application);
        void OnLanguageChanged( Dali::Application& application);
-       void OnAppsConstrol( Dali::Application& application, void * data);
+       void OnAppsControl( Dali::Application& application, void * data);
 
        /* initialize */
        void Initialize(void);
index 7ec8597..703bd0a 100755 (executable)
@@ -1151,7 +1151,31 @@ void CMainMenuPresenter::_BadgeChangedCallback(unsigned int nAction, const char
        CMainMenuPresenter *pPresenter = static_cast<CMainMenuPresenter *>(pData);
        if (pPresenter && sPkgname)
        {
-               pPresenter->_BadgeChanged(sPkgname, nCount);
+               if(nAction == BADGE_ACTION_UPDATE)
+               {
+                       pPresenter->_BadgeChanged(sPkgname, nCount);
+               }
+               else if(nAction == BADGE_ACTION_CHANGED_DISPLAY)
+               {
+                       if(nCount == 0)
+                       {
+                               pPresenter->_BadgeChanged(sPkgname, 0);
+                       }
+                       else if(nCount == 1)
+                       {
+                               unsigned int count=0;
+                               if(badge_get_count(sPkgname, &count) != BADGE_ERROR_NONE)
+                               {
+                                       HOME_ERR("Failed to get badge count [%s]", sPkgname);
+                                       count=0;
+                               }
+                               pPresenter->_BadgeChanged(sPkgname, count);
+                       }
+               }
+               else if(nAction == BADGE_ACTION_REMOVE)
+               {
+                       pPresenter->_BadgeChanged(sPkgname, 0);
+               }
        }
 }