summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/settings.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/settings.c b/src/settings.c
index f261d41..c8595f9 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -211,6 +211,9 @@ mq_settings_set_web_context(MqSettings *settings, WebKitWebContext *web_context)
settings->web_context = web_context;
}
+#define is_neg(NAME) \
+ (((struct mapping *) g_hash_table_lookup(mappings_table, \
+ NAME))->type == MAP_BOOL_N)
#define map_name(NAME) \
(((struct mapping *) g_hash_table_lookup(mappings_table, \
NAME))->wk_name)
@@ -221,7 +224,7 @@ set_bool(MqSettings *settings, const gchar *name, const gboolean value)
GValue g_value = G_VALUE_INIT;
g_value_init(&g_value, G_TYPE_BOOLEAN);
- g_value_set_boolean(&g_value, value);
+ g_value_set_boolean(&g_value, is_neg(name) ? !value : value);
g_object_set_property(G_OBJECT(settings), map_name(name), &g_value);
}