From 27a6ce763ebceb85016458111838d068182d0900 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 26 Sep 2009 11:18:03 -0400 Subject: [PATCH] Fix logic for redisplaying the remote gallery view if it's already loaded. Tweak some return value types. --- ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m | 6 ++++-- ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.h | 2 +- ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.m | 9 +++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m index 92d460200..a480f3ae9 100644 --- a/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m +++ b/ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m @@ -594,9 +594,13 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn // Show the gallery's image browser - (IBAction)clickViewGallery: (id)sender { + NSLog(@"clickViewGallery"); + [_browserData removeAllObjects]; + [browserView reloadData]; [spinner startAnimation: self]; [self setStatusText: @"Getting image list..."]; NSMutableArray *images = [_currentGallery listImages]; + NSLog(@"Image Count: %d", [images count]); if ([images count] == 0) { [spinner stopAnimation: self]; [self setStatusText: @"Connected" withColor: [NSColor greenColor]]; @@ -639,8 +643,6 @@ objectValueForTableColumn:(NSTableColumn *)aTableColumn NSLog(@"closeGalleryView"); [NSApp endSheet: mviewGallerySheet]; [mviewGallerySheet orderOut: nil]; - [_browserData removeAllObjects]; - [browserView reloadData]; } - (IBAction) closeServerList: (id)sender diff --git a/ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.h b/ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.h index 5eff4e79b..65782d3b9 100644 --- a/ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.h +++ b/ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.h @@ -36,7 +36,7 @@ - (void)setDelegate: (id)newDelegate; - (id)delegate; - (NSURL *)galleryKeyImageURL; -- (id)listImages; +- (NSMutableArray *)listImages; - (int)galleryId; - (void)setAnselController:(TURAnsel *)newController; @end \ No newline at end of file diff --git a/ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.m b/ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.m index 9397b107d..a081a6496 100644 --- a/ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.m +++ b/ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.m @@ -104,10 +104,9 @@ /** * Get the complete list of image ids and URLs */ -- (id)listImages +- (NSMutableArray *)listImages { - if (!imageList) { - + if (![imageList count]) { NSArray *params = [[NSArray alloc] initWithObjects: @"ansel", //Scope [NSNumber numberWithInt: _galleryId], //Gallery Id @@ -129,12 +128,10 @@ imageList = [[response objectForKey: (id)kWSMethodInvocationResult] retain]; NSLog(@"listImages: %@", imageList); - - return imageList; } } - return nil; + return imageList;; } /** -- 2.11.0