diff --git a/Quicksilver/Code-QuickStepCore/QSLibrarian.m b/Quicksilver/Code-QuickStepCore/QSLibrarian.m index ce5286e07..00676f972 100644 --- a/Quicksilver/Code-QuickStepCore/QSLibrarian.m +++ b/Quicksilver/Code-QuickStepCore/QSLibrarian.m @@ -80,12 +80,16 @@ - (id)init { [NSMutableArray array] , kItemChildren, [NSNumber numberWithBool:YES] , kItemEnabled, nil]; +#ifdef DEBUG if ((int) getenv("QSDisableCatalog") || GetCurrentKeyModifiers() & shiftKey) { NSLog(@"Disabling Catalog"); } else { +#endif [self setCatalog:[QSCatalogEntry entryWithDictionary: [NSMutableDictionary dictionaryWithObjectsAndKeys:@"QSCATALOGROOT", kItemName, @"QSGroupObjectSource", kItemSource, [NSMutableArray arrayWithObjects:modulesEntry, nil] , kItemChildren, [NSNumber numberWithBool:YES] , kItemEnabled, nil]]]; +#ifdef DEBUG } +#endif // Register for Notifications [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(writeCatalog:) name:QSCatalogEntryChanged object:nil]; diff --git a/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.h b/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.h index 8fe11e758..60e23a95f 100644 --- a/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.h +++ b/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.h @@ -83,8 +83,8 @@ typedef enum QSSearchMode { - (NSMutableArray *)sourceArray; - (void)setSourceArray:(NSMutableArray *)newSourceArray; -- (NSArray *)searchArray; -- (void)setSearchArray:(NSArray *)newSearchArray; +- (NSMutableArray *)searchArray; +- (void)setSearchArray:(NSMutableArray *)newSearchArray; - (NSMutableArray *)resultArray; - (void)setResultArray:(NSMutableArray *)newResultArray; diff --git a/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m b/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m index b5988a5f0..344e6b584 100644 --- a/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m +++ b/Quicksilver/Code-QuickStepInterface/QSSearchObjectView.m @@ -293,8 +293,8 @@ - (void)setResultArray:(NSMutableArray *)newResultArray { [(id)[self controller] searchView:self changedResults:newResultArray]; } -- (NSArray *)searchArray { return searchArray; } -- (void)setSearchArray:(NSArray *)newSearchArray { +- (NSMutableArray *)searchArray { return searchArray; } +- (void)setSearchArray:(NSMutableArray *)newSearchArray { if (searchArray != newSearchArray) { [searchArray release]; searchArray = [newSearchArray retain]; @@ -580,7 +580,16 @@ - (IBAction)updateResultView:(id)sender { #pragma mark - #pragma mark Object Value - (void)selectObjectValue:(QSObject *)newObject { - if (newObject != [self objectValue]) { + QSObject *currentObject = [self objectValue]; + QSObject *tempNewObject; + QSObject *tempCurrentObject; + if ([newObject isKindOfClass:[QSRankedObject class]]) { + tempNewObject = [(QSRankedObject *)newObject object]; + } + if ([currentObject isKindOfClass:[QSRankedObject class]]) { + tempCurrentObject = [(QSRankedObject *)currentObject object]; + } + if ((tempNewObject ? tempNewObject : newObject) != (tempCurrentObject ? tempCurrentObject : currentObject)) { [self updateHistory]; [super setObjectValue:newObject]; [[NSNotificationCenter defaultCenter] postNotificationName:@"SearchObjectChanged" object:self]; diff --git a/Quicksilver/PlugIns-Main/QSCorePlugIn/Code/QSActionProvider_EmbeddedProviders.m b/Quicksilver/PlugIns-Main/QSCorePlugIn/Code/QSActionProvider_EmbeddedProviders.m index 4c27d9032..a294a3f3c 100644 --- a/Quicksilver/PlugIns-Main/QSCorePlugIn/Code/QSActionProvider_EmbeddedProviders.m +++ b/Quicksilver/PlugIns-Main/QSCorePlugIn/Code/QSActionProvider_EmbeddedProviders.m @@ -343,15 +343,25 @@ - (NSArray *)validIndirectObjectsForAction:(NSString *)action directObject:(QSOb return [NSArray arrayWithObject:[QSObject textProxyObjectWithDefaultValue:@"untitled folder"]]; } else if ([action isEqualToString:kFileMoveToAction] || [action isEqualToString:kFileCopyToAction]) { // We only want folders for the move to / copy to actions (can't move to anything else) - NSArray *fileObjects = [[QSLibrarian sharedInstance] arrayForType:QSFilePathType]; + NSMutableArray *fileObjects = [[[QSLibrarian sharedInstance] arrayForType:QSFilePathType] mutableCopy]; BOOL isDirectory; + NSString *currentFolderPath = [[[[dObject splitObjects] lastObject] singleFilePath] stringByDeletingLastPathComponent]; + // if it wasn't in the catalog, create it from scratch + QSObject *currentFolderObject = [QSObject fileObjectWithPath:currentFolderPath]; + [fileObjects removeObject:currentFolderObject]; + [fileObjects insertObject:currentFolderObject atIndex:0]; + NSWorkspace *ws = [[NSWorkspace sharedWorkspace] retain]; + NSFileManager *fm = [[NSFileManager alloc] init]; for(QSObject *thisObject in fileObjects) { NSString *path = [thisObject singleFilePath]; - if ([[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDirectory]) { - if (isDirectory && ![[path pathExtension] length]) + if ([fm fileExistsAtPath:path isDirectory:&isDirectory]) { + if (isDirectory && ![ws isFilePackageAtPath:path]) [validIndirects addObject:thisObject]; } } + [fileObjects release]; + [ws release]; + [fm release]; return validIndirects; } return nil;