#include <dpl/foreach.h>
#include <dpl/assert.h>
#include <dpl/wrt-dao-ro/WrtDatabase.h>
-#include <dpl/wrt-dao-ro/vconf_config.h>
#include <dpl/wrt-dao-rw/widget_dao.h>
#include "exceptionsview.h"
#include "util.h"
bool SettingData::isEnabled()
{
using namespace WrtDB;
- std::string key;
+ SettingsType ret = SETTINGS_TYPE_UNKNOWN;
if (m_index == SECURITY_SETTINGS_IDX_SECURITY_POPUP_USAGE) {
- key = VconfConfig::GetVconfKeyPopupUsage(m_dao->getTzAppId());
+ ret = m_dao->getSecurityPopupUsage();
} else if (m_index == SECURITY_SETTINGS_IDX_GEOLOCATION_USAGE) {
- key = VconfConfig::GetVconfKeyGeolocationUsage(m_dao->getTzAppId());
+ ret = m_dao->getSecurityPopupUsage();
} else if (m_index == SECURITY_SETTINGS_IDX_WEB_NOTIFICATION_USAGE) {
- key = VconfConfig::GetVconfKeyWebNotificationUsage(
- m_dao->getTzAppId());
+ ret = m_dao->getSecurityPopupUsage();
} else if (m_index == SECURITY_SETTINGS_IDX_WEB_STORAGE_USAGE) {
- key = VconfConfig::GetVconfKeyWebDatabaseUsage(m_dao->getTzAppId());
- } else if (m_index == DEVELOPER_OPTIONS_IDX_MEMORY_SAVING_MODE) {
- key = VconfConfig::GetVconfKeyMemorySavingMode(m_dao->getTzAppId());
+ ret = m_dao->getSecurityPopupUsage();
} else {
Assert("Wrong menu index");
}
- int ret = 0;
- vconf_get_int(key.c_str(), &ret);
- if (static_cast<SettingsType>(ret) == SETTINGS_TYPE_ON) {
+ if (ret == SETTINGS_TYPE_ON) {
return true;
- } else if (static_cast<SettingsType>(ret) == SETTINGS_TYPE_OFF) {
+ } else if (ret == SETTINGS_TYPE_OFF) {
return false;
}
using namespace WrtDB;
SettingsType result = state ? SETTINGS_TYPE_ON : SETTINGS_TYPE_OFF;
- std::string key;
if (m_index == SECURITY_SETTINGS_IDX_SECURITY_POPUP_USAGE) {
- key = VconfConfig::GetVconfKeyPopupUsage(m_dao->getTzAppId());
+ m_dao->setSecurityPopupUsage(result);
} else if (m_index == SECURITY_SETTINGS_IDX_GEOLOCATION_USAGE) {
- key = VconfConfig::GetVconfKeyGeolocationUsage(m_dao->getTzAppId());
+ m_dao->setGeolocationUsage(result);
} else if (m_index == SECURITY_SETTINGS_IDX_WEB_NOTIFICATION_USAGE) {
- key = VconfConfig::GetVconfKeyWebNotificationUsage(
- m_dao->getTzAppId());
+ m_dao->setWebNotificationUsage(result);
} else if (m_index == SECURITY_SETTINGS_IDX_WEB_STORAGE_USAGE) {
- key = VconfConfig::GetVconfKeyWebDatabaseUsage(m_dao->getTzAppId());
- } else if (m_index == DEVELOPER_OPTIONS_IDX_MEMORY_SAVING_MODE) {
- key = VconfConfig::GetVconfKeyMemorySavingMode(m_dao->getTzAppId());
+ m_dao->setWebDatabaseUsage(result);
} else {
Assert("Wrong menu index");
}
- vconf_set_int(key.c_str(), static_cast<int>(result));
}
} /* WebAppDetailSetting */