diff options
author | Martin Szulecki | 2009-12-17 18:27:37 +0100 |
---|---|---|
committer | Nikias Bassen | 2009-12-17 18:27:37 +0100 |
commit | 3bdf2556cb9c19fb4ee332f272bec74d73caf5d3 (patch) | |
tree | 44a385931823247fd70df7e3e91e321838ab8bba /src | |
parent | ad12235cf974e5c2b5fe7caf8ff95f784a05ec20 (diff) | |
download | sbmanager-3bdf2556cb9c19fb4ee332f272bec74d73caf5d3.tar.gz sbmanager-3bdf2556cb9c19fb4ee332f272bec74d73caf5d3.tar.bz2 |
Name saved icon filenames by bundle and load textures asynchronously
Signed-off-by: Nikias Bassen <nikias@gmx.li>
Diffstat (limited to 'src')
-rw-r--r-- | src/sbmanager.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/sbmanager.c b/src/sbmanager.c index ceeafab..e814396 100644 --- a/src/sbmanager.c +++ b/src/sbmanager.c @@ -107,14 +107,19 @@ static void get_icon_for_node(plist_t node, GList **list, sbservices_client_t sb valuenode = plist_dict_get_item(node, "displayIdentifier"); if (valuenode && (plist_get_node_type(valuenode) == PLIST_STRING)) { char *value = NULL; + char *icon_filename = NULL; plist_get_string_val(valuenode, &value); printf("retrieving icon for '%s'\n", value); if ((sbservices_get_icon_pngdata(sbc, value, &png, &pngsize) == SBSERVICES_E_SUCCESS) && (pngsize > 0)) { - FILE *f = fopen("/tmp/temp.png", "w"); + icon_filename = g_strdup_printf("/tmp/%s.png", value); + FILE *f = fopen(icon_filename, "w"); GError *err = NULL; fwrite(png, 1, pngsize, f); fclose(f); - ClutterActor *actor = clutter_texture_new_from_file("/tmp/temp.png", &err); + ClutterActor *actor = clutter_texture_new(); + clutter_texture_set_load_async(CLUTTER_TEXTURE(actor), TRUE); + clutter_texture_set_from_file(CLUTTER_TEXTURE(actor), icon_filename, &err); + g_free(icon_filename); if (actor) { plist_t nn = plist_dict_get_item(node, "displayName"); di = g_new0(SBItem, 1); @@ -596,7 +601,9 @@ int main(int argc, char **argv) /* dock background */ GError *err = NULL; - actor = clutter_texture_new_from_file(BGPIC, &err); + actor = clutter_texture_new(); + clutter_texture_set_load_async(CLUTTER_TEXTURE(actor), TRUE); + clutter_texture_set_from_file(CLUTTER_TEXTURE(actor), BGPIC, &err); if (err) { g_error_free(err); } |