[gedit] FileChooserDialog: remove ENABLE_ENCODING flag (always set)



commit 512d57e4528feaf1eb22ae49f9bfac19a2ff3d9d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jun 4 22:36:31 2020 +0200

    FileChooserDialog: remove ENABLE_ENCODING flag (always set)

 gedit/gedit-commands-file.c           |  2 --
 gedit/gedit-file-chooser-dialog-gtk.c | 13 +------------
 gedit/gedit-file-chooser-dialog-osx.m | 12 +-----------
 gedit/gedit-file-chooser-dialog.h     |  5 ++---
 4 files changed, 4 insertions(+), 28 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index d3498312a..9a2107ee8 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -454,7 +454,6 @@ _gedit_cmd_file_open (GSimpleAction *action,
        open_dialog = gedit_file_chooser_dialog_create (C_("window title", "Open Files"),
                                                        window != NULL ? GTK_WINDOW (window) : NULL,
                                                        GEDIT_FILE_CHOOSER_OPEN |
-                                                       GEDIT_FILE_CHOOSER_ENABLE_ENCODING |
                                                        GEDIT_FILE_CHOOSER_ENABLE_DEFAULT_FILTERS,
                                                        _("_Cancel"), GTK_RESPONSE_CANCEL,
                                                        _("_Open"), GTK_RESPONSE_OK);
@@ -844,7 +843,6 @@ save_as_tab_async (GeditTab            *tab,
        save_dialog = gedit_file_chooser_dialog_create (C_("window title", "Save As"),
                                                        GTK_WINDOW (window),
                                                        GEDIT_FILE_CHOOSER_SAVE |
-                                                       GEDIT_FILE_CHOOSER_ENABLE_ENCODING |
                                                        GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING |
                                                        GEDIT_FILE_CHOOSER_ENABLE_DEFAULT_FILTERS,
                                                        _("_Cancel"), GTK_RESPONSE_CANCEL,
diff --git a/gedit/gedit-file-chooser-dialog-gtk.c b/gedit/gedit-file-chooser-dialog-gtk.c
index c0c23d55d..b7a860691 100644
--- a/gedit/gedit-file-chooser-dialog-gtk.c
+++ b/gedit/gedit-file-chooser-dialog-gtk.c
@@ -392,25 +392,14 @@ static void
 create_extra_widget (GeditFileChooserDialogGtk *dialog,
                      GeditFileChooserFlags      flags)
 {
-       gboolean needs_encoding;
        gboolean needs_line_ending;
 
-       needs_encoding = (flags & GEDIT_FILE_CHOOSER_ENABLE_ENCODING) != 0;
        needs_line_ending = (flags & GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING) != 0;
 
-       if (!needs_encoding && !needs_line_ending)
-       {
-               return;
-       }
-
        dialog->extra_widget = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
-
        gtk_widget_show (dialog->extra_widget);
 
-       if (needs_encoding)
-       {
-               create_option_menu (dialog, flags);
-       }
+       create_option_menu (dialog, flags);
 
        if (needs_line_ending)
        {
diff --git a/gedit/gedit-file-chooser-dialog-osx.m b/gedit/gedit-file-chooser-dialog-osx.m
index 3eb88e248..1c8986279 100644
--- a/gedit/gedit-file-chooser-dialog-osx.m
+++ b/gedit/gedit-file-chooser-dialog-osx.m
@@ -660,7 +660,6 @@ create_newline_combo (GeditFileChooserDialogOSX *dialog,
 static void
 create_extra_widget (GeditFileChooserDialogOSX *dialog)
 {
-       gboolean needs_encoding;
        gboolean needs_line_ending;
        GeditFileChooserFlags flags;
        NSSize size;
@@ -670,20 +669,11 @@ create_extra_widget (GeditFileChooserDialogOSX *dialog)
 
        flags = dialog->flags;
 
-       needs_encoding = (flags & GEDIT_FILE_CHOOSER_ENABLE_ENCODING) != 0;
        needs_line_ending = (flags & GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING) != 0;
 
-       if (!needs_encoding && !needs_line_ending)
-       {
-               return;
-       }
-
        container = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 400, 30)];
 
-       if (needs_encoding)
-       {
-               minw += create_encoding_combo (dialog, container);
-       }
+       minw += create_encoding_combo (dialog, container);
 
        if (needs_line_ending)
        {
diff --git a/gedit/gedit-file-chooser-dialog.h b/gedit/gedit-file-chooser-dialog.h
index c6e314018..466a191f3 100644
--- a/gedit/gedit-file-chooser-dialog.h
+++ b/gedit/gedit-file-chooser-dialog.h
@@ -79,9 +79,8 @@ typedef enum
 {
        GEDIT_FILE_CHOOSER_SAVE                   = 1 << 0,
        GEDIT_FILE_CHOOSER_OPEN                   = 1 << 1,
-       GEDIT_FILE_CHOOSER_ENABLE_ENCODING        = 1 << 2,
-       GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING     = 1 << 3,
-       GEDIT_FILE_CHOOSER_ENABLE_DEFAULT_FILTERS = 1 << 4
+       GEDIT_FILE_CHOOSER_ENABLE_LINE_ENDING     = 1 << 2,
+       GEDIT_FILE_CHOOSER_ENABLE_DEFAULT_FILTERS = 1 << 3
 } GeditFileChooserFlags;
 
 GeditFileChooserDialog *


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