From 454b26668bb7ad50ee6bb375eceddac0de9124d9 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 15 Oct 2013 23:06:48 +0200 Subject: gtkui: multiline metadata fix --- plugins/gtkui/mainplaylist.c | 16 ++++++++++++++++ plugins/gtkui/plcommon.c | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/plugins/gtkui/mainplaylist.c b/plugins/gtkui/mainplaylist.c index e1ad1d2d..ec70c227 100644 --- a/plugins/gtkui/mainplaylist.c +++ b/plugins/gtkui/mainplaylist.c @@ -171,6 +171,14 @@ void main_draw_group_title (DdbListview *listview, cairo_t *drawable, DdbListvie if (group_by_str && group_by_str[0]) { char str[1024]; deadbeef->pl_format_title ((DB_playItem_t *)it, -1, str, sizeof (str), -1, group_by_str); + char *lb = strchr (str, '\r'); + if (lb) { + *lb = 0; + } + lb = strchr (str, '\n'); + if (lb) { + *lb = 0; + } int theming = !gtkui_override_listview_colors (); if (theming) { GdkColor *clr = >k_widget_get_style(theme_treeview)->fg[GTK_STATE_NORMAL]; @@ -214,6 +222,14 @@ main_get_group (DdbListviewIter it, char *str, int size) { return -1; } deadbeef->pl_format_title ((DB_playItem_t *)it, -1, str, size, -1, group_by_str); + char *lb = strchr (str, '\r'); + if (lb) { + *lb = 0; + } + lb = strchr (str, '\n'); + if (lb) { + *lb = 0; + } return 0; } diff --git a/plugins/gtkui/plcommon.c b/plugins/gtkui/plcommon.c index 795bb9a3..f2cacd80 100644 --- a/plugins/gtkui/plcommon.c +++ b/plugins/gtkui/plcommon.c @@ -280,6 +280,14 @@ void draw_column_data (DdbListview *listview, cairo_t *cr, DdbListviewIter it, D else if (it) { char text[1024]; deadbeef->pl_format_title (it, -1, text, sizeof (text), cinf->id, cinf->format); + char *lb = strchr (text, '\r'); + if (lb) { + *lb = 0; + } + lb = strchr (text, '\n'); + if (lb) { + *lb = 0; + } GdkColor *color = NULL; if (theming) { if (deadbeef->pl_is_selected (it)) { -- cgit v1.2.3