simplify savetagclientsel

This commit is contained in:
Julien Danjou 2007-10-31 11:43:17 +01:00
parent 582c81a3d0
commit 04255a9251
1 changed files with 5 additions and 6 deletions

View File

@ -441,23 +441,22 @@ uicb_reloadconfig(awesome_config *awesomeconf,
awesome_config *awesomeconf_first = &awesomeconf[-awesomeconf->screen]; awesome_config *awesomeconf_first = &awesomeconf[-awesomeconf->screen];
int *old_ntags, old_c_ntags, new_c_ntags, **mapping; int *old_ntags, old_c_ntags, new_c_ntags, **mapping;
char ***savetagnames; char ***savetagnames;
Client ****savetagclientsel; Client ***savetagclientsel;
Bool *old_c_tags; Bool *old_c_tags;
Client *c, *clients; Client *c, *clients;
/* Save tag information */ /* Save tag information */
savetagnames = p_new(char **, screen_count); savetagnames = p_new(char **, screen_count);
savetagclientsel = p_new(Client ***, screen_count); savetagclientsel = p_new(Client **, screen_count);
clients = *awesomeconf_first->clients; clients = *awesomeconf_first->clients;
for (screen = 0; screen < screen_count; screen ++) for (screen = 0; screen < screen_count; screen ++)
{ {
savetagnames[screen] = p_new(char *, awesomeconf_first[screen].ntags); savetagnames[screen] = p_new(char *, awesomeconf_first[screen].ntags);
savetagclientsel[screen] = p_new(Client **, awesomeconf_first[screen].ntags); savetagclientsel[screen] = p_new(Client *, awesomeconf_first[screen].ntags);
for (tag = 0; tag < awesomeconf_first[screen].ntags; tag++) for (tag = 0; tag < awesomeconf_first[screen].ntags; tag++)
{ {
savetagnames[screen][tag] = strdup(awesomeconf_first[screen].tags[tag].name); savetagnames[screen][tag] = strdup(awesomeconf_first[screen].tags[tag].name);
savetagclientsel[screen][tag] = p_new(Client*, 1); savetagclientsel[screen][tag] = awesomeconf_first[screen].tags[tag].client_sel;
*savetagclientsel[screen][tag] = awesomeconf_first[screen].tags[tag].client_sel;
} }
} }
old_ntags = p_new(int, screen_count); old_ntags = p_new(int, screen_count);
@ -489,7 +488,7 @@ uicb_reloadconfig(awesome_config *awesomeconf,
*awesomeconf_first[screen].clients = clients; *awesomeconf_first[screen].clients = clients;
for (tag = 0; tag < awesomeconf_first[screen].ntags; tag++) for (tag = 0; tag < awesomeconf_first[screen].ntags; tag++)
if (mapping[screen][tag] >= 0) if (mapping[screen][tag] >= 0)
awesomeconf_first[screen].tags[tag].client_sel = *savetagclientsel[screen][mapping[screen][tag]]; awesomeconf_first[screen].tags[tag].client_sel = savetagclientsel[screen][mapping[screen][tag]];
drawstatusbar(&awesomeconf_first[screen]); drawstatusbar(&awesomeconf_first[screen]);
} }