diff options
author | Daniel Carl <danielcarl@gmx.de> | 2018-06-02 21:47:46 +0200 |
---|---|---|
committer | Daniel Carl <danielcarl@gmx.de> | 2018-06-02 22:07:56 +0200 |
commit | 8806b4919f0aba7f545d6cb601238178224dbe57 (patch) | |
tree | 71a46b33167b37d4b6202e7471ccb3a8c76d5a30 /src/input.c | |
parent | 621edbd621052323be7c6d86243a5b41dd285246 (diff) |
Fixed some code style issues.
Diffstat (limited to 'src/input.c')
-rw-r--r-- | src/input.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/input.c b/src/input.c index 43b0a3c..66abfbc 100644 --- a/src/input.c +++ b/src/input.c @@ -141,10 +141,8 @@ VbResult input_open_editor(Client *c) idreturn = ext_proxy_eval_script_sync(c, "vimb_input_mode_element.id"); g_variant_get(idreturn, "(bs)", &idSuccess, &id); - /** - * Special case: the input element does not have an id assigned to it - **/ - if( !idSuccess || !id || strlen(id) == 0) { + /* Special case: the input element does not have an id assigned to it */ + if (!idSuccess || !id || strlen(id) == 0) { element_map_key = element_map_next_key++; char *js_command = g_strdup_printf(JS_SET_EDITOR_MAP_ELEMENT, element_map_key); ext_proxy_eval_script(c, js_command, NULL); @@ -190,7 +188,7 @@ VbResult input_open_editor(Client *c) data->c = c; data->element_id = element_id; data->element_map_key = element_map_key; - + g_child_watch_add(pid, (GChildWatchFunc)resume_editor, data); return RESULT_COMPLETE; @@ -215,12 +213,12 @@ static void resume_editor(GPid pid, int status, EditorData *data) escaped = g_strescape(text, NULL); /* put the text back into the element */ - if( data->element_id && strlen(data->element_id) > 0 ) + if (data->element_id && strlen(data->element_id) > 0) { jscode = g_strdup_printf("document.getElementById(\"%s\").value=\"%s\"", data->element_id, escaped); - else + } else { jscode = g_strdup_printf("vimb_editor_map.get(\"%lu\").value=\"%s\"", data->element_map_key, escaped); - - + } + ext_proxy_eval_script(data->c, jscode, NULL); g_free(jscode); @@ -229,12 +227,12 @@ static void resume_editor(GPid pid, int status, EditorData *data) } } - if( data->element_id && strlen(data->element_id) > 0 ) { + if (data->element_id && strlen(data->element_id) > 0) { jscode_enable = g_strdup_printf(JS_FOCUS_ELEMENT_BY_ID, - data->element_id, data->element_id); + data->element_id, data->element_id); } else { jscode_enable = g_strdup_printf(JS_FOCUS_EDITOR_MAP_ELEMENT, - data->element_map_key, data->element_map_key); + data->element_map_key, data->element_map_key); } ext_proxy_eval_script(data->c, jscode_enable, NULL); g_free(jscode_enable); |