Take area out of PoolGroup

Retain in Pool only, do not contribute to group keying.
This commit is contained in:
Davide De Rosa 2021-01-03 15:01:08 +01:00
parent 34de924c4a
commit 038281b19c
2 changed files with 4 additions and 20 deletions

View File

@ -312,10 +312,7 @@ class StatusMenu: NSObject {
item.indentationLevel = 1
for group in category.groups.sorted() {
var title = group.localizedCountry
if let area = group.area?.uppercased() {
title = "\(title) - \(area)"
}
let title = group.localizedCountry
let itemGroup = NSMenuItem(title: title, action: #selector(connectToPool(_:)), keyEquivalent: "")
itemGroup.image = group.logo

View File

@ -28,24 +28,14 @@ import Foundation
public class PoolGroup: Codable, Hashable, Comparable, CustomStringConvertible {
public let country: String
public let area: String?
public let pools: [Pool]
private var id: String {
var id = country
if let area = area {
id += area
}
return id
return country
}
private var localizedId: String {
var localizedId = Utils.localizedCountry(country)
if let area = area {
localizedId += area
}
return localizedId
return Utils.localizedCountry(country)
}
// MARK: Equatable
@ -69,7 +59,7 @@ public class PoolGroup: Codable, Hashable, Comparable, CustomStringConvertible {
// MARK: CustomStringConvertible
public var description: String {
return "{\(country), \(area ?? "--")}"
return country
}
}
@ -84,9 +74,6 @@ extension PoolGroup {
var components: [String] = []
components.append(category.name)
components.append(country)
if let area = area {
components.append(area)
}
return components.joined(separator: "/")
}
}