]> git.saurik.com Git - wxWidgets.git/commitdiff
turning off unconditional usage of filter-delegate, using native capabilities under...
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 6 Jun 2011 19:19:42 +0000 (19:19 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 6 Jun 2011 19:19:42 +0000 (19:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/filedlg.mm

index c0b6185d3410311aba325b17621ac6a80f04e676..44c1240c5752f8b6e3fea5d991e36d2b45af211e 100644 (file)
@@ -433,7 +433,7 @@ void wxFileDialog::SetupExtraControls(WXWindow nativeWindow)
         accView = m_filterPanel->GetHandle();
         if( HasFlag(wxFD_OPEN) )
         {
-            if ( 1 /* UMAGetSystemVersion() < 0x1060 */ )
+            if ( UMAGetSystemVersion() < 0x1060 )
             {
                 wxOpenPanelDelegate* del = [[wxOpenPanelDelegate alloc]init];
                 [del setFileDialog:this];
@@ -463,6 +463,8 @@ void wxFileDialog::SetupExtraControls(WXWindow nativeWindow)
 
 int wxFileDialog::ShowModal()
 {
+    wxMacAutoreleasePool autoreleasepool;
+    
     wxCFStringRef cf( m_message );
 
     wxCFStringRef dir( m_dir );
@@ -564,7 +566,7 @@ int wxFileDialog::ShowModal()
             DoOnFilterSelected(m_firstFileTypeFilter);
         }
 
-        returnCode = [sPanel runModalForDirectory:dir.AsNSString() file:file.AsNSString() ];
+        returnCode = [sPanel runModalForDirectory: m_dir.IsEmpty() ? nil : dir.AsNSString() file:file.AsNSString() ];
         ModalFinishedCallback(sPanel, returnCode);
     }
     else
@@ -582,13 +584,14 @@ int wxFileDialog::ShowModal()
 
         if ( UMAGetSystemVersion() < 0x1060 )
         {
-            returnCode = [oPanel runModalForDirectory:dir.AsNSString()
+            returnCode = [oPanel runModalForDirectory:m_dir.IsEmpty() ? nil : dir.AsNSString()
                                                  file:file.AsNSString() types:(m_delegate == nil ? types : nil)];
         }
         else 
         {
             [oPanel setAllowedFileTypes: (m_delegate == nil ? types : nil)];
-            [oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString() 
+            if ( !m_dir.IsEmpty() )
+                [oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString() 
                                                isDirectory:YES]];
             returnCode = [oPanel runModal];
         }