Differential D8805 Diff 22298 plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp
Changeset View
Changeset View
Standalone View
Standalone View
plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp
Show First 20 Lines • Show All 173 Lines • ▼ Show 20 Line(s) | |||||
174 | } | 174 | } | ||
175 | 175 | | |||
176 | CompilerPointer CompilerProvider::defaultCompiler() const | 176 | CompilerPointer CompilerProvider::defaultCompiler() const | ||
177 | { | 177 | { | ||
178 | if (m_defaultProvider) | 178 | if (m_defaultProvider) | ||
179 | return m_defaultProvider; | 179 | return m_defaultProvider; | ||
180 | 180 | | |||
181 | auto rt = ICore::self()->runtimeController()->currentRuntime(); | 181 | auto rt = ICore::self()->runtimeController()->currentRuntime(); | ||
182 | const auto path = QFile::decodeName(rt->getenv("PATH")).split(':'); | 182 | QChar delim = QChar(':'); | ||
mwolff: use http://doc.qt.io/qt-5/qdir.html#listSeparator
i.e.:
```
const auto path = QFile… | |||||
183 | #ifdef Q_OS_WIN | ||||
184 | delim = QChar(';'); | ||||
185 | #endif | ||||
186 | const auto path = QFile::decodeName(rt->getenv("PATH")).split(delim); | ||||
183 | 187 | | |||
184 | for ( const CompilerPointer& compiler : m_compilers ) { | 188 | for ( const CompilerPointer& compiler : m_compilers ) { | ||
185 | const bool absolutePath = QDir::isAbsolutePath(compiler->path()); | 189 | const bool absolutePath = QDir::isAbsolutePath(compiler->path()); | ||
186 | if ((absolutePath && QFileInfo::exists(rt->pathInHost(Path(compiler->path())).toLocalFile())) | 190 | if ((absolutePath && QFileInfo::exists(rt->pathInHost(Path(compiler->path())).toLocalFile())) | ||
187 | || QStandardPaths::findExecutable( compiler->path(), path).isEmpty() ) { | 191 | || QStandardPaths::findExecutable( compiler->path(), path).isEmpty() ) { | ||
188 | continue; | 192 | continue; | ||
189 | } | 193 | } | ||
190 | 194 | | |||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |
use http://doc.qt.io/qt-5/qdir.html#listSeparator
i.e.: