From 12881dd4c450690afffaa551893b079907364557 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 30 Mar 2010 18:59:15 +0000 Subject: [PATCH] On Windows, add qBittorrent executable folder to PATH environment variable --- src/searchengine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/searchengine.cpp b/src/searchengine.cpp index f953fcbd7..a7571bf6f 100644 --- a/src/searchengine.cpp +++ b/src/searchengine.cpp @@ -74,6 +74,11 @@ SearchEngine::SearchEngine(GUI *parent, Bittorrent *BTSession) : QWidget(parent) // Creating Search Process searchProcess = new QProcess(this); QStringList env = QProcess::systemEnvironment(); +#ifdef Q_WS_WIN + // add qBittorrent executable folder to PATH environment variable + qDebug("qBittorrent executable path: %s", qPrintable(qApp->applicationDirPath())); + env.replaceInStrings(QRegExp("^PATH=(.*)", Qt::CaseInsensitive), "PATH=\\1;"+qApp->applicationDirPath()); +#endif searchProcess->setEnvironment(env); connect(searchProcess, SIGNAL(started()), this, SLOT(searchStarted())); connect(searchProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readSearchOutput()));