On Mon, Sep 28, 2026 at 10:14:16PM +0200, Pavel Sanda wrote:
> I'll keep posting next pacthes for various issues, but should not
> be that big in scope as was this stack - the largest shell-invocation
> surface is now gone.

Unreachable :system code since Enrico's c73eb3497a, not used for 15
years, time to say good bye.

Pavel
>From 228be3bc329deace5fd80c4e3948a8e37893b244 Mon Sep 17 00:00:00 2001
From: Pavel Sanda <[email protected]>
Date: Sun, 11 Oct 2026 22:23:25 +0200
Subject: [PATCH] Drop the dead #ifndef USE_QPROCESS branches

#define USE_QPROCESS is unconditionally enabled in both Systemcall.cpp
and filetools.cpp, so the #ifndef branches they guard have been
unreachable since c73eb3497a (2009).
Remove both branches, both defines and the scaffolding around them, so
USE_QPROCESS no longer appears in the tree. The live code is untouched.

Another possiblity to reintroduce shell gone.

Tier 01 DiD / dead-code: drop the unused non-QProcess branches

Assisted-by: Claude Opus 5
---
 src/support/Systemcall.cpp | 31 -------------------------------
 src/support/filetools.cpp  |  8 --------
 2 files changed, 39 deletions(-)

diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp
index a9bdde41e3..83897f21a2 100644
--- a/src/support/Systemcall.cpp
+++ b/src/support/Systemcall.cpp
@@ -33,9 +33,6 @@
 #include <QThread>
 #include <QCoreApplication>
 
-#define USE_QPROCESS
-
-
 struct Sleep : QThread
 {
 	static void millisec(unsigned long ms)
@@ -97,33 +94,6 @@ ProgressInterface * ProgressInterface::instance()
 
 
 
-// Reuse of instance
-#ifndef USE_QPROCESS
-int Systemcall::startscript(Starttype how, string const & what,
-			    string const & path, string const & lpath,
-			    bool /*process_events*/)
-{
-	string command =
-		to_filesystem8bit(from_utf8(latexEnvCmdPrefix(path, lpath)))
-		       + commandPrep(what);
-
-	if (how == DontWait) {
-		switch (os::shell()) {
-		case os::UNIX:
-			command += " &";
-			break;
-		case os::CMD_EXE:
-			command = "start /min " + command;
-			break;
-		}
-	} else if (os::shell() == os::CMD_EXE)
-		command = subst(command, "cmd /d /c ", "");
-
-	return ::system(command.c_str());
-}
-
-#else
-
 namespace {
 
 /*
@@ -826,4 +796,3 @@ vector<string> splitCommandTokens(string const & cmd)
 } // namespace lyx
 
 #include "moc_SystemcallPrivate.cpp"
-#endif
diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp
index 0fff08f5f8..7f26955050 100644
--- a/src/support/filetools.cpp
+++ b/src/support/filetools.cpp
@@ -66,8 +66,6 @@
 
 using namespace std;
 
-#define USE_QPROCESS
-
 namespace lyx {
 namespace support {
 
@@ -251,17 +249,11 @@ string const quoteName(string const & name, quote_style style)
 		// containing " or ', therefore we don't pass user filenames
 		// to child processes if possible. We store them in a python
 		// script instead, where we don't have these limitations.
-#ifndef USE_QPROCESS
-		return (os::shell() == os::UNIX) ?
-			'\'' + subst(name, "'", "\'\\\'\'") + '\'' :
-			'"' + name + '"';
-#else
 		// According to the QProcess parser, a single double
 		// quote is represented by three consecutive ones.
 		// Here we simply escape the double quote and let our
 		// simple parser in Systemcall.cpp do the substitution.
 		return '"' + subst(name, "\"", "\\\"") + '"';
-#endif
 	case quote_shell_filename:
 		return quoteName(os::external_path(name), quote_shell);
 	case quote_python:
-- 
2.39.5

-- 
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to