Commit Graph

119 Commits

Author SHA1 Message Date
Allan Odgaard
dfa5bd779e Move path::info to OakFileBrowser
The code is about how to display items in the file browser (package, folder, alias, non-browsable volume, etc.) so it makes sense to limit the visibility of this API.
2018-07-30 22:37:35 +02:00
Allan Odgaard
c4179a22f7 Use path::is_directory in path::make_dir (instead of path::info) 2018-07-30 22:37:35 +02:00
Allan Odgaard
1d008057a4 Don’t call path::info() in path::is_directory
The path::info() function is a bit arcane and best avoided.
2018-07-30 22:37:35 +02:00
Allan Odgaard
42fa47a2fd Remove path::tag_data and let finderTagsFromData: be private 2018-07-08 18:20:17 +02:00
Allan Odgaard
11fa1841b3 Remove all code related to labels 2018-07-08 17:23:53 +02:00
Ronald Wampler
a31a985610 Add support for Finder tags instead of just one label color 2018-07-06 19:41:00 -04:00
Ronald Wampler
d1ecba2629 Use the FSRef API directly and delete fsref_t (10.9)
The textClipping file is saved as a binary plist on 10.11 and 10.12 (I could not verify 10.10) so we can eventually replace the use of FSRef here as well.
2017-05-31 21:58:31 +02:00
Ronald Wampler
a377b35bde Use OakMoveToTrash instead of FSMoveObjectToTrashSync (10.9) 2017-05-31 21:58:31 +02:00
Allan Odgaard
e669722ba2 Remove workaround for changed scandir prototype (10.8) 2016-10-22 23:27:15 +07:00
mathbunnyru
440414f96c Use nullptr in all C++ files instead of NULL
This brings us a bit of extra type safety, for example where an integer is expected, nullptr should be disallowed by the compiler (unlike NULL).
2016-10-22 21:40:14 +07:00
mathbunnyru
d6db299a8f Changed from NULL to nullptr in variadic templates for portability 2016-10-19 00:59:11 +03:00
mathbunnyru
1b4adf29e1 Fixed memory leak 2016-10-18 23:06:49 +02:00
mathbunnyru
284b5a3896 Slight perfomance improvements 2016-10-18 23:06:48 +02:00
mathbunnyru
08ad760d5e static_cast instead of c-style cast 2016-10-18 23:06:48 +02:00
Allan Odgaard
ee2aee21fa Use oak::has_prefix when comparing std::string against string literal 2016-10-17 11:03:41 +02:00
mathbunnyru
0b034f9a9d Use std::string’s compare to avoid searching beyond the prefix length 2016-10-17 10:50:18 +02:00
Allan Odgaard
2feb4a497a Use crash_reporter_info_t’s convenience constructor
Also change most ‘crashInfo’ variable names to just ‘info’ to be consistent.
2016-10-07 22:14:33 +02:00
Allan Odgaard
c5abbb755b Higher value from path::rank now means better match 2016-09-04 20:17:42 +02:00
Allan Odgaard
fe991f7b4b Improve error message for failure during save 2016-08-29 07:51:45 +02:00
Allan Odgaard
ce21cb8ea4 Make swap_and_unlink a private function 2016-08-29 07:50:43 +02:00
Allan Odgaard
f92a783a96 Introduce path::rename_or_copy
Unlike path::swap_and_unlink we do not try to use exchangedata() since support for this is missing from the upcoming AppleFileSystem, so it would seem to be somewhat deprecated.
2016-08-29 07:48:37 +02:00
Allan Odgaard
4ab38d3cfd Use the S_IRWX[UGO] constants to set file mode 2016-08-28 17:49:17 +02:00
Allan Odgaard
46fb745bbe Use perrorf when printing errors with dynamic strings
Also revise error messages to be more consistent.
2016-08-28 17:25:26 +02:00
Allan Odgaard
b0ba62451d Remove path::touch_tree
This was previously used by the software updater to prevent the “temp cleaner” from removing a downloaded update, incase the user took their time to click the “Install & Relaunch” button.
2016-08-28 09:14:43 +02:00
Allan Odgaard
dbdfa3c6af Add identifying information to perror output 2016-08-21 12:09:30 +02:00
Allan Odgaard
511e1d58a5 Remove old (crash reports) debug info 2016-07-16 13:14:43 +02:00
Ronald Wampler
e50dc57db0 Manually release GCD objects in C++ libraries
Since these are pure C++ libraries, they are not managed by ARC. This commit partially reverts 469fd74a7b.
2016-07-14 12:21:28 +02:00
Allan Odgaard
fdaf7ca732 Remove workaround for OS bug (10.8) 2016-06-22 20:44:41 +02:00
Allan Odgaard
469fd74a7b Rely on ARC to manage GCD types (10.8) 2016-06-22 20:43:28 +02:00
Allan Odgaard
8483826fae Always use '\0' as fill value when creating a string buffer 2016-06-18 10:34:08 +02:00
Allan Odgaard
068855b4e0 Disable deprecation warning for API working on resource forks
There doesn’t seem to be any replacement API for this so while the warning (when building with the 10.8 SDK) may serve as a reminder to update the code, the only possible update I can see is to drop support for reading text clippings.
2015-08-05 12:32:06 +02:00
Allan Odgaard
c75b89c048 Avoid temporary CFStringRef when creating file system CFURLRef 2015-08-05 12:29:24 +02:00
Allan Odgaard
82e5e14ae1 Remove unused function: is_trashed
The intent was to use this to decide if the proxy icon should be hidden but the API used by the function is deprecated on 10.8.
2015-08-05 12:26:17 +02:00
Allan Odgaard
b3478a2628 Use “modern” API to examine and resolve alias files 2015-08-05 12:23:35 +02:00
Allan Odgaard
34b374c185 Avoid two uses of FSRef (which is deprecated from 10.8) 2015-08-05 12:23:29 +02:00
Allan Odgaard
0b70563c73 Add crash log info to track down a bug
Crash is in CFStringGetLength called from _CFURLCreateWithFileSystemPath, so it appears that some sort of malformed string can find its way to this call.
2015-08-05 12:22:50 +02:00
Allan Odgaard
457969788e Use std::tuple for the OS version
This makes compatibility checks simpler, since we can use a single comparison operator.
2015-06-23 22:46:58 +02:00
Allan Odgaard
09dfe50051 Avoid taking the address of compound literals
Clang considers this to be an error, previously we disabled diagnostics for this case, but probably better to adapt our code.
2014-11-30 09:12:07 +07:00
Allan Odgaard
f34a8f28e0 Use CFURL API for getting and setting label color 2014-11-30 05:59:35 +07:00
Allan Odgaard
5b39bdc98b Remove double semi-colons at end of line 2014-11-14 10:21:34 +01:00
Allan Odgaard
a778f0b3da Combine std::set’s find and insert into a single operation 2014-11-10 17:11:31 +01:00
Allan Odgaard
be0804353c Remove path::trash API (unused)
This is based on FSRef which is deprecated starting with 10.8 so if we later need it then we likely would have to reimplement it.
2014-11-04 13:51:32 +01:00
Allan Odgaard
d59029b70c File flags were lost when saving to a non-local file system
This broke in 9b3dd8c.
2014-10-20 16:01:07 +02:00
Allan Odgaard
9b3dd8c0f4 Don’t use COPYFILE_METADATA with files on network drives
According to a user report this is causing TextMate to freeze. Reported to Apple as <rdar://17480649>.
2014-09-01 17:37:10 +02:00
Allan Odgaard
8782e2aa81 Fix bug with PATH variable containing trailing zero byte 2014-05-18 23:14:07 +07:00
Allan Odgaard
af3f4aaa33 Check result of most CF/CT ‘Create’ functions 2014-05-15 13:17:30 +07:00
Allan Odgaard
b8804d1164 Fix three memory leaks
One was per launch, one was per key event, and one was per (unique) line drawn.
2014-05-15 13:17:29 +07:00
Allan Odgaard
1f0e3db472 Remove trailing zeroes from numeric literals
I mainly dislike the trailing zeroes because CGFloat used to be a float but 1.0 is a double (1.0f would be a float). So better to under-specify and let the compiler figure out the proper type.
2014-04-14 14:26:52 +07:00
Allan Odgaard
39b94e6ac3 Harmonize whitespace and add trailing newline 2014-04-14 14:26:52 +07:00
Allan Odgaard
db13d4c1f9 Use std::string::back() instead of operator[] with size()-1 2014-03-31 08:27:18 +07:00