[gedit] commands-file: simplify, the FileChooserOpen is now always modal
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] commands-file: simplify, the FileChooserOpen is now always modal
- Date: Sat, 6 Jun 2020 22:26:36 +0000 (UTC)
commit 6a1635643182ce013ad53a8b7eb13dcf510650e6
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Jun 7 00:24:36 2020 +0200
commands-file: simplify, the FileChooserOpen is now always modal
gedit/gedit-commands-file.c | 30 ------------------------------
1 file changed, 30 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 98901e117..ed9852e0a 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -50,7 +50,6 @@
#define GBOOLEAN_TO_POINTER(i) (GINT_TO_POINTER ((i) ? 2 : 1))
#define GPOINTER_TO_BOOLEAN(i) ((gboolean) ((GPOINTER_TO_INT(i) == 2) ? TRUE : FALSE))
-#define GEDIT_FILE_CHOOSER_OPEN_KEY "gedit-file-chooser-open-key"
#define GEDIT_IS_CLOSING_ALL "gedit-is-closing-all"
#define GEDIT_NOTEBOOK_TO_CLOSE "gedit-notebook-to-close"
#define GEDIT_IS_QUITTING "gedit-is-quitting"
@@ -377,21 +376,12 @@ file_chooser_open_done_cb (GeditFileChooserOpen *file_chooser,
if (!accept)
{
g_object_unref (file_chooser);
- if (window != NULL)
- {
- g_object_set_data (G_OBJECT (window), GEDIT_FILE_CHOOSER_OPEN_KEY, NULL);
- }
return;
}
files = _gedit_file_chooser_open_get_files (file_chooser);
encoding = _gedit_file_chooser_open_get_encoding (file_chooser);
-
g_object_unref (file_chooser);
- if (window != NULL)
- {
- g_object_set_data (G_OBJECT (window), GEDIT_FILE_CHOOSER_OPEN_KEY, NULL);
- }
if (window == NULL)
{
@@ -428,17 +418,6 @@ _gedit_cmd_file_open (GSimpleAction *action,
window = GEDIT_WINDOW (user_data);
}
- if (window != NULL)
- {
- file_chooser = GEDIT_FILE_CHOOSER_OPEN (g_object_get_data (G_OBJECT (window),
- GEDIT_FILE_CHOOSER_OPEN_KEY));
- if (file_chooser != NULL)
- {
- _gedit_file_chooser_open_show (file_chooser);
- return;
- }
- }
-
file_chooser = _gedit_file_chooser_open_new ();
if (window != NULL)
@@ -448,15 +427,6 @@ _gedit_cmd_file_open (GSimpleAction *action,
_gedit_file_chooser_open_set_transient_for (file_chooser, GTK_WINDOW (window));
- /* The file chooser dialog for opening files is not necessarily
- * modal, so ensure that at most one file chooser is opened per
- * main window.
- */
- g_object_set_data_full (G_OBJECT (window),
- GEDIT_FILE_CHOOSER_OPEN_KEY,
- g_object_ref (file_chooser),
- g_object_unref);
-
/* Set the current folder */
doc = gedit_window_get_active_document (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]