Code cleanup
This commit is contained in:
parent
91bd571f40
commit
bc4f45494d
@ -1366,9 +1366,9 @@ static void _done_categories(Desktop * desktop)
|
|||||||
path = config_get(config, NULL, "path");
|
path = config_get(config, NULL, "path");
|
||||||
if((q = config_get(config, section, "Categories")) == NULL)
|
if((q = config_get(config, section, "Categories")) == NULL)
|
||||||
{
|
{
|
||||||
icon = desktopicon_new_application(desktop, path,
|
if((icon = desktopicon_new_application(desktop, path,
|
||||||
NULL);
|
NULL)) != NULL)
|
||||||
_desktop_icon_add(desktop, icon);
|
_desktop_icon_add(desktop, icon);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for(i = 0; i < _desktop_categories_cnt
|
for(i = 0; i < _desktop_categories_cnt
|
||||||
@ -1377,15 +1377,17 @@ static void _done_categories(Desktop * desktop)
|
|||||||
&& string_find(q, dc->category) == NULL; i++);
|
&& string_find(q, dc->category) == NULL; i++);
|
||||||
if(dc->category == NULL)
|
if(dc->category == NULL)
|
||||||
{
|
{
|
||||||
icon = desktopicon_new_application(desktop, path,
|
if((icon = desktopicon_new_application(desktop, path,
|
||||||
NULL);
|
NULL)) != NULL)
|
||||||
_desktop_icon_add(desktop, icon);
|
_desktop_icon_add(desktop, icon);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(dc->show == TRUE)
|
if(dc->show == TRUE)
|
||||||
continue;
|
continue;
|
||||||
dc->show = TRUE;
|
dc->show = TRUE;
|
||||||
icon = desktopicon_new_category(desktop, dc->name, dc->icon);
|
if((icon = desktopicon_new_category(desktop, dc->name,
|
||||||
|
dc->icon)) == NULL)
|
||||||
|
continue;
|
||||||
desktopicon_set_callback(icon, _done_categories_open, dc);
|
desktopicon_set_callback(icon, _done_categories_open, dc);
|
||||||
_desktop_icon_add(desktop, icon);
|
_desktop_icon_add(desktop, icon);
|
||||||
}
|
}
|
||||||
@ -1440,7 +1442,7 @@ static int _align_compare(const void * a, const void * b);
|
|||||||
|
|
||||||
void desktop_icons_align(Desktop * desktop)
|
void desktop_icons_align(Desktop * desktop)
|
||||||
{
|
{
|
||||||
qsort(desktop->icon, desktop->icon_cnt, sizeof(void*), _align_compare);
|
qsort(desktop->icon, desktop->icon_cnt, sizeof(void *), _align_compare);
|
||||||
desktop_set_alignment(desktop, desktop->prefs.alignment);
|
desktop_set_alignment(desktop, desktop->prefs.alignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user