Skip to content

Commit

Permalink
Case-insensitive sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
macmade committed Oct 26, 2022
1 parent 0e3b873 commit baa2418
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Hot/Classes/ApplicationDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ class ApplicationDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate
self.sensorViewControllers = controllers
self.sensorsMenu.items = items.sorted
{
$0.title.compare( $1.title, options: .numeric, range: nil, locale: nil ) == .orderedAscending
$0.title.compare( $1.title, options: [ .numeric, .caseInsensitive ], range: nil, locale: nil ) == .orderedAscending
}
}

Expand Down
2 changes: 1 addition & 1 deletion Hot/Classes/SelectSensorsWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class SelectSensorsWindowController: NSWindowController, NSTableViewDeleg

self.arrayController.sortDescriptors =
[
NSSortDescriptor( key: "name", ascending: true ),
NSSortDescriptor( key: "name", ascending: true, selector: #selector( NSString.localizedCaseInsensitiveCompare( _: ) ) ),
]

self.windowOpenObserver = NotificationCenter.default.addObserver( forName: NSWindow.didBecomeKeyNotification, object: self.window, queue: nil )
Expand Down

0 comments on commit baa2418

Please sign in to comment.