texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Gavin D. Smith
Date: Wed, 30 Nov 2022 13:36:43 -0500 (EST)

branch: old/qt-info
commit ca5c45f19fea0843d9bed82ffd4fbdbe813c5b21
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Apr 19 14:31:27 2019 +0100

    disable welcome message
---
 js/docbrowser/mainwindow.cpp | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/js/docbrowser/mainwindow.cpp b/js/docbrowser/mainwindow.cpp
index 161b05d4b7..9bb318424c 100644
--- a/js/docbrowser/mainwindow.cpp
+++ b/js/docbrowser/mainwindow.cpp
@@ -104,6 +104,15 @@ MainWindow::setup_profile (QWebEngineProfile *profile)
 #define INFO_JS "info.js"
 #define QTINFO_JS "docbrowser/qtinfo.js"
 
+  QString config =
+R"(
+"use strict"; /* This must be the first thing in the script. */
+
+var INFO_CONFIG = {
+  show_welcome_message: false
+};
+)";
+
   QString script;
   QFile file;
   file.setFileName (QString(this->datadir)
@@ -120,8 +129,11 @@ MainWindow::setup_profile (QWebEngineProfile *profile)
   QByteArray b2 = file2.readAll();
   script2 = QString(b2);
 
+
+  /* Concatenate and run the scripts.  This makes sure they are run in the 
+     right order. */
   QWebEngineScript s1;
-  s1.setSourceCode(script + script2);
+  s1.setSourceCode(config + script + script2);
   s1.setRunsOnSubFrames(true);
   s1.setInjectionPoint(QWebEngineScript::DocumentCreation);
   s1.setWorldId(QWebEngineScript::MainWorld);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]