Skip to content
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

Merged
merged 42 commits into from Nov 13, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d016bd6
don't blindly create a new instance of NSFileManager for every file
skurfer Oct 15, 2012
0d7a299
store the UTI with the object
skurfer Oct 15, 2012
5836b06
only generate previews for images, video, music, and PDFs
skurfer Oct 16, 2012
f3b6685
DRY.
tiennou Sep 16, 2012
8026649
Group all UTI-related functions in QSUTI.h/m.
tiennou Sep 16, 2012
5bfe8cc
Use a thread to scan when clicking things in the interface.
tiennou Sep 16, 2012
9aff818
Fix an issue with resolving an alias to a non-existent file.
tiennou Sep 16, 2012
70d34ac
Use FSPathMoveObjectToTrashSync for moving files to the Trash.
tiennou Sep 16, 2012
1e777cb
Catch exception when trying to instantiate instances.
tiennou Sep 14, 2012
e108e70
Remove unused stuff + cleanup.
skurfer Oct 17, 2012
a6794f5
Use the object's cache to store its LSItemInfoRecord info.
tiennou Sep 16, 2012
e17d52d
Use the new accessors.
tiennou Sep 16, 2012
c09deab
Fix usage of NSError.
tiennou Sep 16, 2012
30ac2da
Remove static bundlePresetChildren cache.
tiennou Sep 16, 2012
49d8b81
Remove unused code.
tiennou Sep 16, 2012
52dd7aa
Merge branch 'filesystem' into file-uti
skurfer Oct 17, 2012
1efc849
use new method to get the UTI
skurfer Oct 17, 2012
9c4c4d0
add a new method to see if a file object conforms to a UTI
skurfer Oct 17, 2012
170bfbc
use the new `conformsToUTI:` method when testing UTIs
skurfer Oct 17, 2012
8286bce
remove more (unused) special code for Preference Panes
skurfer Oct 17, 2012
d9a5bb9
load previews for everything by default (previous behavior)
skurfer Oct 17, 2012
c037062
Log the error loading message, and don't bother with the stack trace.
tiennou Sep 19, 2012
a938bd1
Use the AvailabilityMacros for this.
tiennou Sep 23, 2012
b9fbc35
use the literal value for OS X 10.8 instead of the macro
skurfer Oct 17, 2012
a37c253
Revert "use the new `conformsToUTI:` method when testing UTIs"
skurfer Oct 19, 2012
419a1d9
Revert "add a new method to see if a file object conforms to a UTI"
skurfer Oct 19, 2012
fcbdcb6
use new method to get the UTI (again)
skurfer Oct 25, 2012
6570ce9
Use NSWorkspace method instead.
tiennou Sep 25, 2012
b12bfc2
determine if the file is on a local volume (and cache the answer in t…
skurfer Oct 26, 2012
d9ef123
perform validation for the “Move to Trash” action
skurfer Oct 26, 2012
89922a1
update the Open action to use the cached infoRecord
skurfer Oct 31, 2012
98e79a7
add the extension last (in case it's `nil`)
skurfer Oct 31, 2012
f5c80e7
rearrange the precedence when opening files
skurfer Oct 31, 2012
8689460
safer handling of values that could be `nil`
skurfer Nov 2, 2012
89a3d91
deal with failure in the Trash action
skurfer Nov 6, 2012
0d1672a
check the cache in infoRecord first to avoid going to disk if possible
skurfer Nov 9, 2012
e2ea085
allow for the possibility that more than one icon provider is availab…
skurfer Nov 9, 2012
29eee13
simplify validation using the new infoRecord-based methods
skurfer Nov 9, 2012
4874f70
show all applications (in the catalog) for the Open With… action
skurfer Nov 9, 2012
03752f9
isFolder → isDirectory
skurfer Nov 10, 2012
6495cd9
check that the object is a directory before treating it like one
skurfer Nov 10, 2012
bd5163a
add an `isFolder` method for file objects
skurfer Nov 12, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Quicksilver/Code-QuickStepCore/QSCatalogEntry.m
Expand Up @@ -211,7 +211,8 @@ - (void)setEnabled:(BOOL)enabled {
[[QSLibrarian sharedInstance] setPreset:self isEnabled:enabled]; [[QSLibrarian sharedInstance] setPreset:self isEnabled:enabled];
else else
[info setObject:[NSNumber numberWithBool:enabled] forKey:kItemEnabled]; [info setObject:[NSNumber numberWithBool:enabled] forKey:kItemEnabled];
if (enabled && ![[self contents] count]) [self scanForced:NO]; if (enabled && ![[self contents] count])
[NSThread detachNewThreadSelector:@selector(scanForcedInThread:) toTarget:self withObject:[NSNumber numberWithBool:NO]];
} }


- (void)setDeepEnabled:(BOOL)enabled { - (void)setDeepEnabled:(BOOL)enabled {
Expand Down
21 changes: 10 additions & 11 deletions Quicksilver/Code-QuickStepCore/QSObject_FileHandling.h
Expand Up @@ -10,10 +10,7 @@
- (NSData *)fileRepresentationForObject:(QSObject *)object; - (NSData *)fileRepresentationForObject:(QSObject *)object;
- (NSString *)filenameForObject:(QSObject *)object; - (NSString *)filenameForObject:(QSObject *)object;
@end @end

@interface QSFileSystemObjectHandler : NSObject
@interface QSFileSystemObjectHandler : NSObject {
NSMutableDictionary *applicationIcons;
}


// Added by Patrick Robertson 30/06/11 in Pull #388. QSObject_FileHandling.h/.m are a mess and it's unclear as to wether // Added by Patrick Robertson 30/06/11 in Pull #388. QSObject_FileHandling.h/.m are a mess and it's unclear as to wether
// this is required. Any developers working on tidying these files should check the necessity/requirement of this definition // this is required. Any developers working on tidying these files should check the necessity/requirement of this definition
Expand All @@ -25,7 +22,7 @@
- (NSString *)validSingleFilePath; - (NSString *)validSingleFilePath;
- (NSArray *)validPaths; - (NSArray *)validPaths;
- (NSArray *)validPathsResolvingAliases:(BOOL)resolve; - (NSArray *)validPathsResolvingAliases:(BOOL)resolve;
- (NSInteger) fileCount; - (NSInteger)fileCount;
@end @end


@interface NSObject (QSFilePreviewProvider) @interface NSObject (QSFilePreviewProvider)
Expand All @@ -41,16 +38,18 @@
- (id)initWithArray:(NSArray *)paths; - (id)initWithArray:(NSArray *)paths;
- (void)getNameFromFiles; - (void)getNameFromFiles;
- (NSString *)kindOfFile:(NSString *)path; - (NSString *)kindOfFile:(NSString *)path;
// NSLog(@"name %@ %@ %@", newName, newLabel, [path lastPathComponent]);
- (NSString *)filesContainer; - (NSString *)filesContainer;
- (NSString *)filesType; - (NSString *)filesType;
//- (QSObject *)fileObjectByMergingWith:(QSObject *)mergeObject;
- (BOOL)isApplication; - (BOOL)isApplication;
- (BOOL)isFolder; - (BOOL)isDirectory; // YES for all directories
- (BOOL)isFolder; // YES for directories that aren't packages
- (BOOL)isPackage;
- (BOOL)isAlias;
- (BOOL)isOnLocalVolume;
- (NSString *)fileExtension;
- (NSString *)fileUTI;
- (NSString *)singleFileType; - (NSString *)singleFileType;
- (NSArray *)validPaths;
- (NSArray *)validPathsResolvingAliases:(BOOL)resolve;


-(void)previewIcon:(id)file; - (void)previewIcon:(id)file;
@end @end