4 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Youngae Kang <youngae.kang@samsung.com>, Yunhan Kim <yhan.kim@samsung.com>,
7 * Genie Kim <daejins.kim@samsung.com>, Minjune Kim <sena06.kim@samsung.com>
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
27 #include "location-log.h"
28 #include "location-setting.h"
31 gint location_setting_get_key_val(keynode_t *key)
33 g_return_val_if_fail(key, -1);
35 switch(vconf_keynode_get_type(key))
38 val = vconf_keynode_get_int(key);
39 LOCATION_LOGD("Setting changed [%s]:[%d]", vconf_keynode_get_name(key), val);
42 LOCATION_LOGW("Unused type(%d)", vconf_keynode_get_type(key));
48 gint location_setting_get_int(const gchar* path)
50 g_return_val_if_fail(path, -1);
52 if( vconf_get_int(path, &val)){
53 LOCATION_LOGW("vconf_get_int: failed [%s]", path);
56 LOCATION_LOGD("vconf_get_int: [%s]:[%d]", path, val);
60 gboolean location_setting_get_bool(const gchar* path)
62 g_return_val_if_fail(path, -1);
64 if( vconf_get_bool(path, &val)){
65 LOCATION_LOGW("vconf_get_int: failed [%s]", path);
71 gchar *location_setting_get_string(const gchar* path)
73 g_return_val_if_fail(path, -1);
74 return vconf_get_str(path);
77 gint location_setting_add_notify(const gchar* path, SettingCB setting_cb, gpointer self)
79 g_return_val_if_fail(path, -1);
80 g_return_val_if_fail(self, -1);
82 if( vconf_notify_key_changed(path, setting_cb, self)){
83 LOCATION_LOGW("vconf notify add failed [%s]", path);
86 LOCATION_LOGD("vconf notify added [%s]", path);
90 gint location_setting_ignore_notify(const gchar* path, SettingCB setting_cb)
92 g_return_val_if_fail(path, -1);
93 g_return_val_if_fail(setting_cb, -1);
95 if( vconf_ignore_key_changed(path, setting_cb)){
96 LOCATION_LOGW("vconf notify remove failed [%s]", path);
99 LOCATION_LOGD("vconf notify removed [%s]", path);