diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/settings.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/settings.c b/src/settings.c index c48ccb0..f261d41 100644 --- a/src/settings.c +++ b/src/settings.c @@ -181,8 +181,7 @@ init_mappings_table(void) for (i = 0; i < sizeof(mappings) / sizeof(mappings[0]); ++i) { g_hash_table_insert(mappings_table, - g_strdup(mappings[i].mq_name), - g_strdup(mappings[i].wk_name)); + g_strdup(mappings[i].mq_name), &mappings[i]); } } @@ -212,6 +211,10 @@ mq_settings_set_web_context(MqSettings *settings, WebKitWebContext *web_context) settings->web_context = web_context; } +#define map_name(NAME) \ + (((struct mapping *) g_hash_table_lookup(mappings_table, \ + NAME))->wk_name) + static void set_bool(MqSettings *settings, const gchar *name, const gboolean value) { @@ -219,8 +222,7 @@ set_bool(MqSettings *settings, const gchar *name, const gboolean value) g_value_init(&g_value, G_TYPE_BOOLEAN); g_value_set_boolean(&g_value, value); - g_object_set_property(G_OBJECT(settings), - g_hash_table_lookup(mappings_table, name), &g_value); + g_object_set_property(G_OBJECT(settings), map_name(name), &g_value); } static void @@ -230,8 +232,7 @@ set_int(MqSettings *settings, const gchar *name, const gint value) g_value_init(&g_value, G_TYPE_INT); g_value_set_int(&g_value, value); - g_object_set_property(G_OBJECT(settings), - g_hash_table_lookup(mappings_table, name), &g_value); + g_object_set_property(G_OBJECT(settings), map_name(name), &g_value); } static void @@ -241,8 +242,7 @@ set_str(MqSettings *settings, const gchar *name, const gchar *value) g_value_init(&g_value, G_TYPE_STRING); g_value_set_static_string(&g_value, value); - g_object_set_property(G_OBJECT(settings), - g_hash_table_lookup(mappings_table, name), &g_value); + g_object_set_property(G_OBJECT(settings), map_name(name), &g_value); } void |