mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 15:12:32 +01:00
small cleanup
This commit is contained in:
@@ -202,12 +202,15 @@ wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
|
||||
|
||||
|
||||
if (class && instance) {
|
||||
char *buffer = NULL;
|
||||
buffer = wmalloc(strlen(class)+strlen(instance)+4);
|
||||
key1 = WMCreatePLString(strcat(strcat(strcpy(buffer,instance),"."),class));
|
||||
wfree(buffer);
|
||||
} else
|
||||
key1 = NULL;
|
||||
char *buffer;
|
||||
|
||||
buffer = wmalloc(strlen(class)+strlen(instance)+2);
|
||||
sprintf(buffer, "%s.%s", instance, class);
|
||||
key1 = WMCreatePLString(buffer);
|
||||
wfree(buffer);
|
||||
} else {
|
||||
key1 = NULL;
|
||||
}
|
||||
|
||||
if (instance)
|
||||
key2 = WMCreatePLString(instance);
|
||||
@@ -342,13 +345,15 @@ get_generic_value(WScreen *scr, char *instance, char *class, WMPropList *option,
|
||||
WMPLSetCaseSensitive(True);
|
||||
|
||||
if (class && instance) {
|
||||
char *buffer = NULL;
|
||||
buffer = wmalloc(strlen(class)+strlen(instance)+4);
|
||||
key = WMCreatePLString(strcat(strcat(strcpy(buffer,instance),"."),class));
|
||||
char *buffer;
|
||||
|
||||
buffer = wmalloc(strlen(class)+strlen(instance)+2);
|
||||
sprintf(buffer, "%s.%s", instance, class);
|
||||
key = WMCreatePLString(buffer);
|
||||
wfree(buffer);
|
||||
|
||||
dict = WMGetFromPLDictionary(WDWindowAttributes->dictionary, key);
|
||||
WMReleasePropList(key);
|
||||
wfree(buffer);
|
||||
|
||||
if (dict) {
|
||||
value = WMGetFromPLDictionary(dict, option);
|
||||
@@ -508,7 +513,7 @@ wDefaultChangeIcon(WScreen *scr, char *instance, char* class, char *file)
|
||||
if (instance && class) {
|
||||
char *buffer;
|
||||
buffer = wmalloc(strlen(instance) + strlen(class) + 2);
|
||||
strcat(strcat(strcpy(buffer, instance), "."), class);
|
||||
sprintf(buffer, "%s.%s", instance, class);
|
||||
key = WMCreatePLString(buffer);
|
||||
wfree(buffer);
|
||||
} else if (instance) {
|
||||
|
||||
@@ -525,10 +525,10 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
else if (WMGetButtonSelected(panel->clsRb) != 0)
|
||||
key = WMCreatePLString(wwin->wm_class);
|
||||
else if (WMGetButtonSelected(panel->bothRb) != 0) {
|
||||
char *buffer;
|
||||
char *buffer;
|
||||
|
||||
buffer = wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+4);
|
||||
strcat(strcat(strcpy(buffer, wwin->wm_instance), "."), wwin->wm_class);
|
||||
buffer = wmalloc(strlen(wwin->wm_instance)+strlen(wwin->wm_class)+2);
|
||||
sprintf(buffer, "%s.%s", wwin->wm_instance, wwin->wm_class);
|
||||
key = WMCreatePLString(buffer);
|
||||
wfree(buffer);
|
||||
} else if (WMGetButtonSelected(panel->defaultRb) != 0) {
|
||||
@@ -682,25 +682,22 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
||||
|
||||
wapp = wApplicationOf(panel->inspected->main_window);
|
||||
if (wapp) {
|
||||
char *iconFile;
|
||||
char *buffer;
|
||||
char *instance = wapp->main_window_desc->wm_instance;
|
||||
char *class = wapp->main_window_desc->wm_class;
|
||||
char *iconFile, *buffer;
|
||||
|
||||
appDic = WMCreatePLDictionary(NULL, NULL, NULL);
|
||||
|
||||
assert(wapp->main_window_desc->wm_instance!=NULL);
|
||||
assert(wapp->main_window_desc->wm_class!=NULL);
|
||||
assert(instance!=NULL);
|
||||
assert(class!=NULL);
|
||||
|
||||
buffer = wmalloc(strlen(wapp->main_window_desc->wm_instance)
|
||||
+strlen(wapp->main_window_desc->wm_class)+4);
|
||||
strcat(strcpy(buffer, wapp->main_window_desc->wm_instance), ".");
|
||||
strcat(buffer, wapp->main_window_desc->wm_class);
|
||||
buffer = wmalloc(strlen(instance)+strlen(class)+2);
|
||||
sprintf(buffer, "%s.%s", instance, class);
|
||||
key = WMCreatePLString(buffer);
|
||||
wfree(buffer);
|
||||
|
||||
iconFile = wDefaultGetIconFile(wwin->screen_ptr,
|
||||
wapp->main_window_desc->wm_instance,
|
||||
wapp->main_window_desc->wm_class,
|
||||
False);
|
||||
iconFile = wDefaultGetIconFile(wwin->screen_ptr,
|
||||
instance, class, False);
|
||||
|
||||
if (iconFile && iconFile[0]!=0) {
|
||||
value = WMCreatePLString(iconFile);
|
||||
|
||||
Reference in New Issue
Block a user