DNS filters: proper sort + no cell selection + copy cell value

This commit is contained in:
relikd
2020-04-18 00:39:59 +02:00
parent 70508c1325
commit 245bb46e4f
4 changed files with 40 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ class DBWrapper {
}
func dataF_list(_ filter: FilterOptions) -> [String] {
Q.sync() { dataF.compactMap { $1.contains(filter) ? $0 : nil } }
Q.sync() { dataF.compactMap { $1.contains(filter) ? $0 : nil } }.sorted()
}
func dataF_counts() -> (blocked: Int, ignored: Int) {

View File

@@ -266,7 +266,7 @@ extension SQLiteDatabase {
// MARK: read
func loadFilters() -> [String : FilterOptions]? {
try? run(sql: "SELECT domain, opt FROM filter ORDER BY domain ASC;", bind: nil) {
try? run(sql: "SELECT domain, opt FROM filter;", bind: nil) {
allRowsKeyed($0) {
(key: readText($0, 0) ?? "",
value: FilterOptions(rawValue: sqlite3_column_int($0, 1)))