Fix logic for redisplaying the remote gallery view if it's already loaded.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 26 Sep 2009 15:18:03 +0000 (11:18 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Sat, 26 Sep 2009 15:18:03 +0000 (11:18 -0400)
Tweak some return value types.

ApertureToAnselExportPlugin/ApertureToAnselExportPlugin.m
ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.h
ApertureToAnselExportPlugin/TURAnselKit/TURAnselGallery.m

index 92d4602..a480f3a 100644 (file)
@@ -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
index 5eff4e7..65782d3 100644 (file)
@@ -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
index 9397b10..a081a64 100644 (file)
 /**
  * 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
             imageList = [[response objectForKey: (id)kWSMethodInvocationResult] retain];
             
             NSLog(@"listImages: %@", imageList);
-            
-            return imageList;
         }
     }
     
-    return nil;
+    return imageList;;
 }
     
 /**