diff options
Diffstat (limited to 'src/sj-main.c')
-rw-r--r-- | src/sj-main.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/sj-main.c b/src/sj-main.c index 78f2159..4305b5c 100644 --- a/src/sj-main.c +++ b/src/sj-main.c @@ -783,6 +783,36 @@ static void selected_album_changed (GtkTreeSelection *selection, } /** + * Utility function to format label string for multiple_album_dialog + */ +static GString* format_label_text (GList* labels) +{ + int count; + GString *label_text; + + if (labels == NULL) + return NULL; + + label_text = g_string_new (NULL); + count = g_list_length (labels); + while (count > 2) { + g_string_append (label_text, ((LabelDetails*)labels->data)->name); + g_string_append (label_text, ", "); + labels = labels->next; + count--; + } + + if (count > 1) { + g_string_append (label_text, ((LabelDetails*)labels->data)->name); + g_string_append (label_text, " & "); + } + + g_string_append (label_text, ((LabelDetails*)labels->data)->name); + + return label_text; +} + +/** * Utility function for when there are more than one albums available */ AlbumDetails* multiple_album_dialog(GList *albums) |