diff options
| author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2024-05-16 14:07:59 +0200 |
|---|---|---|
| committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2024-05-22 09:13:41 +0000 |
| commit | 982ad2424352f07877fb0a0af63df3790ebe165d (patch) | |
| tree | d6114a48b392e4399526aea78e0fb9637a244662 /src/plugins/python/pythonutils.cpp | |
| parent | d857af4cec9d1e3651f6c4759066ae953cd730c0 (diff) | |
CommandLine: Reuse new c'tor
Change-Id: Id154881b4f5d8c488e5c1f5e0f843d36bf838759
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/python/pythonutils.cpp')
| -rw-r--r-- | src/plugins/python/pythonutils.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/python/pythonutils.cpp b/src/plugins/python/pythonutils.cpp index 2e4cd4ed585..87156e3b9cc 100644 --- a/src/plugins/python/pythonutils.cpp +++ b/src/plugins/python/pythonutils.cpp @@ -121,11 +121,9 @@ void openPythonRepl(QObject *parent, const FilePath &file, ReplType type) return file.absolutePath(); }; - const auto args = QStringList{"-i"} + replImportArgs(file, type); const FilePath pythonCommand = detectPython(file); - Process process; - process.setCommand({pythonCommand, args}); + process.setCommand({pythonCommand, {"-i", replImportArgs(file, type)}}); process.setWorkingDirectory(workingDir(file)); process.setTerminalMode(TerminalMode::Detached); process.start(); @@ -201,7 +199,7 @@ static bool isUsableHelper(QHash<FilePath, bool> *cache, const QString &keyStrin if (it == cache->end()) { const Key key = keyFromString(keyString); Process process; - process.setCommand({python, QStringList{"-m", commandArg, "-h"}}); + process.setCommand({python, {"-m", commandArg, "-h"}}); process.runBlocking(); const bool usable = process.result() == ProcessResult::FinishedWithSuccess; it = cache->insert(python, usable); |
