Ticket #54518: gtk3_NSArray.patch

File gtk3_NSArray.patch, 3.1 KB (added by jjstickel (Jonathan Stickel), 7 years ago)

builds, but runtime errors

  • gtk/gtkfilechoosernativequartz.c

    diff -ur gtk/gtkfilechoosernativequartz.c gtk/gtkfilechoosernativequartz.c
     
    6767  GFile *current_file;
    6868  char *current_name;
    6969
    70   NSMutableArray<NSArray<NSString *> *> *filters;
    71   NSMutableArray<NSString *> *filter_names;
     70  NSMutableArray *filters;
     71  NSMutableArray *filter_names;
    7272  NSComboBox *filter_combo_box;
    7373
    7474  GSList *files;
     
    9494- (void)comboBoxSelectionDidChange:(NSNotification *)notification
    9595{
    9696  NSInteger selected_index = [data->filter_combo_box indexOfSelectedItem];
    97   NSArray<NSString *> *filter = [data->filters objectAtIndex:selected_index];
     97  NSArray *filter = [data->filters objectAtIndex:selected_index];
    9898  // check for empty strings in filter -> indicates all filetypes should be allowed!
    9999  if ([filter containsObject:@""])
    100100    [data->panel setAllowedFileTypes:nil];
     
    400400
    401401static gboolean
    402402file_filter_to_quartz (GtkFileFilter *file_filter,
    403                        NSMutableArray<NSArray<NSString *> *> *filters,
    404                        NSMutableArray<NSString *> *filter_names)
     403                       NSMutableArray *filters,
     404                       NSMutableArray *filter_names)
    405405{
    406406  const char *name;
    407   NSArray<NSString *> *pattern_nsstrings;
     407  NSArray *pattern_nsstrings;
    408408
    409409  pattern_nsstrings = _gtk_file_filter_get_as_pattern_nsstrings (file_filter);
    410410  if (pattern_nsstrings == NULL)
     
    462462  n_filters = g_slist_length (filters);
    463463  if (n_filters > 0)
    464464    {
    465       data->filters = [NSMutableArray<NSArray<NSString *> *> arrayWithCapacity:n_filters];
     465      data->filters = [NSMutableArray arrayWithCapacity:n_filters];
    466466      [data->filters retain];
    467       data->filter_names = [NSMutableArray<NSString *> arrayWithCapacity:n_filters];
     467      data->filter_names = [NSMutableArray arrayWithCapacity:n_filters];
    468468      [data->filter_names retain];
    469469
    470470      for (l = filters, i = 0; l != NULL; l = l->next, i++)
  • gtk/gtkfilefilter.c

    diff -ur gtk/gtkfilefilter.c gtk/gtkfilefilter.c
     
    596596
    597597#import <Foundation/Foundation.h>
    598598
    599 NSArray<NSString *> * _gtk_file_filter_get_as_pattern_nsstrings (GtkFileFilter *filter)
     599NSArray * _gtk_file_filter_get_as_pattern_nsstrings (GtkFileFilter *filter)
    600600{
    601   NSMutableArray<NSString *> *array = [[NSMutableArray alloc] init];
     601  NSMutableArray *array = [[NSMutableArray alloc] init];
    602602  GSList *tmp_list;
    603603
    604604  for (tmp_list = filter->rules; tmp_list; tmp_list = tmp_list->next)
  • gtk/gtkfilefilterprivate.h

    diff -ur gtk/gtkfilefilterprivate.h gtk/gtkfilefilterprivate.h
     
    3131char ** _gtk_file_filter_get_as_patterns (GtkFileFilter      *filter);
    3232
    3333#ifdef GDK_WINDOWING_QUARTZ
    34 NSArray<NSString *> * _gtk_file_filter_get_as_pattern_nsstrings (GtkFileFilter *filter);
     34NSArray * _gtk_file_filter_get_as_pattern_nsstrings (GtkFileFilter *filter);
    3535#endif
    3636
    3737