Allow to open log window via command line to already running client
authorOlivier Goffart <ogoffart@woboq.com>
Mon, 3 Dec 2018 10:20:46 +0000 (11:20 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:27 +0000 (10:58 +0100)
Issue: #4098

src/gui/application.cpp

index e25f1c280b1d945fb09329aadeb9b6f422fcbe2e..90f81d45d69cd7cccd552dee0352955060805e89 100644 (file)
@@ -520,8 +520,12 @@ void Application::slotParseMessage(const QString &msg, QObject *)
     if (msg.startsWith(QLatin1String("MSG_PARSEOPTIONS:"))) {
         const int lengthOfMsgPrefix = 17;
         QStringList options = msg.mid(lengthOfMsgPrefix).split(QLatin1Char('|'));
+        _showLogWindow = false;
         parseOptions(options);
         setupLogging();
+        if (_showLogWindow) {
+            _gui->slotToggleLogBrowser(); // _showLogWindow is set in parseOptions.
+        }
     } else if (msg.startsWith(QLatin1String("MSG_SHOWMAINDIALOG"))) {
         qCInfo(lcApplication) << "Running for" << _startedAt.elapsed() / 1000.0 << "sec";
         if (_startedAt.elapsed() < 10 * 1000) {