diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-10-26 11:53:45 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2018-10-26 11:53:49 +0300 |
commit | 2d2e3cf53192918299d24f2ceb5e864e04ebc520 (patch) | |
tree | fc0046000c6fe073a4a4bfbfb0bf27bb8d6b2c8d /gtk | |
parent | SCNR: Avoid forward declarations, just move the functions before their use (diff) | |
download | online-2d2e3cf53192918299d24f2ceb5e864e04ebc520.tar.gz online-2d2e3cf53192918299d24f2ceb5e864e04ebc520.zip |
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.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/mobile.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gtk/mobile.cpp b/gtk/mobile.cpp index 61d5d6c91f..a819972cbf 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" |