We only need this in one location, and it’s easy to handle at that call-site, rather than add complexity to something which is already a little opaque.
Changes:
- Use NSURLSession and OakDownloadManager to download updates (instead of libcurl).
- Use NSFileManager’s replaceItemAtURL:… to update the application bundle (instead of custom code).
- Use NSTask to relaunch the application (instead of fork/exec).
- Use the same window for the initial prompt, and for showing download progress.
- Show estimated time remaining in download window (via NSProgress).
- Allow retrying downloads on various forms of failures.
- Don’t require xib file for download window.
Regressions:
- We no longer support updating the application as root: I tried using an authorized NSFileManager instance, but it did not work for me, and the previous code we used for this was using legacy APIs.
We now use kUserDefaultsLastSoftwareUpdateCheckKey to obtain “last check” and observe user defaults for changes.
Also eliminate local mirroring of software update controller properties and other minor tweaks.
We changed the type of file browser state from NSDictionary → NSData in 4a1e9113f3.
While we do check the type of the object read, previous versions did not, so if the user runs latest version of TextMate, and then downgrades, they will have state that cannot be read by the older version of TextMate (and will cause exception during launch, incase file browser state is restored).
Several places already used ‘token’ as the name for the result from NSNotificationCenter’s addObserver:… so this change is to be consistent.
While ‘token’ is less meaningful than ‘observerId’, the variable is only used with NSNotificationCenter API where the context makes it clear.
This is not made clear from the documentation, however, the documentation does state that the token will be strongly held by the notification center, until the notification is removed, therefore it is safe to only keep a weak reference to the token (even if the implementation should change).
This partially reverts 6ffd0f2e92
While we do not support transparent themes per se, we still use the alpha colors and thus would previously fill the background using alpha, into a layer that we hadn’t previously cleared.
This does change ranking of the wildcard scope selector, as incase of a wildcard match, the old code did not change the rank, so it would be up the caller, which was 1 for bundle item matching but 0 for settings and theme matching.
This is to postpone constructing the view: It’s probably not costly to construct it before we need it, but everything adds up, and it just feels proper to avoid constructing the views of view controllers until as late as possible.
We now add some bottom padding to the containing grid view, as it may be oblivious to alignment rectangles, and would therefore snap to the bottom of the checkbox label’s alignment rectangle, clipping anything drawn outside of it.
This does completely remove support for transparent themes, but any recent version of macOS would not support it anyway due to layer-backed views.
The crash resulting from setting opaque is because of recursion: After session restore, the window will calculate shadow, this triggers a “user defaults did change” notification, which updates theme of text view, which sets opaque, which re-calculates shadow and tries to recursively obtain a non-recursive mutex.