8373aec6918f4c17c49e53dc468304ece2f1d1b5
[apps/home/b2-clocksetting.git] / src / setting_data_vconf.c
1 /*
2  * Copyright (c) 2010 Samsung Electronics, Inc.
3  * All rights reserved.
4  *
5  * This software is a confidential and proprietary information
6  * of Samsung Electronics, Inc. ("Confidential Information").  You
7  * shall not disclose such Confidential Information and shall use
8  * it only in accordance with the terms of the license agreement
9  * you entered into with Samsung Electronics.
10  */
11 #include "setting_data_vconf.h"
12 #include "util.h"
13
14
15 int unregister_vconf_changing(const char *vconf, vconf_callback_fn cb)
16 {
17         int ret = TRUE;
18         if ( vconf && cb ) {
19                 ret = vconf_ignore_key_changed(vconf, cb);
20                 if ( ret == VCONF_OK )
21                 {
22                         DBG("Setting - vconf's changed callback unregisted!!");
23                 }
24                 else
25                 {
26                         DBG("Setting - vconf's changed callback do not unregist");
27                         ret = FALSE;
28                 }
29         }
30         return ret;
31 }
32
33 int register_vconf_changing(const char *vconf, vconf_callback_fn cb, void *data)
34 {
35         int ret = TRUE;
36         if ( vconf && cb )
37         {
38                 ret = vconf_notify_key_changed(vconf, cb, data);
39                 if( ret == VCONF_OK )
40                 {
41                         DBG("Setting - vconf's changed callback is registed!");
42                 }
43                 else
44                 {
45                         DBG("Setting - vconf's changed callback is not registed!");
46                         ret = FALSE;
47                 }
48         }
49         return ret;
50 }