mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-30 20:28:05 -06:00
committed by
GitHub
parent
45babc336d
commit
33aaa867b5
@@ -674,9 +674,7 @@ void Application::runExternalProgram(const QString &programTemplate, const BitTo
|
||||
QProcess proc;
|
||||
proc.setProgram(command);
|
||||
proc.setArguments(args);
|
||||
#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0))
|
||||
proc.setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
|
||||
#endif
|
||||
|
||||
if (proc.startDetached())
|
||||
{
|
||||
|
||||
@@ -1642,11 +1642,7 @@ void SessionImpl::endStartup(ResumeSessionContext *context)
|
||||
auto wakeupCheckTimer = new QTimer(this);
|
||||
connect(wakeupCheckTimer, &QTimer::timeout, this, [this]
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0))
|
||||
const bool hasSystemSlept = m_wakeupCheckTimestamp.durationElapsed() > 100s;
|
||||
#else
|
||||
const bool hasSystemSlept = m_wakeupCheckTimestamp.elapsed() > std::chrono::milliseconds(100s).count();
|
||||
#endif
|
||||
if (hasSystemSlept)
|
||||
{
|
||||
LogMsg(tr("System wake-up event detected. Re-announcing to all the trackers..."));
|
||||
|
||||
@@ -42,7 +42,7 @@ SearchDownloadHandler::SearchDownloadHandler(const QString &pluginName, const QS
|
||||
, m_downloadProcess {new QProcess(this)}
|
||||
{
|
||||
m_downloadProcess->setProcessEnvironment(m_manager->proxyEnvironment());
|
||||
#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0))
|
||||
#ifdef Q_OS_UNIX
|
||||
m_downloadProcess->setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
|
||||
#endif
|
||||
connect(m_downloadProcess, qOverload<int, QProcess::ExitStatus>(&QProcess::finished)
|
||||
|
||||
@@ -72,7 +72,7 @@ SearchHandler::SearchHandler(const QString &pattern, const QString &category, co
|
||||
// Load environment variables (proxy)
|
||||
m_searchProcess->setProcessEnvironment(m_manager->proxyEnvironment());
|
||||
m_searchProcess->setProgram(Utils::ForeignApps::pythonInfo().executableName);
|
||||
#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0))
|
||||
#ifdef Q_OS_UNIX
|
||||
m_searchProcess->setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -546,7 +546,7 @@ void SearchPluginManager::update()
|
||||
{
|
||||
QProcess nova;
|
||||
nova.setProcessEnvironment(proxyEnvironment());
|
||||
#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0))
|
||||
#ifdef Q_OS_UNIX
|
||||
nova.setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace
|
||||
info = {};
|
||||
|
||||
QProcess proc;
|
||||
#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(6, 6, 0))
|
||||
#ifdef Q_OS_UNIX
|
||||
proc.setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
|
||||
#endif
|
||||
proc.start(exeName, {u"--version"_s}, QIODevice::ReadOnly);
|
||||
|
||||
@@ -176,9 +176,7 @@ void Utils::Gui::openFolderSelect(const Path &path)
|
||||
const int lineMaxLength = 64;
|
||||
|
||||
QProcess proc;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0)
|
||||
proc.setUnixProcessParameters(QProcess::UnixProcessFlag::CloseFileDescriptors);
|
||||
#endif
|
||||
proc.start(u"xdg-mime"_s, {u"query"_s, u"default"_s, u"inode/directory"_s});
|
||||
proc.waitForFinished();
|
||||
const auto output = QString::fromLocal8Bit(proc.readLine(lineMaxLength).simplified());
|
||||
|
||||
Reference in New Issue
Block a user