libreofficekit/qa/gtktiledviewer/gtv-application.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
New commits: commit fb2045ee7f113b9f6252b216ebb17544e730c410 Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Wed May 27 18:08:20 2020 +0300 Commit: Tor Lillqvist <t...@collabora.com> CommitDate: Thu May 28 10:37:49 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> diff --git a/libreofficekit/qa/gtktiledviewer/gtv-application.cxx b/libreofficekit/qa/gtktiledviewer/gtv-application.cxx index 8b54b7f951f9..4268d4e1962a 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-application.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-application.cxx @@ -51,15 +51,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