Proper sorting by server name.
This commit is contained in:
parent
4f5bf90dbe
commit
1fe49871f1
@ -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 {
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user