Resolution for N_SE-31432
authorSrinivasa M R <srinivasa.mr@samsung.com>
Tue, 2 Apr 2013 11:56:21 +0000 (17:26 +0530)
committerSrinivasa M R <srinivasa.mr@samsung.com>
Tue, 2 Apr 2013 11:56:26 +0000 (17:26 +0530)
DestroyPlayer updates the controsl after it has been removed from the form.
To correct this added a flag to update only when required

Change-Id: I7ffb47923563241cfb69c96b61a949328b276859
Signed-off-by: Srinivasa M R <srinivasa.mr@samsung.com>
project/src/Player/MultiPlayForm.cpp
project/src/Player/MultiPlayForm.h
project/src/Player/PlayerForm.h

index dd66be0..1cf4c87 100644 (file)
@@ -75,7 +75,7 @@ MultiPlayForm::~MultiPlayForm()
 {
        for (int index = 0; index < __nConfigFileCount; index++)
        {
-               DestroyPlayerInstance(index);
+               DestroyPlayerInstance(index, false);
        }
 }
 
@@ -267,7 +267,7 @@ MultiPlayForm::CreatePlayerInstance(int index)
 }
 
 result
-MultiPlayForm::DestroyPlayerInstance(int index)
+MultiPlayForm::DestroyPlayerInstance(int index, bool isUpdateReq)
 {
        result r = E_SUCCESS;
        int nCurPlayerVal = 0;
@@ -323,7 +323,10 @@ MultiPlayForm::DestroyPlayerInstance(int index)
                        AppLog(">>>>>> MultiPlayForm::DestroyPlayerInstance close failed  for index = %d", index);
                }
        }
-       UpdatePlayersStatus(pPobj, index);
+       if (isUpdateReq)
+       {
+               UpdatePlayersStatus(pPobj, index);
+       }
        for (nCurPlayerVal = 0; nCurPlayerVal < MAX_PLAY_COUNT; )
        {
                if(pPobj != null)
@@ -447,7 +450,7 @@ MultiPlayForm::OnFormBackRequested(Tizen::Ui::Controls::Form& source)
        for (int index = 0; index < __nConfigFileCount; index++)
        {
                __pListMenu->SetItemChecked(index, false);
-               DestroyPlayerInstance(index);
+               DestroyPlayerInstance(index, false);
        }
        Deactivate();
 }
@@ -466,7 +469,7 @@ MultiPlayForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                __nTotalPlayCount = 0;
                for (int index = 0; index < __nConfigFileCount; index++)
                {
-                       DestroyPlayerInstance(index);
+                       DestroyPlayerInstance(index, true);
                }
                Deactivate();
                break;
@@ -476,7 +479,7 @@ MultiPlayForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
                __nTotalPlayCount = 0;
                for (int index = 0; index < __nConfigFileCount; index++)
                {
-                       DestroyPlayerInstance(index);
+                       DestroyPlayerInstance(index, true);
                        __pListMenu->SetItemChecked(index, false);
                }
                UpdatePlayersStatus();
@@ -675,7 +678,7 @@ MultiPlayForm::OnLowMemory(void)
        for (int index = 0; index < __nConfigFileCount; index++)
        {
                __pListMenu->SetItemChecked(index, false);
-               DestroyPlayerInstance(index);
+               DestroyPlayerInstance(index, false);
        }
        Deactivate();
 }
@@ -698,7 +701,7 @@ MultiPlayForm::OnBatteryLevelChanged(Tizen::System::BatteryLevel batteryLevel)
                        for (int index = 0; index < __nConfigFileCount; index++)
                        {
                                __pListMenu->SetItemChecked(index, false);
-                               DestroyPlayerInstance(index);
+                               DestroyPlayerInstance(index, false);
                        }
                        Deactivate();
                }
@@ -852,7 +855,7 @@ MultiPlayForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listVie
                if (status == LIST_ITEM_STATUS_CHECKED)
                {
                        // Check if there is a player instance which is not release if so release it
-                       DestroyPlayerInstance(index);
+                       DestroyPlayerInstance(index, true);
                        __nTotalPlayCount = __nTotalPlayCount + 1;
                        AppLog("checked  enter __nTotalPlayCount = %d", __nTotalPlayCount);
                        if (__nTotalPlayCount > MAX_PLAY_COUNT)
@@ -879,7 +882,7 @@ MultiPlayForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& listVie
                        {
                                __nTotalPlayCount = __nTotalPlayCount - 1;
                        }
-                       r = DestroyPlayerInstance(index);
+                       r = DestroyPlayerInstance(index, true);
                }
        }
        this->SetFocus();
@@ -902,7 +905,7 @@ MultiPlayForm::OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const
        for (int index = 0; index < __nConfigFileCount; index++)
        {
                __pListMenu->SetItemChecked(index, false);
-               DestroyPlayerInstance(index);
+               DestroyPlayerInstance(index, false);
        }
        Deactivate();
 }
index d6e72d0..bd8e792 100644 (file)
@@ -62,7 +62,7 @@ public:
 
        result CreatePlayerInstance(int index);
 
-       result DestroyPlayerInstance(int index);
+       result DestroyPlayerInstance(int index, bool isUpdateReq);
 
        void UpdatePlayersStatus();
        void UpdatePlayersStatus(Player* pCurPlayerObj, int index);
index 62eff7f..3b67a90 100644 (file)
@@ -41,7 +41,7 @@ using namespace Tizen::Ui::Scenes;
 class PlayerForm
        : public MultiForm
        , public Tizen::Media::IPlayerEventListener
-       , Tizen::Base::Runtime::ITimerEventListener
+       , public Tizen::Base::Runtime::ITimerEventListener
        , public Tizen::Ui::IAdjustmentEventListener
        , public ISceneEventListener