gboolean compiz_set(const char *key, const char *value) { if (key == NULL) { return FALSE; } if (g_strcmp0(value, VAL_WORKSPACE) == 0) { return set_scale(key, value); } return set_commands(key, value, FALSE); }
void redis_commands::init(const char* cmds_file) { set_commands(); if (cmds_file && *cmds_file) { acl::ifstream in; if (in.open_read(cmds_file) == false) { logger_error("load file %s error: %s", cmds_file, acl::last_serror()); return; } load_commands(in); } show_commands(); }
static gboolean set_scale (const char *key, const char *value) { g_debug("Set scale key: %s, value: %s\n", key, value); gchar *ret = get_command_key(key, edge_map); if (ret == NULL) { return FALSE; } g_debug("Scale Real Value: %s\n", ret); GSettings *scaleSettings = g_settings_new_with_path(SCALE_SCHEMA_ID, SCALE_SCHEMA_PATH); gboolean ok = g_settings_set_string(scaleSettings, SCALE_EDGE_KEY, ret); g_free(ret); if (ok) { g_debug("Clear Commands Key: %s\n", key); set_commands(key, "", TRUE); } return ok; }