Skip to content

Commit

Permalink
[settings] Remove gconf references from interface function names. MER…
Browse files Browse the repository at this point in the history
…#1554

Use mce_setting prefix instead of mce_gconf.

No functional changes.
  • Loading branch information
spiiroin committed Mar 31, 2016
1 parent eec0197 commit 9c04e70
Show file tree
Hide file tree
Showing 15 changed files with 807 additions and 813 deletions.
40 changes: 20 additions & 20 deletions event-input.c
Expand Up @@ -3178,13 +3178,13 @@ static void
evin_ts_grab_init(void)
{
/* Get touch unblock delay */
mce_gconf_notifier_add(MCE_SETTING_EVENT_INPUT_PATH,
MCE_SETTING_TOUCH_UNBLOCK_DELAY,
evin_ts_grab_gconf_changed_cb,
&evin_ts_grab_release_delay_id);
mce_setting_notifier_add(MCE_SETTING_EVENT_INPUT_PATH,
MCE_SETTING_TOUCH_UNBLOCK_DELAY,
evin_ts_grab_gconf_changed_cb,
&evin_ts_grab_release_delay_id);

mce_gconf_get_int(MCE_SETTING_TOUCH_UNBLOCK_DELAY,
&evin_ts_grab_release_delay);
mce_setting_get_int(MCE_SETTING_TOUCH_UNBLOCK_DELAY,
&evin_ts_grab_release_delay);

mce_log(LL_INFO, "touch unblock delay config: %d",
evin_ts_grab_release_delay);
Expand All @@ -3197,7 +3197,7 @@ evin_ts_grab_init(void)
static void
evin_ts_grab_quit(void)
{
mce_gconf_notifier_remove(evin_ts_grab_release_delay_id),
mce_setting_notifier_remove(evin_ts_grab_release_delay_id),
evin_ts_grab_release_delay_id = 0;

evin_input_grab_reset(&evin_ts_grab_state);
Expand Down Expand Up @@ -3367,11 +3367,11 @@ static void evin_gconf_cb(GConfClient *const gcc, const guint id,
static void evin_gconf_init(void)
{
/* Bitmask of input devices that can be grabbed */
mce_gconf_track_int(MCE_SETTING_INPUT_GRAB_ALLOWED,
&evin_gconf_input_grab_allowed,
MCE_DEFAULT_INPUT_GRAB_ALLOWED,
evin_gconf_cb,
&evin_gconf_input_grab_allowed_id);
mce_setting_track_int(MCE_SETTING_INPUT_GRAB_ALLOWED,
&evin_gconf_input_grab_allowed,
MCE_DEFAULT_INPUT_GRAB_ALLOWED,
evin_gconf_cb,
&evin_gconf_input_grab_allowed_id);

evin_gconf_input_grab_rethink();
}
Expand All @@ -3380,7 +3380,7 @@ static void evin_gconf_init(void)
*/
static void evin_gconf_quit(void)
{
mce_gconf_notifier_remove(evin_gconf_input_grab_allowed_id),
mce_setting_notifier_remove(evin_gconf_input_grab_allowed_id),
evin_gconf_input_grab_allowed_id = 0;
}

Expand All @@ -3407,13 +3407,13 @@ mce_input_init(void)

#ifdef ENABLE_DOUBLETAP_EMULATION
/* Get fake doubletap policy configuration & track changes */
mce_gconf_notifier_add(MCE_SETTING_EVENT_INPUT_PATH,
MCE_SETTING_USE_FAKE_DOUBLETAP,
evin_doubletap_gconf_changed_cb,
&fake_evin_doubletap_id);
mce_setting_notifier_add(MCE_SETTING_EVENT_INPUT_PATH,
MCE_SETTING_USE_FAKE_DOUBLETAP,
evin_doubletap_gconf_changed_cb,
&fake_evin_doubletap_id);

mce_gconf_get_bool(MCE_SETTING_USE_FAKE_DOUBLETAP,
&fake_evin_doubletap_enabled);
mce_setting_get_bool(MCE_SETTING_USE_FAKE_DOUBLETAP,
&fake_evin_doubletap_enabled);
#endif

/* Append triggers/filters to datapipes */
Expand Down Expand Up @@ -3451,7 +3451,7 @@ mce_input_exit(void)
{
#ifdef ENABLE_DOUBLETAP_EMULATION
/* Remove fake doubletap policy change notifier */
mce_gconf_notifier_remove(fake_evin_doubletap_id),
mce_setting_notifier_remove(fake_evin_doubletap_id),
fake_evin_doubletap_id = 0;
#endif

Expand Down
54 changes: 27 additions & 27 deletions mce-gconf.c
Expand Up @@ -39,7 +39,7 @@ static GSList *gconf_notifiers = NULL;
*
* @return TRUE if value exits, FALSE otherwise
*/
gboolean mce_gconf_has_key(const gchar *const key)
gboolean mce_setting_has_key(const gchar *const key)
{
gboolean res = FALSE;
GConfValue *val = 0;
Expand All @@ -65,7 +65,7 @@ gboolean mce_gconf_has_key(const gchar *const key)
* @param value The value to set the key to
* @return TRUE on success, FALSE on failure
*/
gboolean mce_gconf_set_int(const gchar *const key, const gint value)
gboolean mce_setting_set_int(const gchar *const key, const gint value)
{
gboolean status = FALSE;

Expand Down Expand Up @@ -95,7 +95,7 @@ gboolean mce_gconf_set_int(const gchar *const key, const gint value)
* @param value The value to set the key to
* @return TRUE on success, FALSE on failure
*/
gboolean mce_gconf_set_string(const gchar *const key, const gchar *const value)
gboolean mce_setting_set_string(const gchar *const key, const gchar *const value)
{
gboolean status = FALSE;

Expand Down Expand Up @@ -125,7 +125,7 @@ gboolean mce_gconf_set_string(const gchar *const key, const gchar *const value)
* @param[out] value Will contain the value on return, if successful
* @return TRUE on success, FALSE on failure
*/
gboolean mce_gconf_get_bool(const gchar *const key, gboolean *value)
gboolean mce_setting_get_bool(const gchar *const key, gboolean *value)
{
gboolean status = FALSE;
GError *error = NULL;
Expand Down Expand Up @@ -171,7 +171,7 @@ gboolean mce_gconf_get_bool(const gchar *const key, gboolean *value)
* @param[out] value Will contain the value on return
* @return TRUE on success, FALSE on failure
*/
gboolean mce_gconf_get_int(const gchar *const key, gint *value)
gboolean mce_setting_get_int(const gchar *const key, gint *value)
{
gboolean status = FALSE;
GError *error = NULL;
Expand Down Expand Up @@ -217,7 +217,7 @@ gboolean mce_gconf_get_int(const gchar *const key, gint *value)
* @param[out] values Will contain an GSList with the values on return
* @return TRUE on success, FALSE on failure
*/
gboolean mce_gconf_get_int_list(const gchar *const key, GSList **values)
gboolean mce_setting_get_int_list(const gchar *const key, GSList **values)
{
gboolean status = FALSE;
GError *error = NULL;
Expand Down Expand Up @@ -280,7 +280,7 @@ gboolean mce_gconf_get_int_list(const gchar *const key, GSList **values)
* @param[out] value Will contain a newly allocated string with the value
* @return TRUE on success, FALSE on failure
*/
gboolean mce_gconf_get_string(const gchar *const key, gchar **value)
gboolean mce_setting_get_string(const gchar *const key, gchar **value)
{
gboolean status = FALSE;
GError *error = NULL;
Expand Down Expand Up @@ -329,7 +329,7 @@ gboolean mce_gconf_get_string(const gchar *const key, gchar **value)
*
* @return TRUE on success, FALSE on failure
*/
gboolean mce_gconf_notifier_add(const gchar *path, const gchar *key,
gboolean mce_setting_notifier_add(const gchar *path, const gchar *key,
const GConfClientNotifyFunc callback,
guint *cb_id)
{
Expand Down Expand Up @@ -388,7 +388,7 @@ gboolean mce_gconf_notifier_add(const gchar *path, const gchar *key,
*
* @param id The ID of the notifier to remove, or zero
*/
void mce_gconf_notifier_remove(guint id)
void mce_setting_notifier_remove(guint id)
{
if( gconf_disabled )
goto EXIT;
Expand All @@ -408,16 +408,16 @@ void mce_gconf_notifier_remove(guint id)
* @param cb_id The ID of the notifier to remove
* @param user_data Unused
*/
void mce_gconf_notifier_remove_cb(gpointer cb_id, gpointer user_data)
void mce_setting_notifier_remove_cb(gpointer cb_id, gpointer user_data)
{
(void)user_data;

mce_gconf_notifier_remove(GPOINTER_TO_INT(cb_id));
mce_setting_notifier_remove(GPOINTER_TO_INT(cb_id));
}

/** Helper for getting path of gconf key
*/
static gchar *mce_gconf_get_path(const gchar *key)
static gchar *mce_setting_get_path(const gchar *key)
{
gchar *res = 0;
const gchar *end = strrchr(key, '/');
Expand All @@ -437,15 +437,15 @@ static gchar *mce_gconf_get_path(const gchar *key)
* @param cb change notification callback
* @param cb_id where to store notification callback id
*/
void mce_gconf_track_int(const gchar *key, gint *val, gint def,
void mce_setting_track_int(const gchar *key, gint *val, gint def,
GConfClientNotifyFunc cb, guint *cb_id)
{
gchar *path = mce_gconf_get_path(key);
gchar *path = mce_setting_get_path(key);

if( path && cb && cb_id )
mce_gconf_notifier_add(path, key, cb, cb_id);
mce_setting_notifier_add(path, key, cb, cb_id);

if( !mce_gconf_get_int(key, val) && def != -1 )
if( !mce_setting_get_int(key, val) && def != -1 )
*val = def;

g_free(path);
Expand All @@ -460,15 +460,15 @@ void mce_gconf_track_int(const gchar *key, gint *val, gint def,
* @param cb change notification callback
* @param cb_id where to store notification callback id
*/
void mce_gconf_track_bool(const gchar *key, gboolean *val, gint def,
void mce_setting_track_bool(const gchar *key, gboolean *val, gint def,
GConfClientNotifyFunc cb, guint *cb_id)
{
gchar *path = mce_gconf_get_path(key);
gchar *path = mce_setting_get_path(key);

if( path && cb && cb_id )
mce_gconf_notifier_add(path, key, cb, cb_id);
mce_setting_notifier_add(path, key, cb, cb_id);

if( !mce_gconf_get_bool(key, val) && def != -1 )
if( !mce_setting_get_bool(key, val) && def != -1 )
*val = (def != 0);

g_free(path);
Expand All @@ -486,15 +486,15 @@ void mce_gconf_track_bool(const gchar *key, gboolean *val, gint def,
* @param cb change notification callback
* @param cb_id where to store notification callback id
*/
void mce_gconf_track_string(const gchar *key, gchar **val, const gchar *def,
void mce_setting_track_string(const gchar *key, gchar **val, const gchar *def,
GConfClientNotifyFunc cb, guint *cb_id)
{
gchar *path = mce_gconf_get_path(key);
gchar *path = mce_setting_get_path(key);

if( path && cb && cb_id )
mce_gconf_notifier_add(path, key, cb, cb_id);
mce_setting_notifier_add(path, key, cb, cb_id);

if( !mce_gconf_get_string(key, val) && def != 0 )
if( !mce_setting_get_string(key, val) && def != 0 )
*val = g_strdup(def);

g_free(path);
Expand All @@ -505,7 +505,7 @@ void mce_gconf_track_string(const gchar *key, gchar **val, const gchar *def,
*
* @return TRUE on success, FALSE on failure
*/
gboolean mce_gconf_init(void)
gboolean mce_setting_init(void)
{
gboolean status = FALSE;

Expand All @@ -524,11 +524,11 @@ gboolean mce_gconf_init(void)
/**
* Exit function for the mce-gconf component
*/
void mce_gconf_exit(void)
void mce_setting_exit(void)
{
if( gconf_client ) {
/* Free the list of GConf notifiers */
g_slist_foreach(gconf_notifiers, mce_gconf_notifier_remove_cb, 0);
g_slist_foreach(gconf_notifiers, mce_setting_notifier_remove_cb, 0);
gconf_notifiers = 0;

/* Forget builtin-gconf client reference */
Expand Down
36 changes: 15 additions & 21 deletions mce-gconf.h
Expand Up @@ -23,27 +23,21 @@

#include "builtin-gconf.h"

gboolean mce_gconf_has_key(const gchar *const key);
gboolean mce_gconf_set_int(const gchar *const key, const gint value);
gboolean mce_gconf_get_bool(const gchar *const key, gboolean *value);
gboolean mce_gconf_get_int(const gchar *const key, gint *value);
gboolean mce_gconf_get_int_list(const gchar *const key, GSList **values);
gboolean mce_gconf_get_string(const gchar *const key, gchar **value);
gboolean mce_gconf_set_string(const gchar *const key, const gchar *const value);
gboolean mce_gconf_notifier_add(const gchar *path, const gchar *key,
const GConfClientNotifyFunc callback,
guint *cb_id);
void mce_gconf_notifier_remove(guint id);
void mce_gconf_notifier_remove_cb(gpointer cb_id, gpointer user_data);
gboolean mce_setting_has_key (const gchar *const key);
gboolean mce_setting_set_int (const gchar *const key, const gint value);
gboolean mce_setting_set_string (const gchar *const key, const gchar *const value);
gboolean mce_setting_get_bool (const gchar *const key, gboolean *value);
gboolean mce_setting_get_int (const gchar *const key, gint *value);
gboolean mce_setting_get_int_list (const gchar *const key, GSList **values);
gboolean mce_setting_get_string (const gchar *const key, gchar **value);
gboolean mce_setting_notifier_add (const gchar *path, const gchar *key, const GConfClientNotifyFunc callback, guint *cb_id);
void mce_setting_notifier_remove (guint id);
void mce_setting_notifier_remove_cb(gpointer cb_id, gpointer user_data);
void mce_setting_track_int (const gchar *key, gint *val, gint def, GConfClientNotifyFunc cb, guint *cb_id);
void mce_setting_track_bool (const gchar *key, gboolean *val, gint def, GConfClientNotifyFunc cb, guint *cb_id);
void mce_setting_track_string (const gchar *key, gchar **val, const gchar *def, GConfClientNotifyFunc cb, guint *cb_id);

void mce_gconf_track_bool(const gchar *key, gboolean *val, gint def,
GConfClientNotifyFunc cb, guint *cb_id);
void mce_gconf_track_int(const gchar *key, gint *val, gint def,
GConfClientNotifyFunc cb, guint *cb_id);
void mce_gconf_track_string(const gchar *key, gchar **val, const gchar *def,
GConfClientNotifyFunc cb, guint *cb_id);

gboolean mce_gconf_init(void);
void mce_gconf_exit(void);
gboolean mce_setting_init (void);
void mce_setting_exit (void);

#endif /* _MCE_GCONF_H_ */
8 changes: 4 additions & 4 deletions mce.c
Expand Up @@ -970,7 +970,7 @@ int main(int argc, char **argv)
/* Initialise GConf
* pre-requisite: g_type_init()
*/
if (mce_gconf_init() == FALSE) {
if (mce_setting_init() == FALSE) {
mce_log(LL_CRIT,
"Cannot connect to default GConf engine");
exit(EXIT_FAILURE);
Expand All @@ -986,15 +986,15 @@ int main(int argc, char **argv)
mce_wltimer_init();

/* Initialise mode management
* pre-requisite: mce_gconf_init()
* pre-requisite: mce_setting_init()
* pre-requisite: mce_dbus_init()
*/
if (mce_mode_init() == FALSE) {
goto EXIT;
}

/* Initialise DSME
* pre-requisite: mce_gconf_init()
* pre-requisite: mce_setting_init()
* pre-requisite: mce_dbus_init()
* pre-requisite: mce_mce_init()
*/
Expand Down Expand Up @@ -1076,7 +1076,7 @@ int main(int argc, char **argv)
mce_datapipe_quit();

/* Call the exit function for all subsystems */
mce_gconf_exit();
mce_setting_exit();
mce_dbus_exit();
mce_conf_exit();
mce_worker_quit();
Expand Down

0 comments on commit 9c04e70

Please sign in to comment.