]> git.mxchange.org Git - flightgear.git/commitdiff
Tweaking syntax for 10.6 block locals.
authorJames Turner <zakalawe@mac.com>
Sat, 19 Jan 2013 18:05:35 +0000 (18:05 +0000)
committerJames Turner <zakalawe@mac.com>
Sat, 19 Jan 2013 18:05:35 +0000 (18:05 +0000)
src/GUI/CocoaFileDialog.mm

index 9f15680e211453097f4b859bc16f65b5646a2581..c2bdbd9321babc05e09b410208251ac3792b5642 100644 (file)
@@ -74,6 +74,7 @@ void CocoaFileDialog::exec()
     NSWindow* cocoaWindow = nil;
     std::vector<osgViewer::GraphicsWindow*> 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);
         }
     }];