* @file FSys_SettingInfoImpl.cpp
* @brief This is the implementation file for _SysSettingInfoImpl class.
*/
+#include <unique_ptr.h>
#include <system/system_settings.h>
#include <FBase.h>
#include <FBase_StringConverter.h>
#include <FBase_NativeError.h>
#include <FSys_SettingInfoImpl.h>
+
#include "FSys_SettingClient.h"
+using namespace std;
+
using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
}
else if(key == _FONT_TYPE)
{
- char* pFontType = null;
int res = 0;
r = E_SUCCESS;
- pFontType = _StringConverter::CopyToCharArrayN(value);
- SysTryReturnResult(NID_SYS, pFontType != null, E_SYSTEM, "It is failed to convert String to string.");
- SysLog(NID_SYS, "Requested font type is %s.", pFontType);
- res = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, pFontType);
- delete [] pFontType;
+ unique_ptr<char[]> pFontType(_StringConverter::CopyToCharArrayN(value));
+ SysTryReturnResult(NID_SYS, pFontType.get() != null, E_SYSTEM, "It is failed to convert String to string.");
+ SysLog(NID_SYS, "Requested font type is %s.", pFontType.get());
+ res = system_settings_set_value_string(SYSTEM_SETTINGS_KEY_FONT_TYPE, pFontType.get());
+ SysTryReturnResult(NID_SYS, res != SYSTEM_SETTINGS_ERROR_INVALID_PARAMETER, E_INVALID_ARG, "It is not valid font type.");
SysTryReturnResult(NID_SYS, res == SYSTEM_SETTINGS_ERROR_NONE, E_SYSTEM, "It is failed to set font type.");
}
return r;