59 Commits

Author SHA1 Message Date
Allan Odgaard
94d3b9b670 Remove old build files 2021-02-15 16:01:50 +01:00
Allan Odgaard
f7d765ba0e Add build files (for new build system) 2021-02-15 16:01:50 +01:00
Allan Odgaard
c93030b385 Remove all debug output from custom log macros
This provided value during early development, but has been unused for years, and it would generate too much noise if converted to os_log.

So better to just remove it all and add os_log statements as needed.
2020-06-05 21:22:50 +07:00
Allan Odgaard
4ec10c0923 Don’t annotate types and classes with PUBLIC
This was required when we linked each framework as its own thing, which we do not do anymore, and if we do go back to this system, we can simply have symbols public by default.
2020-06-05 21:22:50 +07:00
Allan Odgaard
569dc9a198 Make token used in notification block weak as it retains the block
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).
2020-05-22 21:48:09 +07:00
Allan Odgaard
ad1cc8abd8 Deliver all NSUserDefaultsDidChangeNotification in main queue
This is easier than ensuring that we do not update user defaults from a background thread.
2020-05-14 09:52:38 +07:00
Allan Odgaard
49bbb8296a Turn OakHistortyList into a generic class 2020-04-30 13:28:24 +07:00
Allan Odgaard
dedb182932 Remove humanReadableTimeElapsed NSDate category extension method
We still need this code when running on macOS before 10.15, but we only use the method in one place, so we have inlined the code.
2020-04-29 08:02:02 +07:00
Allan Odgaard
b514114ec7 Access most system singletons using dot syntax
These are identified by having a prefix of shared, default, or standard in the class method.
2020-04-23 12:25:11 +07:00
Allan Odgaard
dae1103728 Update LINK declarations 2019-07-16 19:42:29 +02:00
Allan Odgaard
7b4accc9e8 Allow creating OakHistoryList with a user defaults fallback key 2018-10-28 10:15:56 +07:00
Allan Odgaard
2c9a44e23c Refactor how we initialize OakHistoryList 2018-10-28 10:15:56 +07:00
Allan Odgaard
581c201008 Remove most code related to old file browser 2018-10-28 10:15:56 +07:00
Allan Odgaard
40a14995f6 Call fileSystemRepresentation directly on NSURL (10.9) 2018-06-17 17:14:47 +02:00
Allan Odgaard
ae470335a2 Remove dependency on ‘ns’ framework
Since the ‘ns’ framework depends on OakFoundation this was a circular dependency and only sort of worked because ‘ns’ was not listed as a link target.
2018-06-12 00:04:01 +02:00
Allan Odgaard
a843a02aa1 Revert "Specify ‘ns’ as a (link) dependency"
This reverts commit 75e8723e64.
2018-04-25 21:43:51 +07:00
Allan Odgaard
75e8723e64 Specify ‘ns’ as a (link) dependency
See http://lists.macromates.com/textmate/2017-November/040458.html
2017-11-16 10:06:39 +07:00
Allan Odgaard
ed6be1b35e Remove var-args constructor from string list transformer
Instead add constructor that takes a dictionary so that it can be used with values that are not consecutive and starting from zero.
2017-10-02 20:53:05 +02:00
Ronald Wampler
b9665fa44e Introduce OakMoveToTrash and make it accessible only to C++
This is just a C++ wrapper around the Cocoa API for moving a file to trash.
2017-05-31 21:58:31 +02:00
Ronald Wampler
9feef86b16 Remove workaround for trashItemAtURL:resultingItemURL:error (10.9) 2017-05-31 10:03:41 +02:00
Allan Odgaard
f2013e948f Remove OakTimer.{mm,h} 2016-10-01 09:03:25 +02:00
Allan Odgaard
8709ee8f01 Make it obvious that our code is workaround for 10.8 2016-08-28 09:13:27 +02:00
Allan Odgaard
417193e089 Update link dependencies for all targets
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.

