[gedit] FileChooserDialogOSX: remove it, use the Gtk one on macOS



commit a8f7ba03a9495c272a98c00959233b67e312a7b9
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Tue Jun 9 23:30:27 2020 +0200

    FileChooserDialogOSX: remove it, use the Gtk one on macOS
    
    Ideally gedit should use GtkFileChooserNative in all situations.
    GtkFileChooserNative has an implementation for macOS, probably similar
    to what Jesse implemented for gedit with GeditFileChooserDialogOSX.
    
    Unfortunately GtkFileChooserNative for macOS currently lacks support for
    the new 'choice' API (gtk_file_chooser_add_choice() etc), see:
    https://gitlab.gnome.org/GNOME/gtk/-/issues/1983
    
    And when using GtkFileChooserNative, gedit needs to use the 'choice'
    API.
    
    In any case, we want to migrate gedit to GtkFileChooserNative
    (gradually). Even if we don't enable GtkFileChooserNative everywhere,
    the fact that it will be enabled on some platforms means that we will
    have the code ready for GtkFileChooserNative.
    
    One thing that I've started to do is to split the Open case from the
    Save As case, to not mix the two in the same source file (with common
    code in gedit-file-chooser.c), to hopefully have clearer code. Which
    means: getting rid of the GeditFileChooserDialog interface (which mixes
    the two cases).
    
    It *would* be possible to keep GeditFileChooserDialogOSX and
    GeditFileChooserDialog, just removing GeditFileChooserDialogGtk, and
    implement the GeditFileChooserOpen/Save interfaces by using
    GeditFileChooserDialog. But I would not be able to test it, I don't have
    a mac machine.
    
    Long story short, on macOS it's GtkFileChooserDialog that will be used,
    like it was the case for gedit pre-2014.

 gedit/gedit-file-chooser-dialog-osx.h |  46 --
 gedit/gedit-file-chooser-dialog-osx.m | 920 ----------------------------------
 gedit/gedit-file-chooser-dialog.c     |  14 -
 gedit/meson.build                     |   2 -
 po/POTFILES.in                        |   1 -
 5 files changed, 983 deletions(-)
---
diff --git a/gedit/gedit-file-chooser-dialog.c b/gedit/gedit-file-chooser-dialog.c
index 17ec36bde..b578ca79e 100644
--- a/gedit/gedit-file-chooser-dialog.c
+++ b/gedit/gedit-file-chooser-dialog.c
@@ -19,14 +19,8 @@
  */
 
 #include "config.h"
-
 #include "gedit-file-chooser-dialog.h"
-
-#ifdef OS_OSX
-#include "gedit-file-chooser-dialog-osx.h"
-#else
 #include "gedit-file-chooser-dialog-gtk.h"
-#endif
 
 G_DEFINE_INTERFACE (GeditFileChooserDialog, gedit_file_chooser_dialog, G_TYPE_OBJECT)
 
@@ -74,19 +68,11 @@ gedit_file_chooser_dialog_create (const gchar           *title,
                                  const gchar           *accept_label,
                                  const gchar           *cancel_label)
 {
-#ifdef OS_OSX
-       return gedit_file_chooser_dialog_osx_create (title,
-                                                    parent,
-                                                    flags,
-                                                    accept_label,
-                                                    cancel_label);
-#else
        return gedit_file_chooser_dialog_gtk_create (title,
                                                     parent,
                                                     flags,
                                                     accept_label,
                                                     cancel_label);
-#endif
 }
 
 void
diff --git a/gedit/meson.build b/gedit/meson.build
index 4a3dec2b6..b3ff48016 100644
--- a/gedit/meson.build
+++ b/gedit/meson.build
@@ -50,7 +50,6 @@ libgedit_private_headers = [
   'gedit-factory.h',
   'gedit-file-chooser-dialog-gtk.h',
   'gedit-file-chooser-dialog.h',
-  'gedit-file-chooser-dialog-osx.h',
   'gedit-file-chooser.h',
   'gedit-file-chooser-open.h',
   'gedit-highlight-mode-dialog.h',
@@ -129,7 +128,6 @@ libgedit_deps = [
 if host_machine.system() == 'darwin'
   libgedit_private_sources += [
     'gedit-app-osx.m',
-    'gedit-file-chooser-dialog-osx.m',
   ]
   libgedit_c_args += [
     '-DOS_OSX=1',
diff --git a/po/POTFILES.in b/po/POTFILES.in
index edbd9c196..819555a5e 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -19,7 +19,6 @@ gedit/gedit-encodings-dialog.c
 gedit/gedit-factory.c
 gedit/gedit-file-chooser.c
 gedit/gedit-file-chooser-dialog-gtk.c
-gedit/gedit-file-chooser-dialog-osx.m
 gedit/gedit-file-chooser-open-adapter.c
 gedit/gedit-file-chooser-open.c
 gedit/gedit-highlight-mode-dialog.c


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]