[gedit] Fix calling set_command_line_wait() for set of loaded files



commit 2e3b5aea0e8810e6946ce4daf64fceea9a9f47a9
Author: Ilya Novoselov <nullie yandex-team ru>
Date:   Sat May 9 16:59:56 2015 +0500

    Fix calling set_command_line_wait() for set of loaded files
    
    g_slist_foreach() call passed wrong arguments (GeditDocument*, NULL) to
    set_command_line_wait(GeditApp*, GeditTab*).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749068

 gedit/gedit-app.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/gedit/gedit-app.c b/gedit/gedit-app.c
index c95a507..251ad07 100644
--- a/gedit/gedit-app.c
+++ b/gedit/gedit-app.c
@@ -405,6 +405,15 @@ set_command_line_wait (GeditApp *app,
 }
 
 static void
+set_command_line_wait_doc (GeditDocument *doc,
+                          GeditApp      *app)
+{
+       GeditTab *tab = gedit_tab_get_from_document (doc);
+
+       set_command_line_wait (app, tab);
+}
+
+static void
 open_files (GApplication            *application,
            gboolean                 new_window,
            gboolean                 new_document,
@@ -474,7 +483,7 @@ open_files (GApplication            *application,
 
                if (command_line)
                {
-                       g_slist_foreach (loaded, (GFunc)set_command_line_wait, NULL);
+                       g_slist_foreach (loaded, (GFunc)set_command_line_wait_doc, GEDIT_APP (application));
                }
                g_slist_free (loaded);
        }


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