From 798ea02440c00be6851e79fa8a9a65c77fbfd8e9 Mon Sep 17 00:00:00 2001 From: Tom Schoonjans Date: Sun, 23 Jul 2017 09:37:26 +0100 Subject: [PATCH] GtkFileChooserNativeQuartz: add support for Mountain Lion and Mavericks https://bugzilla.gnome.org/show_bug.cgi?id=784723 introduced support for native file chooser dialogs on macOS, but due to the use of generics in the patch, there will be compilation errors on pre-Xcode 7 platforms, such as Mountain Lion and Mavericks. I strongly recommend to revert this patch when the oldest supported macOS release is bumped to Yosemite (10.10). https://bugzilla.gnome.org/show_bug.cgi?id=785306 --- gtk/gtkfilechoosernativequartz.c | 16 ++++++++-------- gtk/gtkfilefilter.c | 4 ++-- gtk/gtkfilefilterprivate.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gtk/gtkfilechoosernativequartz.c b/gtk/gtkfilechoosernativequartz.c index dd98dcb45b..d573248210 100644 --- a/gtk/gtkfilechoosernativequartz.c +++ b/gtk/gtkfilechoosernativequartz.c @@ -67,8 +67,8 @@ typedef struct { GFile *current_file; char *current_name; - NSMutableArray *> *filters; - NSMutableArray *filter_names; + NSMutableArray *filters; + NSMutableArray *filter_names; NSComboBox *filter_combo_box; GSList *files; @@ -94,7 +94,7 @@ typedef struct { - (void)comboBoxSelectionDidChange:(NSNotification *)notification { NSInteger selected_index = [data->filter_combo_box indexOfSelectedItem]; - NSArray *filter = [data->filters objectAtIndex:selected_index]; + NSArray *filter = [data->filters objectAtIndex:selected_index]; // check for empty strings in filter -> indicates all filetypes should be allowed! if ([filter containsObject:@""]) [data->panel setAllowedFileTypes:nil]; @@ -400,11 +400,11 @@ strip_mnemonic (const gchar *s) static gboolean file_filter_to_quartz (GtkFileFilter *file_filter, - NSMutableArray *> *filters, - NSMutableArray *filter_names) + NSMutableArray *filters, + NSMutableArray *filter_names) { const char *name; - NSArray *pattern_nsstrings; + NSArray *pattern_nsstrings; pattern_nsstrings = _gtk_file_filter_get_as_pattern_nsstrings (file_filter); if (pattern_nsstrings == NULL) @@ -462,9 +462,9 @@ gtk_file_chooser_native_quartz_show (GtkFileChooserNative *self) n_filters = g_slist_length (filters); if (n_filters > 0) { - data->filters = [NSMutableArray *> arrayWithCapacity:n_filters]; + data->filters = [NSMutableArray arrayWithCapacity:n_filters]; [data->filters retain]; - data->filter_names = [NSMutableArray arrayWithCapacity:n_filters]; + data->filter_names = [NSMutableArray arrayWithCapacity:n_filters]; [data->filter_names retain]; for (l = filters, i = 0; l != NULL; l = l->next, i++) diff --git a/gtk/gtkfilefilter.c b/gtk/gtkfilefilter.c index e45406c9e7..cd19fb688c 100644 --- a/gtk/gtkfilefilter.c +++ b/gtk/gtkfilefilter.c @@ -596,9 +596,9 @@ gtk_file_filter_get_needed (GtkFileFilter *filter) #import -NSArray * _gtk_file_filter_get_as_pattern_nsstrings (GtkFileFilter *filter) +NSArray * _gtk_file_filter_get_as_pattern_nsstrings (GtkFileFilter *filter) { - NSMutableArray *array = [[NSMutableArray alloc] init]; + NSMutableArray *array = [[NSMutableArray alloc] init]; GSList *tmp_list; for (tmp_list = filter->rules; tmp_list; tmp_list = tmp_list->next) diff --git a/gtk/gtkfilefilterprivate.h b/gtk/gtkfilefilterprivate.h index ce8a715fea..340caf80e7 100644 --- a/gtk/gtkfilefilterprivate.h +++ b/gtk/gtkfilefilterprivate.h @@ -31,7 +31,7 @@ G_BEGIN_DECLS char ** _gtk_file_filter_get_as_patterns (GtkFileFilter *filter); #ifdef GDK_WINDOWING_QUARTZ -NSArray * _gtk_file_filter_get_as_pattern_nsstrings (GtkFileFilter *filter); +NSArray * _gtk_file_filter_get_as_pattern_nsstrings (GtkFileFilter *filter); #endif