1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

winspector.c: Full clean patch

This patch sets a correct style on winspector.c. It removes some
empty lines, moves variable definitions to the function heads,
moves preprocessor definitions to the top of the file and removes
some extra curly brackets.

The function to create the winspector panel is so big, and is hard
to understand it. This patch split the function createInspectorForWindow
in some extra functions:

create_tab_window_attributes
create_tab_window_advanced
create_tab_icon_workspace
create_tab_app_specific

This functions don't do nothing extra, only the code is moved to them.
This commit is contained in:
Rodolfo García Peñas (kix)
2012-11-25 21:44:36 +01:00
committed by Carlos R. Mafra
parent bf2f942138
commit 99e5a7a9eb
2 changed files with 246 additions and 309 deletions

View File

@@ -869,17 +869,15 @@ void wReadStaticDefaults(WMPropList * dict)
else
plvalue = NULL;
if (!plvalue) {
/* no default in the DB. Use builtin default */
/* no default in the DB. Use builtin default */
if (!plvalue)
plvalue = entry->plvalue;
}
if (plvalue) {
/* convert data */
(*entry->convert) (NULL, entry, plvalue, entry->addr, &tdata);
if (entry->update) {
if (entry->update)
(*entry->update) (NULL, entry, tdata, entry->extra_data);
}
}
}
}
@@ -953,9 +951,10 @@ void wDefaultsCheckDomains(void* arg)
dict = shared_dict;
shared_dict = NULL;
}
if (WDWindowAttributes->dictionary) {
if (WDWindowAttributes->dictionary)
WMReleasePropList(WDWindowAttributes->dictionary);
}
WDWindowAttributes->dictionary = dict;
for (i = 0; i < wScreenCount; i++) {
scr = wScreenWithNumber(i);
@@ -972,10 +971,10 @@ void wDefaultsCheckDomains(void* arg)
} else {
wwarning(_("could not load domain %s from user defaults database"), "WMWindowAttributes");
}
WDWindowAttributes->timestamp = stbuf.st_mtime;
if (shared_dict) {
if (shared_dict)
WMReleasePropList(shared_dict);
}
}
if (stat(WDRootMenu->path, &stbuf) >= 0 && WDRootMenu->timestamp < stbuf.st_mtime) {
@@ -987,9 +986,9 @@ void wDefaultsCheckDomains(void* arg)
wwarning(_("Domain %s (%s) of defaults database is corrupted!"),
"WMRootMenu", WDRootMenu->path);
} else {
if (WDRootMenu->dictionary) {
if (WDRootMenu->dictionary)
WMReleasePropList(WDRootMenu->dictionary);
}
WDRootMenu->dictionary = dict;
wDefaultsMergeGlobalMenus(WDRootMenu);
}