[education/rkward] rkward/rbackend: Simplification

Thomas Friedrichsmeier null at kde.org
Thu Jul 11 06:40:32 BST 2024


Git commit 79d74cf7368a145ee695276b983ab098ec5e1e8c by Thomas Friedrichsmeier.
Committed on 11/07/2024 at 05:40.
Pushed by tfry into branch 'master'.

Simplification

M  +2    -5    rkward/rbackend/rkrinterface.cpp

https://invent.kde.org/education/rkward/-/commit/79d74cf7368a145ee695276b983ab098ec5e1e8c

diff --git a/rkward/rbackend/rkrinterface.cpp b/rkward/rbackend/rkrinterface.cpp
index f8b6c3340..4e763f32c 100644
--- a/rkward/rbackend/rkrinterface.cpp
+++ b/rkward/rbackend/rkrinterface.cpp
@@ -455,11 +455,8 @@ void RInterface::handleRequest (RBackendRequest* request) {
 
 		QString cd_to = RKSettingsModuleGeneral::initialWorkingDirectory();
 		if (cd_to.isEmpty()) cd_to = QDir::currentPath();
-		if (cd_to.isEmpty()) { // we must be in a non-existent dir. The backend will know better...
-			RInterface::issueCommand(new RCommand("setwd(\".\")\n", RCommand::App | RCommand::Sync), chain);
-		} else {
-			RInterface::issueCommand(new RCommand("setwd(" + RObject::rQuote(cd_to) + ")\n", RCommand::App | RCommand::Sync), chain);
-		}
+		if (cd_to.isEmpty()) cd_to = QLatin1String("."); // we must be in a non-existent dir. cd'ing to "." will cause us to sync with the backend
+		RInterface::issueCommand(new RCommand("setwd(" + RObject::rQuote(cd_to) + ")\n", RCommand::App | RCommand::Sync), chain);
 	} else {
 		processRBackendRequest (request);
 	}


More information about the rkward-tracker mailing list