[gedit/zbrown/deteplification-src: 367/633] FileChooserDialog: remove ENABLE_ENCODING flag (always set)
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/zbrown/deteplification-src: 367/633] FileChooserDialog: remove ENABLE_ENCODING flag (always set)
- Date: Sat, 10 Apr 2021 12:48:03 +0000 (UTC)
commit c85052d70389f9661a330c76b4161291d3ef90f2
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 078a79121..f8fd42d00 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -455,7 +455,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);
@@ -845,7 +844,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 f5e65afc2..e88364ef2 100644
--- a/gedit/gedit-file-chooser-dialog-gtk.c
+++ b/gedit/gedit-file-chooser-dialog-gtk.c
@@ -420,25 +420,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 ba4c0a165..1443332c9 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 8e898ca65..14bab1f55 100644
--- a/gedit/gedit-file-chooser-dialog.h
+++ b/gedit/gedit-file-chooser-dialog.h
@@ -84,9 +84,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]