[Libreoffice-commits] online.git: loolwsd/LOOLForKit.cpp loolwsd/LOOLKit.cpp loolwsd/LOOLKit.hpp loolwsd/LOOLWSD.cpp

Michael Meeks michael.meeks at collabora.com
Thu Oct 6 10:19:15 UTC 2016


 loolwsd/LOOLForKit.cpp |    6 ++++--
 loolwsd/LOOLKit.cpp    |    8 ++++++--
 loolwsd/LOOLKit.hpp    |    3 ++-
 loolwsd/LOOLWSD.cpp    |    2 +-
 4 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 39b2c725d99a1fffed8e6418f4655cb46de27a0b
Author: Michael Meeks <michael.meeks at collabora.com>
Date:   Thu Oct 6 11:17:36 2016 +0100

    Improve and standardize version details: display on start.

diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp
index 376b91f..f6f428f 100644
--- a/loolwsd/LOOLForKit.cpp
+++ b/loolwsd/LOOLForKit.cpp
@@ -46,6 +46,7 @@ using Poco::Thread;
 using Poco::Util::Application;
 
 static bool NoCapsForKit = false;
+static bool DisplayVersion = false;
 static std::string UnitTestLibrary;
 static std::atomic<unsigned> ForkCounter( 0 );
 
@@ -154,7 +155,7 @@ static int createLibreOfficeKit(const std::string& childRoot,
             Thread::sleep(std::stoul(std::getenv("SLEEPKITFORDEBUGGER")) * 1000);
         }
 
-        lokit_main(childRoot, sysTemplate, loTemplate, loSubPath, NoCapsForKit, queryVersion);
+        lokit_main(childRoot, sysTemplate, loTemplate, loSubPath, NoCapsForKit, queryVersion, DisplayVersion);
     }
     else
     {
@@ -259,7 +260,8 @@ int main(int argc, char** argv)
         {
             std::string version, hash;
             Util::getVersionInfo(version, hash);
-            std::cout << "loolforkit " << version << " - " << hash << std::endl;
+            std::cout << "loolforkit version details: " << version << " - " << hash << std::endl;
+            DisplayVersion = true;
         }
 #if ENABLE_DEBUG
         // this process has various privileges - don't run arbitrary code.
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 9f5ba59..d381315 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -1353,7 +1353,8 @@ void lokit_main(const std::string& childRoot,
                 const std::string& loTemplate,
                 const std::string& loSubPath,
                 bool noCapabilities,
-                bool queryVersion)
+                bool queryVersion,
+                bool displayVersion)
 {
     // Reinitialize logging when forked.
     const bool logToFile = getenv("LOOL_LOGFILE");
@@ -1522,8 +1523,11 @@ void lokit_main(const std::string& childRoot,
         if (queryVersion)
         {
             char* versionInfo = loKit->getVersionInfo();
+            std::string versionString(versionInfo);
+            if (displayVersion)
+                std::cout << "office version details: " << versionString << std::endl;
             std::string encodedVersionStr;
-            URI::encode(std::string(versionInfo), "", encodedVersionStr);
+            URI::encode(versionString, "", encodedVersionStr);
             requestUrl += "&version=" + encodedVersionStr;
             free(versionInfo);
         }
diff --git a/loolwsd/LOOLKit.hpp b/loolwsd/LOOLKit.hpp
index a7e0dab..25684b1 100644
--- a/loolwsd/LOOLKit.hpp
+++ b/loolwsd/LOOLKit.hpp
@@ -14,7 +14,8 @@ void lokit_main(const std::string& childRoot,
                 const std::string& loTemplate,
                 const std::string& loSubPath,
                 bool noCapabilities,
-                bool queryVersionInfo);
+                bool queryVersionInfo,
+                bool displayVersion);
 
 bool globalPreinit(const std::string &loTemplate);
 /// Wrapper around private Document::ViewCallback().
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index 3542df9..f69c7dc 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -1832,7 +1832,7 @@ int LOOLWSD::main(const std::vector<std::string>& /*args*/)
     {
         std::string version, hash;
         Util::getVersionInfo(version, hash);
-        std::cout << "loolwsd " << version << " - " << hash << std::endl;
+        std::cout << "loolwsd version details: " << version << " - " << hash << std::endl;
     }
 
     initializeSSL();


More information about the Libreoffice-commits mailing list