Removed GetLastResult() where its not needed
authorrahul varna <rahul.varna@samsung.com>
Tue, 9 Apr 2013 03:34:15 +0000 (12:34 +0900)
committerrahul varna <rahul.varna@samsung.com>
Tue, 9 Apr 2013 03:34:15 +0000 (12:34 +0900)
Signed-off-by: rahul varna <rahul.varna@samsung.com>
project/src/Camera/CameraCaptureForm.cpp
project/src/Player/VideoRecorderPlayerForm.cpp
project/src/Recorder/AudioRecorderForm.cpp
project/src/Recorder/VideoRecorderForm.cpp

index f13dd34..7590334 100644 (file)
@@ -3463,8 +3463,6 @@ CameraCaptureForm::CreateExposureSlider(void)
        }
 
        exposure = __pCamera->GetExposure();
-       r = GetLastResult();
-       TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->GetExposure() failed", GetErrorMessage(r));
 
        if (__exposureSliderValue != exposure &&
                __exposureSliderValue != INIT)
@@ -3509,8 +3507,6 @@ CameraCaptureForm::CreateBrightnessSlider(void)
        }
 
        brightness = __pCamera->GetBrightness();
-       r = GetLastResult();
-       TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->GetBrightness()", GetErrorMessage(r));
 
        if (__brightnessSliderValue != brightness &&
                __brightnessSliderValue != INIT)
@@ -3557,9 +3553,6 @@ CameraCaptureForm::CreateContrastSlider(void)
 
        contrast = __pCamera->GetContrast();
 
-       r = GetLastResult();
-       TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->GetContrast()", GetErrorMessage(r));
-
        if (__contrastSliderValue != contrast &&
                __contrastSliderValue != INIT)
        {
@@ -3596,12 +3589,6 @@ CameraCaptureForm::CreateZoomLevelSlider(void)
        {
                zoom = __pCamera->GetMaxZoomLevel();
 
-               if (zoom <= 0)
-               {
-                       r = GetLastResult();
-                       TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->GetMaxZoomLevel()", GetErrorMessage(r));
-               }
-
                Dimension dim(CAMERA_FORM_POPUP_SLIDER_W, CAMERA_FORM_POPUP_SLIDER_H);
                Rectangle rect(CAMERA_FORM_SLIDER_OK_BUTTON_X, CAMERA_FORM_SLIDER_OK_BUTTON_Y, CAMERA_FORM_SLIDER_OK_BUTTON_W, CAMERA_FORM_SLIDER_OK_BUTTON_H);
                r = CreatePopUp(&__pPopupZoom, L"Zoom Level", dim, true);
index 2f1d8ae..9a9a75b 100644 (file)
@@ -326,7 +326,7 @@ VideoRecorderPlayerForm::CreateCamera()
        result r = E_SUCCESS;
 
        __pCamera = new (std::nothrow) Camera();
-       TryReturn(__pCamera != null, ShowErrorResult(GetLastResult(), METHOD_FILE_LINENO),"__pCamera creation failed, no memory");
+       TryReturn(__pCamera != null, ShowErrorResult(E_OUT_OF_MEMORY, METHOD_FILE_LINENO),"__pCamera creation failed, no memory");
 
        r = __pCamera->Construct(*this, CAMERA_PRIMARY);
        TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO),"[%s] __pCamera->Construct", GetErrorMessage(r));
@@ -343,7 +343,7 @@ VideoRecorderPlayerForm::CreateVideoRecorder()
        result r = E_SUCCESS;
 
        __pVideoRecorder = new (std::nothrow) Tizen::Media::VideoRecorder();
-       TryReturn(__pVideoRecorder != null, ShowErrorResult(GetLastResult(), METHOD_FILE_LINENO),"__pVideoRecorder creation failed, no memory");
+       TryReturn(__pVideoRecorder != null, ShowErrorResult(E_OUT_OF_MEMORY, METHOD_FILE_LINENO),"__pVideoRecorder creation failed, no memory");
 
        r = __pVideoRecorder->Construct(*this, *__pCamera);
        TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO),"[%s] __pVideoRecorder->Construct", GetErrorMessage(r));
