Commit 6874534c authored by Stefan Gerlach's avatar Stefan Gerlach
Browse files

plugins: fix path to server on Windows

parent 173339e6
Pipeline #59416 canceled with stage
in 5 minutes and 12 seconds
......@@ -70,7 +70,11 @@ Cantor::Backend::Capabilities RBackend::capabilities() const
bool RBackend::requirementsFullfilled(QString* const reason) const
{
#ifdef Q_OS_WIN
const QString& path = QStandardPaths::findExecutable(QLatin1String("cantor_rserver.exe"));
#else
const QString& path = QStandardPaths::findExecutable(QLatin1String("cantor_rserver"));
#endif
return Cantor::Backend::checkExecutable(QLatin1String("Cantor RServer"), path, reason);
}
......
......@@ -56,7 +56,11 @@ void RSession::login()
m_process = new QProcess(this);
m_process->setProcessChannelMode(QProcess::ForwardedErrorChannel);
#ifndef Q_OS_WIN
m_process->start(QStandardPaths::findExecutable(QLatin1String("cantor_rserver.exe")));
#else
m_process->start(QStandardPaths::findExecutable(QLatin1String("cantor_rserver")));
#endif
m_process->waitForStarted();
m_process->waitForReadyRead();
......
......@@ -72,8 +72,13 @@ void JuliaSession::login()
m_process = new KProcess(this);
m_process->setOutputChannelMode(KProcess::OnlyStdoutChannel);
#ifdef Q_OS_WIN
(*m_process)
<< QStandardPaths::findExecutable(QLatin1String("cantor_juliaserver.exe"));
#else
(*m_process)
<< QStandardPaths::findExecutable(QLatin1String("cantor_juliaserver"));
#endif
connect(m_process, &QProcess::errorOccurred, this, &JuliaSession::reportServerProcessError);
......
......@@ -99,7 +99,11 @@ KConfigSkeleton* PythonBackend::config() const
bool PythonBackend::requirementsFullfilled(QString* const reason) const
{
#ifdef Q_OS_WIN
const QString& path = QStandardPaths::findExecutable(QLatin1String("cantor_pythonserver.exe"));
#else
const QString& path = QStandardPaths::findExecutable(QLatin1String("cantor_pythonserver"));
#endif
return Cantor::Backend::checkExecutable(QLatin1String("Cantor Python Server"), path, reason);
}
......
......@@ -79,11 +79,12 @@ void PythonSession::login()
m_process = new QProcess(this);
m_process->setProcessChannelMode(QProcess::ForwardedErrorChannel);
const QString& serverExecutablePath = QStandardPaths::findExecutable(QLatin1String("cantor_pythonserver"));
#ifdef Q_OS_WIN
const QString& serverExecutablePath = QStandardPaths::findExecutable(QLatin1String("cantor_pythonserver.exe"));
// On Windows QProcess can't handle paths with spaces, so add escaping
m_process->start(QLatin1String("\"") + serverExecutablePath + QLatin1String("\""));
#else
const QString& serverExecutablePath = QStandardPaths::findExecutable(QLatin1String("cantor_pythonserver"));
m_process->start(serverExecutablePath);
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment