[gedit] Handle quit correctly for unsaved files. Fixes bug #696366



commit 0ab225128f5fd3d3b386984950b88014d7a5590b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Fri Mar 22 12:08:34 2013 +0100

    Handle quit correctly for unsaved files. Fixes bug #696366

 gedit/gedit-app.c           |    6 +-----
 gedit/gedit-commands-file.c |   10 +++-------
 2 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index 80f66e6..605f98e 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -375,11 +375,7 @@ quit_activated (GSimpleAction *action,
                 GVariant      *parameter,
                 gpointer       user_data)
 {
-       GApplication *app;
-
-       app = G_APPLICATION (user_data);
-
-       g_application_quit (app);
+       _gedit_cmd_file_quit (NULL, NULL);
 }
 
 static GActionEntry app_entries[] = {
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index ad75b41..3eccfcc 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -1919,9 +1919,8 @@ _gedit_cmd_file_close_all (GtkAction   *action,
 }
 
 /* Quit */
-#ifdef OS_OSX
 static void
-quit_all ()
+quit_all (void)
 {
        GList *windows;
        GList *item;
@@ -1948,21 +1947,18 @@ quit_all ()
 
        g_list_free (windows);
 }
-#endif
 
 void
 _gedit_cmd_file_quit (GtkAction   *action,
-                    GeditWindow *window)
+                      GeditWindow *window)
 {
        gedit_debug (DEBUG_COMMANDS);
 
-#ifdef OS_OSX
-       if (action != NULL)
+       if (window == NULL)
        {
                quit_all ();
                return;
        }
-#endif
 
        g_return_if_fail (!(gedit_window_get_state (window) &
                            (GEDIT_WINDOW_STATE_SAVING |


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