@@ -366,7 +366,7 @@ VideoRecorderPlayerForm::CreatePlayer()
        SAFE_DELETE(__pPlayer);
 
        __pPlayer = new (std::nothrow) Player();
-       TryReturn(__pPlayer != null, ShowErrorResult(GetLastResult(), METHOD_FILE_LINENO),"__pPlayer creation failed, no memory");
+       TryReturn(__pPlayer != null, ShowErrorResult(E_OUT_OF_MEMORY, METHOD_FILE_LINENO),"__pPlayer creation failed, no memory");
 
        r = __pPlayerOverlay->GetBackgroundBufferInfo(bufferInfo);
        TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO),"[%s] __pPlayerOverlay->GetBackgroundBufferInfo", GetErrorMessage(r));
index a239225..0ddaf90 100644 (file)
@@ -478,7 +478,7 @@ AudioRecorderForm::ProcessAudioStream(AudioFrame& frame)
        TryCatch(pByteArray != null, r = E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Creation of byteArray failed");
 
        pStreamArray = pStreamData->GetPointer();
-       TryCatch(pStreamArray != null, , "[%s] GetPointer failed ", GetErrorMessage(GetLastResult()));
+       TryCatch(pStreamArray != null, , "GetPointer failed");
 
        readBytes = __pPreAudioFile->Read(pByteArray, streamSize);
        r = GetLastResult();
index 0c1cac4..132ad14 100644 (file)
@@ -372,18 +372,18 @@ VideoRecorderForm::OnInitializing(void)
 
        __pProgress = static_cast< Progress* >(GetControl(L"IDC_PROGRESS1"));
 
-       TryCatch(__pProgress != null,r = E_FAILURE , "IDC_PROGRESS1 returned null:%s", GetErrorMessage(GetLastResult()));
+       TryCatch(__pProgress != null,r = E_OBJ_NOT_FOUND , "IDC_PROGRESS1 returned null:%s", GetErrorMessage(E_OBJ_NOT_FOUND));
 
        clientRect = __pProgress->GetBounds();
        AppLog("PROGRESS BOUNDS %d %d %d %d", clientRect.x, clientRect.y, clientRect.width, clientRect.height);
 
        __pElapsedTimeLable = static_cast< Label* >(GetControl(L"IDC_ELAPSEDTIME"));
 
-       TryCatch(__pElapsedTimeLable != null,r = E_FAILURE , "__pElapsedTimeLable handle from UI builder is NULL:%s", GetErrorMessage(GetLastResult()));
+       TryCatch(__pElapsedTimeLable != null,r = E_OBJ_NOT_FOUND , "__pElapsedTimeLable handle from UI builder is NULL:%s", GetErrorMessage(E_OBJ_NOT_FOUND));
 
        __pElapsedRecordSizeLable = static_cast< Label* >(GetControl(L"IDC_ELAPSEDSIZE"));
 
-       TryCatch(__pElapsedRecordSizeLable != null,r = E_FAILURE , "__pElapsedRecordSizeLable handle from UI builder is NULL:%s", GetErrorMessage(GetLastResult()));
+       TryCatch(__pElapsedRecordSizeLable != null,r = E_OBJ_NOT_FOUND , "__pElapsedRecordSizeLable handle from UI builder is NULL:%s", GetErrorMessage(E_OBJ_NOT_FOUND));
 
        __pElapsedTimeLable->SetText(__startTime);
        __pElapsedRecordSizeLable->SetText(__startSize);
@@ -395,12 +395,10 @@ VideoRecorderForm::OnInitializing(void)
        __pProgress->Draw();
 
        __pTimer = new (std::nothrow) Tizen::Base::Runtime::Timer;
-
-       TryCatch(__pTimer != null,r = E_OUT_OF_MEMORY , "__pTimer not intialized. Out of memory:%s", GetErrorMessage(GetLastResult()));
+       TryCatch(__pTimer != null,r = E_OUT_OF_MEMORY , "__pTimer not intialized. Out of memory:%s", GetErrorMessage(E_OUT_OF_MEMORY));
 
        r = __pTimer->Construct(*this);
-
-       TryCatch(r == E_SUCCESS,r = E_FAILURE , "__pTimer costruction failed:%s", GetErrorMessage(GetLastResult()));
+       TryCatch(r == E_SUCCESS,r = E_FAILURE , "__pTimer costruction failed:%s", GetErrorMessage(r));
 
        AddTouchEventListener(*this);
        pFooter->AddTouchEventListener(*this);
@@ -1299,7 +1297,7 @@ VideoRecorderForm::OnActivate(void* pActivateParam)
        SetFooterItem(2, L"Start", ID_START);
 
        __pCamera = new (std::nothrow) Camera();
-       TryCatch(__pCamera != null, ShowErrorResult(GetLastResult(), METHOD_FILE_LINENO), "Camera creation failed, no memory");
+       TryCatch(__pCamera != null, ShowErrorResult(E_OUT_OF_MEMORY, METHOD_FILE_LINENO), "Camera creation failed, no memory");
 
        r = __pCamera->Construct(*this, __camType);
        if(IsFailed(r))
@@ -1818,7 +1816,7 @@ VideoRecorderForm::ProcessAudioStream(AudioFrame& frame)
        TryCatch(pByteArray != null, r = E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Creation of byteArray failed");
 
        pStreamArray = pStreamData->GetPointer();
-       TryCatch(pStreamArray != null, , "[%s] GetPointer failed ", GetErrorMessage(GetLastResult()));
+       TryCatch(pStreamArray != null, , "GetPointer failed");
 
        readBytes = __pPreAudioFile->Read(pByteArray, streamSize);
        r = GetLastResult();
@@ -4752,8 +4750,6 @@ VideoRecorderForm::CreateExposureSlider(void)
        }
 
        exposure = __pCamera->GetExposure();
-       r = GetLastResult();
-       TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->GetExposure() failed", GetErrorMessage(r));
 
        if (__exposureSliderValue != exposure &&
                __exposureSliderValue != INIT)
@@ -4805,8 +4801,6 @@ VideoRecorderForm::CreateBrightnessSlider(void)
        }
 
        brightness = __pCamera->GetBrightness();
