[gedit] commands-file: minor code improvements
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] commands-file: minor code improvements
- Date: Sat, 6 Jun 2020 18:16:36 +0000 (UTC)
commit fd484093d19cdcc7e0916f2e72aa3247bac3a096
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sat Jun 6 20:14:57 2020 +0200
commands-file: minor code improvements
gedit/gedit-commands-file.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 12a61e31a..3d9ab22db 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -369,7 +369,7 @@ open_dialog_response_cb (GeditFileChooserDialog *dialog,
{
GSList *files;
const GtkSourceEncoding *encoding;
- GSList *loaded_files;
+ GSList *loaded_documents;
gedit_debug (DEBUG_COMMANDS);
@@ -385,8 +385,6 @@ open_dialog_response_cb (GeditFileChooserDialog *dialog,
}
files = gedit_file_chooser_dialog_get_files (dialog);
- g_return_if_fail (files != NULL);
-
encoding = gedit_file_chooser_dialog_get_encoding (dialog);
gedit_file_chooser_dialog_destroy (dialog);
@@ -403,12 +401,15 @@ open_dialog_response_cb (GeditFileChooserDialog *dialog,
gtk_window_present (GTK_WINDOW (window));
}
- /* Remember the folder we navigated to */
- _gedit_window_set_default_location (window, files->data);
+ /* Remember the folder we navigated to. */
+ if (files != NULL)
+ {
+ _gedit_window_set_default_location (window, files->data);
+ }
- loaded_files = gedit_commands_load_locations (window, files, encoding, 0, 0);
+ loaded_documents = gedit_commands_load_locations (window, files, encoding, 0, 0);
- g_slist_free (loaded_files);
+ g_slist_free (loaded_documents);
g_slist_free_full (files, g_object_unref);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]