[education/rkward] rkward: Fix some Windows specific quirks

Thomas Friedrichsmeier null at kde.org
Thu Jun 16 22:19:13 BST 2022


Git commit b27174be3a1651087498597d1436067d5fb908d7 by Thomas Friedrichsmeier.
Committed on 16/06/2022 at 21:19.
Pushed by tfry into branch 'master'.

Fix some Windows specific quirks

M  +1    -1    rkward/autotests/core_test.cpp
M  +1    -1    rkward/windows/rkhtmlwindow.cpp

https://invent.kde.org/education/rkward/commit/b27174be3a1651087498597d1436067d5fb908d7

diff --git a/rkward/autotests/core_test.cpp b/rkward/autotests/core_test.cpp
index 2165a5a9..f8e11429 100644
--- a/rkward/autotests/core_test.cpp
+++ b/rkward/autotests/core_test.cpp
@@ -195,7 +195,7 @@ private slots:
 		runCommandAsync(new RCommand("message(\"222\\n\")", RCommand::App), chain, callback);
 		runCommandAsync(new RCommand("stop(\"333\\n\")", RCommand::App), chain2, callback);
 		runCommandAsync(new RCommand("warning(\"444\\n\")", RCommand::User), nullptr, callback);
-		runCommandAsync(new RCommand("system(\"echo 555\")", RCommand::App), chain, callback);
+		runCommandAsync(new RCommand("if (.Platform$OS.type == \"unix\") system(\"echo 555\") else invisible(system(\"cmd /c echo 555\"))", RCommand::App), chain, callback);
 		RInterface::closeChain(chain);
 		RInterface::closeChain(chain2);
 		waitForAllFinished();
diff --git a/rkward/windows/rkhtmlwindow.cpp b/rkward/windows/rkhtmlwindow.cpp
index fec23b48..3e25c99a 100644
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@ -219,7 +219,7 @@ protected:
 #ifndef NO_QT_WEBENGINE
 		// sigh: acceptNavigationRequest() does  not get called on the new page...
 		QMetaObject::Connection * const connection = new QMetaObject::Connection;
-		*connection = connect (ret, &RKWebPage::loadStarted, [ret, connection]() {
+		*connection = connect (ret, &RKWebPage::loadStarted, [ret, connection, this]() {  // capturing "this" makes MSVC happy
 			QObject::disconnect(*connection);
 			delete connection;
 			ret->acceptNavigationRequest (ret->url (), QWebEnginePage::NavigationTypeLinkClicked, true);


More information about the rkward-tracker mailing list