This is only to ensure everyone goes through the class method, which is easier to search for (constructing an FSItem from a URL is a little expensive so we wish to get rid of it where possible).
Since the created image is a “dumb” object that can’t provoke redrawing itself, we require that SCM info is already cached for the repository containing the file for which we are creating an image. If not, there will be no SCM badge, so most users of this API should setup their own SCM info and recreate the image when SCM status changes.
When requesting SCM info for a path, we now always return the cached info for the first parent of the path, but if the first parent of the path is not the direct parent, we do a more thorough search (which involve disk access) in a background thread.
The latter is required because we may have nested repositories. E.g. asking for SCM info for /path/to/project/submodule/file will initially return the root project’s cached SCM info (if the submodule info hasn’t yet been added to the cache) but will then later invoke the callback with the submodule’s SCM info.
The FFWindowController class is an implementation detail where the Find class is the public class, so depending on the latter should make the code safe against potential rewrites.
This is instead of setting an environment variable. Since there already is a user defaults setting for whether or not we want an untitled document created at startup, it seems nicer to have mate set that, instead of effectively introducing an alias for the setting.
This is to be used when the application is in the background. Rather than completely disable updates, it might perhaps be better simply to increase the delay used to throttle updates.
Also change SCM implementation so that it doesn’t use objects with automatic storage, as the objects may be accessed from threads, which may run after objects with automatic storage has been destroyed.
Previously we used our own icon image class which support SCM status, custom images for known file types, and more. This is however is unnecessary, as we know the Open With menu contains only applications, and each should use their standard icon.
This should also fix issue #510, although the issue was never diagnosed beyond git stalling while trying to get SCM status for the application icons in this menu.
Previously it would hold onto the documents shown, which is not only wasteful, but could mean that it would retain a no longer used untitled document (and thus occupying an untitled document counter).
This is for attr.project.XXX and attr.scm.XXX, although the latter is also provided by scm::info_t.
With this commit, the file::path_attributes function no longer collect this information.
This won’t perform any disk access on main thread. The previous API would check for the SCM-metadata directories on the main thread and also obtain the initial status and branch during creation.