Remove vconf usage code
authorJihoon Chung <jihoon.chung@samsung.com>
Fri, 10 May 2013 08:23:18 +0000 (17:23 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Sat, 11 May 2013 04:44:33 +0000 (13:44 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] Security setting value is moved vconf to database
This commit replace vconf usage to use WidgetDao
[SCMRequest] must be imported with wrt-commons, wrt-installer

Change-Id: I440855fd2db947cba82db72541235cd4e39f0047

webapp-detail/advancedview.cpp

index 9e0c0fb..d88ddc4 100644 (file)
@@ -26,7 +26,6 @@
 #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"
@@ -283,27 +282,22 @@ SettingData::SettingData(DPL::String appID, int index, std::string menuText) :
 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;
     }
 
@@ -317,22 +311,17 @@ void SettingData::saveChange(bool state)
     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 */