-       r = GetLastResult();
-       TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->GetBrightness()", GetErrorMessage(r));
 
        if (__brightnessSliderValue != brightness &&
                __brightnessSliderValue != INIT)
@@ -4860,8 +4854,6 @@ VideoRecorderForm::CreateContrastSlider(void)
        }
 
        contrast = __pCamera->GetContrast();
-       r = GetLastResult();
-       TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->GetContrast()", GetErrorMessage(r));
 
        if (__contrastSliderValue != contrast &&
                __contrastSliderValue != INIT)
@@ -4899,11 +4891,6 @@ VideoRecorderForm::CreateZoomLevelSlider(void)
        if (__pPopupZoom == null)
        {
                zoom = __pCamera->GetMaxZoomLevel();
-               if (zoom <= 0)
-               {
-                       r = GetLastResult();
-                       TryCatch(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO),"[%s] __pCamera->GetMaxZoomLevel()", GetErrorMessage(r));
-               }
 
                Dimension dim(VR_FORM_POPUP_SLIDER_W, VR_FORM_POPUP_SLIDER_H);
                Rectangle okButtonRect((VR_FORM_POPUP_SLIDER_W/2 - VR_FORM_SLIDER_OK_BUTTON_W/2 ),
@@ -5688,7 +5675,7 @@ VideoRecorderForm::EnableFooterItem(int actionId, bool enable)
 {
        result r = E_SUCCESS;
        Footer* pFooter = GetFooter();
-       TryReturn(pFooter != null, ShowErrorResult(GetLastResult(), METHOD_FILE_LINENO), "[%s] GetFooter", GetErrorMessage(r));
+       TryReturn(pFooter != null, ShowErrorResult(E_OBJ_NOT_FOUND, METHOD_FILE_LINENO), "[%s] GetFooter", GetErrorMessage(E_OBJ_NOT_FOUND));
 
        r = pFooter->SetItemEnabled((actionId - ID_SETTING), enable);
        TryReturn(r == E_SUCCESS, ShowErrorResult(r, METHOD_FILE_LINENO), "[%s] pFooter->SetItemEnabled", GetErrorMessage(r));