diff options
author | Nikias Bassen | 2009-12-17 04:52:27 +0100 |
---|---|---|
committer | Nikias Bassen | 2009-12-17 04:52:27 +0100 |
commit | 55a6a48079b304e71ca0020da93236ab4da37095 (patch) | |
tree | f7c36fc44b2bdde798edf10c6f01aa99fa648cfc | |
parent | f70a0e9ddb6d8df5ed6690685d572bbe06356b4a (diff) | |
download | sbmanager-55a6a48079b304e71ca0020da93236ab4da37095.tar.gz sbmanager-55a6a48079b304e71ca0020da93236ab4da37095.tar.bz2 |
Better support for 5-icon-dock when using 4 icons or less
-rw-r--r-- | src/sbmanager.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/sbmanager.c b/src/sbmanager.c index f133e16..5eb7585 100644 --- a/src/sbmanager.c +++ b/src/sbmanager.c @@ -91,16 +91,18 @@ static void sbpage_free(GList *sbitems) } } -static void get_icon_for_node(plist_t node, GList **list, sbservices_client_t sbc) +static void get_icon_for_node(plist_t node, GList **list, sbservices_client_t sbc, gboolean skip_empty) { char *png = NULL; uint64_t pngsize = 0; SBItem *di = NULL; plist_t valuenode = NULL; if (plist_get_node_type(node) != PLIST_DICT) { - di = g_new0(SBItem, 1); - *list = g_list_append(*list, di); - return; + if (!skip_empty) { + di = g_new0(SBItem, 1); + *list = g_list_append(*list, di); + return; + } } valuenode = plist_dict_get_item(node, "displayIdentifier"); if (valuenode && (plist_get_node_type(valuenode) == PLIST_STRING)) { @@ -203,7 +205,7 @@ static void get_icons(const char *uuid) count = plist_array_get_size(dock); for (i = 0; i < count; i++) { plist_t node = plist_array_get_item(dock, i); - get_icon_for_node(node, &dockitems, sbc); + get_icon_for_node(node, &dockitems, sbc, TRUE); } if (total > 1) { /* get all icons for the other pages */ @@ -227,7 +229,7 @@ static void get_icons(const char *uuid) count = plist_array_get_size(nrow); for (i = 0; i < count; i++) { plist_t node = plist_array_get_item(nrow, i); - get_icon_for_node(node, &page, sbc); + get_icon_for_node(node, &page, sbc, FALSE); } } if (page) { |