diff --git a/src/osx/cocoa/dirdlg.mm b/src/osx/cocoa/dirdlg.mm index ef8886ac69..7f002567ad 100644 --- a/src/osx/cocoa/dirdlg.mm +++ b/src/osx/cocoa/dirdlg.mm @@ -76,6 +76,12 @@ WX_NSOpenPanel wxDirDialog::OSXCreatePanel() const return oPanel; } +// We use several deprecated methods of NSOpenPanel in the code below, we +// should replace them with newer equivalents now that we don't support OS X +// versions which didn't have them (pre 10.6), but until then, get rid of +// the warning. +wxGCC_WARNING_SUPPRESS(deprecated-declarations) + void wxDirDialog::ShowWindowModal() { wxNonOwnedWindow* parentWindow = NULL; @@ -133,4 +139,6 @@ void wxDirDialog::ModalFinishedCallback(void* panel, int returnCode) SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED ); } +wxGCC_WARNING_RESTORE(deprecated-declarations) + #endif // wxUSE_DIRDLG diff --git a/src/osx/cocoa/filedlg.mm b/src/osx/cocoa/filedlg.mm index 002cda4136..8af141a1f1 100644 --- a/src/osx/cocoa/filedlg.mm +++ b/src/osx/cocoa/filedlg.mm @@ -112,13 +112,18 @@ bool HasAppKit_10_6() - (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename { BOOL showObject = YES; - + + wxGCC_WARNING_SUPPRESS(deprecated-declarations) + NSString* resolvedLink = [[NSFileManager defaultManager] pathContentOfSymbolicLinkAtPath:filename]; if ( resolvedLink != nil ) filename = resolvedLink; - + NSDictionary* fileAttribs = [[NSFileManager defaultManager] fileAttributesAtPath:filename traverseLink:YES]; + + wxGCC_WARNING_RESTORE(deprecated-declarations) + if (fileAttribs) { // check for packages @@ -335,6 +340,8 @@ void wxFileDialog::ShowWindowModal() wxASSERT_MSG(parentWindow, "Window modal display requires parent."); + wxGCC_WARNING_SUPPRESS(deprecated-declarations) + NSArray* types = GetTypesFromFilter( m_wildCard, m_filterNames, m_filterExtensions ) ; if ( HasFlag(wxFD_SAVE) ) { @@ -378,6 +385,8 @@ void wxFileDialog::ShowWindowModal() didEndSelector: @selector(sheetDidEnd:returnCode:contextInfo:) contextInfo: nil]; } + + wxGCC_WARNING_RESTORE(deprecated-declarations) } // Create a panel with the file type drop down list @@ -582,6 +591,8 @@ int wxFileDialog::ShowModal() } } + wxGCC_WARNING_SUPPRESS(deprecated-declarations) + if ( HasFlag(wxFD_SAVE) ) { NSSavePanel* sPanel = [NSSavePanel savePanel]; @@ -650,11 +661,15 @@ int wxFileDialog::ShowModal() ModalFinishedCallback(oPanel, returnCode); } + wxGCC_WARNING_RESTORE(deprecated-declarations) + return GetReturnCode(); } void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode) { + wxGCC_WARNING_SUPPRESS(deprecated-declarations) + int result = wxID_CANCEL; if (HasFlag(wxFD_SAVE)) { @@ -709,6 +724,8 @@ void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode) if ( m_isNativeWindowWrapper ) UnsubclassWin(); [(NSSavePanel*) panel setAccessoryView:nil]; + + wxGCC_WARNING_RESTORE(deprecated-declarations) } #endif // wxUSE_FILEDLG