[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - libreofficekit/qa

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 15 16:22:09 UTC 2020


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

New commits:
commit 4358515b6683c3fffd9469791119c9a7c667508d
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed May 27 18:08:20 2020 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Jun 15 18:21:38 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 <tml at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96357
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/libreofficekit/qa/gtktiledviewer/gtv-application.cxx b/libreofficekit/qa/gtktiledviewer/gtv-application.cxx
index 7481076778eb..8df92cae76ff 100644
--- a/libreofficekit/qa/gtktiledviewer/gtv-application.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtv-application.cxx
@@ -34,15 +34,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


More information about the Libreoffice-commits mailing list