Refine environment variable scope

Previously the proxy environment variable will affect the qbt process globally. Now it is
limited to where it required.
This commit is contained in:
Chocobo1
2025-03-22 04:47:46 +08:00
parent 8c8a0ac54c
commit 943e403241
4 changed files with 55 additions and 43 deletions

View File

@@ -41,7 +41,7 @@ SearchDownloadHandler::SearchDownloadHandler(const QString &pluginName, const QS
, m_manager {manager}
, m_downloadProcess {new QProcess(this)}
{
m_downloadProcess->setEnvironment(QProcess::systemEnvironment());
m_downloadProcess->setProcessEnvironment(m_manager->proxyEnvironment());
#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0))
m_downloadProcess->setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
#endif