Full access should be synchronized, otherwise rapid access to the same
path from different threads will cause crashes.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Include entitlement granted user folders in the permission check, so
that if the file or folder is nested under one of them, it allocates a
static permission object, rather than querying the list of configured
paths every time. This also prevents the player from popping open the
path grant / suggester dialog every time a default path is in the file
set listed, which should provide some relief to most users.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The crash was because we weren't copying the results array before
iterating over it, and the deadlock was because this was forced to go
through the main thread, rather than going through its calling thread,
which could lock up if the main thread was busy working with the Sandbox
Broker object.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
The Path Suggester will now automatically open when new files are added
to the playlist and a given path is not in the sandbox settings. It will
also pop for both the File Tree and MIDI SoundFont path configuration
settings being changed.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Synchronize storage access to main thread only, to prevent enumeration
from hitting a case of the main thread writing to the storage.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Refine the global variable usage, eliminating double underscore prefixes
and trusting that static global variables will exist in the object where
the class was created. Got rid of that nasty NSApplication extension
hack that was previously in use.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Allow opening directory URLs as-is, rather than treating them like
files. Return the full path if the caller requests opening on a
directory.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
Sandbox Broker now returns a handle to the exact path object that was
retained by the caller, so it will be released correctly, regardless of
what happens to the list of bookmarked paths.
Also refined the bookmark path comparison function. For existing paths,
it will find the first match. For new paths, it will prefer the longest
path instead, to try to find the deepest matching bookmark.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>
- Implemented App Sandboxing in a more friendly manner.
- All sandboxed paths will need to be set in Preferences. Set as loose
a path as you want. The shortest path will be preferred.
- Removed Last.fm client support, as it was non-functional by now,
unfortunately. Maybe something better can come in the future.
- Added support for insecure SSL to the HTTP/S reader, in case anyone
needs streams which are "protected" by self-signed or expired
certificates, without having to futz around by adding certificates to
the system settings, especially for expired certificates that can't
otherwise be dodged this way.
If you want to import your old playlists to the new version, copy the
contents of `~/Library/Application Support/Cog` to the alternate sandbox
path: `~/Library/Containers/org.cogx.cog/Data/Library/Application `...
...continued...`Support/Cog`. The preferences file will migrate to the
new version automatically.
Signed-off-by: Christopher Snowhill <kode54@gmail.com>