gtk/mobile.cpp |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 2d2e3cf53192918299d24f2ceb5e864e04ebc520
Author:     Tor Lillqvist <[email protected]>
AuthorDate: Fri Oct 26 11:53:45 2018 +0300
Commit:     Tor Lillqvist <[email protected]>
CommitDate: Fri Oct 26 11:53:49 2018 +0300

    Take path to document to edit on the command line
    
    Sure, could add more and more options to specify what LibreOffice
    installation to run against, etc, like gtktiledviewer. That is not a
    priority though, this is just a very basic testbed for now.

diff --git a/gtk/mobile.cpp b/gtk/mobile.cpp
index 61d5d6c91..a819972cb 100644
--- a/gtk/mobile.cpp
+++ b/gtk/mobile.cpp
@@ -270,6 +270,12 @@ static void handle_error_message(WebKitUserContentManager 
*manager,
 
 int main(int argc, char* argv[])
 {
+    if (argc != 2)
+    {
+        fprintf(stderr, "Usage: %s document\n", argv[0]);
+        exit(1);
+    }
+
     Log::initialize("Mobile", "trace", false, false, {});
     Util::setThreadName("main");
     fakeSocketSetLoggingCallback([](const std::string& line)
@@ -324,9 +330,7 @@ int main(int argc, char* argv[])
     g_signal_connect(main_window, "destroy", G_CALLBACK(destroyWindowCb), 
NULL);
     g_signal_connect(webView, "close", G_CALLBACK(closeWebViewCb), 
main_window);
 
-    system("cp " TOPSRCDIR "/test/data/hello.odt" " " TOPSRCDIR 
"/test/data/hello-world.odt");
-
-    fileURL = "file://" TOPSRCDIR "/test/data/hello-world.odt";
+    fileURL = "file://" + std::string(realpath(argv[1], NULL));
 
     std::string urlAndQuery =
         "file://" TOPSRCDIR "/loleaflet/dist/loleaflet.html"
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to