50 Commits

Author SHA1 Message Date
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
Allan Odgaard
71be61cbbb Enable ARC by default
We now explicitly disable it for targets that hasn’t yet been upgraded to ARC. This way, it’s easier to get an overview of which targets hasn’t yet been upgraded and ensures new targets has ARC enabled.
2012-12-19 19:42:36 +01:00
Allan Odgaard
0311f10974 Fix syntax error in debug line 2012-12-16 21:27:06 +01:00
Allan Odgaard
0cea361b00 Explicit timer invalidation 2012-09-22 13:23:41 +02:00
Allan Odgaard
56b96e7f07 ARC: Update OakFoundation framework 2012-09-22 13:23:41 +02:00
Allan Odgaard
8fd7b82cbd Remove CocoaSTL.h include 2012-09-20 12:22:20 +02:00
Jacob Bandes-Storch
dfdde3283f Use 64-bit: explicit visibility where required 2012-08-28 21:32:47 +02:00
Allan Odgaard
621c821689 Don’t register existing value transformers
It can happen that we register the same value transformer twice, e.g. if we register it in an initialize method (since these are not guaranteed to only be called once).

This isn’t a problem per se, but there is no reason to create the new instance.
2012-08-21 18:21:40 +02:00
Allan Odgaard
a09b58422f Fix releasing of array
Previously we used ‘dealloc’ to release the array, which is wrong.

Since instances of OakStringListTransformer is normally never released this bug wasn’t affecting anything. But since we have a dealloc, it should be correct.
2012-08-21 18:21:40 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00