New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File object enhancements #1180
File object enhancements #1180
Conversation
This allows any future operations that depend on UTI to grab it from memory instead of (potentially) hitting the disk again.
Other changes: * Unused variables/statements removed * Code specific to preference panes removed (It was never hit anyway) * Attempts to `initWithContentsOfFile:` removed (It was never getting hit - Quick Look takes care of it) * Special case code from plug-ins is now tried first (and based on UTI instead of extension) close #1149
- Apply DRY on those that do the same thing. The specific check for 'fold' was dropped because it's a standard type. - Replace some UTI constants.
I don't want to know what would happen in case the file wasn't on the same drive than ~/.Trash… Hopefully it looks it's only used by the update code when moving the old QS app to the Trash.
Conflicts: Quicksilver/Code-QuickStepCore/QSObject_FileHandling.h
Provide accessors for `-isPackage`, `-isAlias`, `-fileExtension`, and `-fileUTI`. Also changes `-isApplication` & `-isFolder` to use the cached LSItemInfoRecord.
You should never touch an NSError object before checking that an error was triggered, in case the callee decides to set the pointer to garbage.
This would force a restart in case a plugin declares one of those and gets loaded late.
This is a special case for pref panes that draws the pane's icon in the old-style preference pane template. Now that we have _real_ previewing for those, that's useless ;-).
Conflicts: Quicksilver/Code-QuickStepCore/QSObject_FileHandling.m
If we start assigning UTIs to all objects, this method could potentially be expanded to evaluate everything (and moved to the main QSObject code).
Users will have the ability to override this by setting a hidden default.
Developers that aren't on 10.8 will be missing this macro.
There's another potential area for optimization I noticed while resolving conflicts and looking through the changes. |
Be aware that 70d34ac already changes the method. I don't know if it's what NSWorkspace uses, and I still haven't checked how it handles trashing files from network drives. In fact, I was keen to have that checked before, in order to cut the amount of code churn, but that's not really a problem. |
Yeah, but I didn't think anyone was disputing that change.
It makes the sound, but nothing happens. So that answers that. I guess we need another way. |
* only play the sound if at least one file was trashed successfully * if any files couldn't be trashed, display a notification listing them
OK, I've updated the Trash action. Take a look. |
Some small issues with this:
|
This can be a bit slower than the old way if a lot of file objects don't have infoRecord cached, but it's not terrible (about 0.1s), and once the info is cached, it's about 10 times faster than the previous code. This is a proof-of-concept. There are probably many other validation methods we could simplify.
Also, remove the now unused universalApps code. close #1184
OK, the commit to add all applications to “Open With…” is in. Let me know if there’s anything else. |
There's something in here (or possible somewhere else between ß70 and here) that breaks right arrowing into text files. I guess it's most likely here since this is where the fiddling with |
OK, here's the problem: Caught you @tiennou ;-) Seems like the For @tiennou And on the matter of that pull request: what if there's a method that say… returns 'NO' if there is an error, or if there's nothing to do or some other reason. For example, take a look at: https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html This method returns |
Aaaand…. one more thing :) I don't think that NSLog should be there at all. Try right arrowing into any file that shouldn't be right arrowed into (e.g. a .zip file or .jpg etc.) and watch your console. Even if you right arrow into a text file, you still get that error log :( |
OK, last comment, I promise… :) Just wrap lines 402 - 426 in an Should that method be |
I can take care of that.
For what it's worth, I had some weird problems when changing the validation around and it was because I was using So sounds like two votes for |
Awesome, cheers :) On 10 November 2012 14:05, Rob McBroom notifications@github.com wrote:
|
Two new commits. |
Cool. I'll run with it a little longer incase anything else crops up |
Sorry guys :-(. @skurfer your fix looks good. Another quick thing : how do you feel about keeping |
I think that's what On 11 November 2012 13:17, Etienne Samson notifications@github.com wrote:
|
Worth testing to find out. You can see I'm looking at |
Yeah, the old tests look way too fishy for me. Testing using ß70, it looks to me |
I've confirmed that
Applications are packages, so no need to test |
Looking for directories that aren't packages is a pretty common task.
Fixed the conflict and pushed to master. Hopefully I got the merge conflict right ;-) |
Oh yeah - ß71 anyone? :) |
Heh. I thought this is all we were waiting on, but now there's some tempting stuff out there. :-) Probably take me all day just to add this one pull to the change log. |
This brings together one of @tiennou's branches with one of mine.
He made a number of improvements to the way file objects are dealt with, including caching frequently used attributes to avoid repeated disk access. Both of us have removed a lot of unused code. I've also rebased it against the current master, so it shouldn't conflict.
My changes were mostly about allowing more control over preview icons. See #1177 for details. The one difference from that is I've restored the old default behavior, so previews will be generated for everything. Users have the option to control previews via a hidden preference. To test, try something like
This also includes all the commits from #1119 except for 16cb992, as it sounds like that was unresolved.