libreofficekit/qa/gtktiledviewer/gtv-application.cxx |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 7277f9c8577186cbb36fd4f4308aeabb73543844
Author:     Tor Lillqvist <t...@collabora.com>
AuthorDate: Wed May 27 18:08:20 2020 +0300
Commit:     Tor Lillqvist <t...@collabora.com>
CommitDate: Tue Jun 16 09:38:31 2020 +0200

    Make gtktiledviewer accept multiple documents to open
    
    It doesn't really work that well, though. With the right combination
    of different kinds of documents on the command line, it will even
    crash.
    
    Change-Id: Iccab34a714288fd04c52a21881b6256cfcb86081
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94980
    Tested-by: Jenkins
    Reviewed-by: Tor Lillqvist <t...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96361
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/libreofficekit/qa/gtktiledviewer/gtv-application.cxx 
b/libreofficekit/qa/gtktiledviewer/gtv-application.cxx
index b6598991f44b..26a0346e30b0 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-application.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-application.cxx
@@ -45,15 +45,18 @@ gtv_application_activate(GApplication*)
 }
 
 static void
-gtv_application_open(GApplication* app, GFile** file, gint /*nFiles*/, const 
gchar* /*hint*/)
+gtv_application_open(GApplication* app, GFile** file, gint nFiles, const 
gchar* /*hint*/)
 {
-    // TODO: add some option to create a new view for existing document
-    // For now, this just opens a new document
-    GtvApplicationWindow* window = 
GTV_APPLICATION_WINDOW(gtv_application_window_new(GTK_APPLICATION(app)));
-    gtk_window_present(GTK_WINDOW(window));
+    for (gint i = 0; i < nFiles; i++)
+    {
+        // TODO: add some option to create a new view for existing document
+        // For now, this just opens a new document
+        GtvApplicationWindow* window = 
GTV_APPLICATION_WINDOW(gtv_application_window_new(GTK_APPLICATION(app)));
+        gtk_window_present(GTK_WINDOW(window));
 
-    GtvApplicationPrivate* priv = getPrivate(GTV_APPLICATION(app));
-    gtv_application_window_load_document(window, priv->m_pRenderingArgs, 
std::string(g_file_get_path(file[0])));
+        GtvApplicationPrivate* priv = getPrivate(GTV_APPLICATION(app));
+        gtv_application_window_load_document(window, priv->m_pRenderingArgs, 
std::string(g_file_get_path(file[i])));
+    }
 }
 
 static void
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to