The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.

Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
2016-05-07 13:00:55 +02:00
Allan Odgaard
975fd70779 Re-encode redundantly encoded multi-byte sequences
If our buffer contained such sequences then an exception could be thrown when creating an NSString representation, for example copying to the system clipboard or displaying search results in the UI.
2015-08-30 10:53:24 +02:00
Ronald Wampler
67184816be fixup! Remove NSString existAtPath category method 2014-11-10 20:51:17 +01:00
Ronald Wampler
f0c7a2f564 Remove unused includes 2014-11-10 09:28:06 -05:00
Ronald Wampler
c1b73ac9c0 Remove NSString existAtPath category method
Also rename NSString category from "Path" to "Additions".
2014-11-10 09:28:06 -05:00
Ronald Wampler
ecd3280a4a Remove NSString isDirectory category method 2014-11-10 09:28:06 -05:00
Allan Odgaard
7aea556533 Remove custom NSArray category
We only use the firstObject method which has existed since OS 10.6 (though wasn’t mentioned until the 10.9 FoundationKit release notes).
2014-11-05 10:58:29 +01:00
Allan Odgaard
2f1c4c05c4 Do not use ‘timeIntervalSinceNow’ with dates in the past
We previously negated the result but now we instead ask for [[NSDate date] timeIntervalSinceDate:startDate].
2014-08-21 16:07:23 +02:00
Allan Odgaard
39b94e6ac3 Harmonize whitespace and add trailing newline 2014-04-14 14:26:52 +07:00
Allan Odgaard
96de950ed1 Return initializer list instead of using std::make_pair (C++11) 2014-04-06 19:36:09 +07:00
Allan Odgaard
5f69ef31c7 Don’t use NS prefix for custom functions 2014-03-28 19:31:14 +07:00
Allan Odgaard
1e11a30a53 Remove redundant storage keywords for @property
These were required prior to the new 64 bit run-time.
2014-03-05 16:39:54 +07:00
Ronald Wampler
8711228f9a Add safeObjectAtIndex to NSArray
This is defined in OakTabBarView as a static method, but it could be useful elsewhere.
2013-12-22 23:30:29 -05:00
Ronald Wampler
2f39a8c012 Remove unneccessary #import statements 2013-12-22 23:30:29 -05:00
Allan Odgaard
06f349507a Add a “did wrap” boolean to the OakFindProtocol API
This informs the “server” that searching wrapped around to find the match.
2013-07-23 22:45:52 +02:00
Allan Odgaard
97c9a20f6e Use localizedStandardCompare:
This is instead of our custom displayNameCompare: which has now been removed.
2013-04-21 12:20:07 +07:00
Allan Odgaard
b280e776b3 Make OakFindServerProtocol conform to NSObject 2013-03-27 17:06:27 +01:00
Allan Odgaard
02f32977f2 Introduce Replace [and Find] in find protocol
Previously there was a single replace action and the options would indicate if it was a “replace all”, this mimics the “find” (which can be a “find all”) but since single match replacement is somewhat different than a “replace all”, as the former may need to know the captures from a previous find action, it makes sense to factor out these things as different actions.
2013-03-07 16:21:47 +01:00
Allan Odgaard
7a45f6949a Don’t use NSFileManager to trash symlinks
NSFileManager will resolve the link and move the original file to trash, which is generally not desired (or expected).
2013-02-20 13:04:20 +01:00
Allan Odgaard
4a03284979 fixup! Handle case changes on insensitive file systems 2013-02-06 22:58:40 +01:00
Allan Odgaard
22465873ac Handle case changes on insensitive file systems
NSFileManager only provide a move function which fails with “file exists” if we make case changes on a case-insensitive file system, therefor we now explicitly test for that error and use <x-man-page://2/rename> if the source and destination refer to the same file, but the path differ.

Fixes #769.
2013-02-06 14:50:05 +01:00
Allan Odgaard
a55e485f56 Reference ‘self’ instead of asking for singleton
In theory we could be calling this method on the non-default file manager.
2013-02-06 14:50:05 +01:00
Allan Odgaard
adb2ed7b64 Use sel_getName() instead of typecast 2013-01-29 15:28:22 +01:00
Allan Odgaard
8821794e3e Remove unused category methods
Long-term I want to get rid of all category methods. Adding methods to system classes is bad.
2013-01-25 11:01:56 +01:00
Allan Odgaard
5799a7c4c4 Add compatibility code for 10.7 2013-01-22 19:23:16 +01:00
Allan Odgaard
47fa0f040c Use Objective-C literals for YES/NO 2013-01-02 01:46:48 +01:00
Allan Odgaard
8e937a7141 Require explicit import of OakFindProtocol.h 2013-01-02 01:46:48 +01:00
Allan Odgaard
ba274c160f Improve “performSelector: may leak” workaround 2012-12-28 02:47:19 +01:00