mirror of
https://github.com/swaywm/sway.git
synced 2026-04-27 06:46:25 -04:00
Clean up imported bar commands
This commit is contained in:
parent
849c3515ab
commit
741424c4e7
23 changed files with 104 additions and 136 deletions
|
|
@ -11,10 +11,8 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
|
|||
|
||||
const char *name = argv[0];
|
||||
const char *oldname = config->current_bar->id;
|
||||
|
||||
// check if id is used by a previously defined bar
|
||||
int i;
|
||||
for (i = 0; i < config->bars->length; ++i) {
|
||||
for (int i = 0; i < config->bars->length; ++i) {
|
||||
struct bar_config *find = config->bars->items[i];
|
||||
if (strcmp(name, find->id) == 0 && config->current_bar != find) {
|
||||
return cmd_results_new(CMD_FAILURE, "id",
|
||||
|
|
@ -27,7 +25,6 @@ struct cmd_results *bar_cmd_id(int argc, char **argv) {
|
|||
|
||||
// free old bar id
|
||||
free(config->current_bar->id);
|
||||
|
||||
config->current_bar->id = strdup(name);
|
||||
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue