From 1fe49871f18e35976ddb7c9ff29bd3984ad622a6 Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Tue, 22 Nov 2016 11:53:54 +0500 Subject: [PATCH] Proper sorting by server name. --- colorizer/colorizer_object.go | 6 +++--- ui/mainwindow_servers_sorting.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/colorizer/colorizer_object.go b/colorizer/colorizer_object.go index a785ed9..4223dcc 100644 --- a/colorizer/colorizer_object.go +++ b/colorizer/colorizer_object.go @@ -21,17 +21,17 @@ type Colorizer struct { colors map[string]string } -func (c *Colorizer) Clear(data string) string { +func (c *Colorizer) ClearFromMarkup(data string) string { var result string = "" data = html.EscapeString(data) - data_splitted := strings.Split(data, "^") + data_splitted := strings.Split(data, ">") if len(data_splitted) > 1 { for item := range data_splitted { if len(data_splitted[item]) > 0 { - result += data_splitted[item] + result += strings.Split(data_splitted[item], "<")[0] } } } else { diff --git a/ui/mainwindow_servers_sorting.go b/ui/mainwindow_servers_sorting.go index a41d402..b2e7cbd 100644 --- a/ui/mainwindow_servers_sorting.go +++ b/ui/mainwindow_servers_sorting.go @@ -25,8 +25,8 @@ func (m *MainWindow) sortServersByName(model *gtk.TreeModel, a *gtk.TreeIter, b return 0 } - name1 := ctx.Colorizer.Clear(name1_raw.GetString()) - name2 := ctx.Colorizer.Clear(name2_raw.GetString()) + name1 := ctx.Colorizer.ClearFromMarkup(name1_raw.GetString()) + name2 := ctx.Colorizer.ClearFromMarkup(name2_raw.GetString()) if name1 < name2 { return -1