diff options
author | Max Kellermann <max@duempel.org> | 2009-03-14 14:20:04 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-14 14:20:04 +0100 |
commit | 24da9410fa0d343acf35a47afcb666398d032aea (patch) | |
tree | ed3e0675a750dc903cedf83641db972865d4f018 /src | |
parent | dd67992a0c403ff23b071fe9b1e312cfaa4bd924 (diff) | |
download | mpd-24da9410fa0d343acf35a47afcb666398d032aea.tar.gz mpd-24da9410fa0d343acf35a47afcb666398d032aea.tar.xz mpd-24da9410fa0d343acf35a47afcb666398d032aea.zip |
command: use sticker_song_get() instead of sticker_song_list_values()
Diffstat (limited to '')
-rw-r--r-- | src/command.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/command.c b/src/command.c index 535c3638c..2c7f2b3d4 100644 --- a/src/command.c +++ b/src/command.c @@ -1455,11 +1455,12 @@ handle_idle(struct client *client, } #ifdef ENABLE_SQLITE -static void print_sticker(GString *name, GString *value, - struct client *client) +static void +print_sticker(const char *name, const char *value, gpointer data) { - client_printf(client, "sticker: %s=%s\n", - (char *)name, (char *)value); + struct client *client = data; + + client_printf(client, "sticker: %s=%s\n", name, value); } static enum command_return @@ -1488,17 +1489,15 @@ handle_sticker_song(struct client *client, int argc, char *argv[]) return COMMAND_RETURN_OK; } else if (argc == 4 && strcmp(argv[1], "list") == 0) { - GHashTable *hash; - - hash = sticker_song_list_values(song); - if (NULL == hash) { + struct sticker *sticker = sticker_song_get(song); + if (NULL == sticker) { command_error(client, ACK_ERROR_NO_EXIST, "no stickers found"); return COMMAND_RETURN_ERROR; } - g_hash_table_foreach(hash, (GHFunc)print_sticker, - client); - g_hash_table_destroy(hash); + + sticker_foreach(sticker, print_sticker, client); + sticker_free(sticker); return COMMAND_RETURN_OK; } else if (argc == 6 && strcmp(argv[1], "set") == 0) { |