From c70bd65922fcb4678c4772d7b9b0e13f59023928 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 19 Jan 2013 18:05:35 +0000 Subject: [PATCH] Tweaking syntax for 10.6 block locals. --- src/GUI/CocoaFileDialog.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/GUI/CocoaFileDialog.mm b/src/GUI/CocoaFileDialog.mm index 9f15680e2..c2bdbd932 100644 --- a/src/GUI/CocoaFileDialog.mm +++ b/src/GUI/CocoaFileDialog.mm @@ -74,6 +74,7 @@ void CocoaFileDialog::exec() NSWindow* cocoaWindow = nil; std::vector windows; globals->get_renderer()->getViewer()->getWindows(windows); + BOOST_FOREACH(osgViewer::GraphicsWindow* gw, windows) { // OSG doesn't use RTTI, so no dynamic cast. Let's check the class type // using OSG's own system, before we blindly static_cast<> and break @@ -116,10 +117,13 @@ void CocoaFileDialog::exec() [d->panel beginSheetModalForWindow:cocoaWindow completionHandler:^(NSInteger result) { + NSString* path = nil; + SGPath sgpath; + if (result == NSFileHandlingPanelOKButton) { - NSString* path = [[d->panel URL] path]; + path = [[d->panel URL] path]; //NSLog(@"the URL is: %@", d->panel URL]); - SGPath sgpath([path UTF8String]); + sgpath = ([path UTF8String]); _callback->onFileDialogDone(this, sgpath); } }]; -- 2.39.5