forked from qt-creator/qt-creator
Use more std::chrono and std::chrono_literals namespaces
Change-Id: Ib8c83988d7afe35d81b87ff8c5c87eef2082f12d Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -86,7 +86,8 @@ static PythonLanguageServerState checkPythonLanguageServer(const FilePath &pytho
|
||||
|
||||
Process pythonProcess;
|
||||
pythonProcess.setCommand({python, {"-m", "pip", "-V"}});
|
||||
pythonProcess.runBlocking(std::chrono::seconds(2));
|
||||
using namespace std::chrono_literals;
|
||||
pythonProcess.runBlocking(2s);
|
||||
if (pythonProcess.allOutput().startsWith("pip "))
|
||||
return {PythonLanguageServerState::CanBeInstalled, lspPath};
|
||||
return {PythonLanguageServerState::CanNotBeInstalled, FilePath()};
|
||||
|
||||
@@ -71,7 +71,8 @@ static Interpreter createInterpreter(const FilePath &python,
|
||||
Process pythonProcess;
|
||||
pythonProcess.setProcessChannelMode(QProcess::MergedChannels);
|
||||
pythonProcess.setCommand({python, {"--version"}});
|
||||
pythonProcess.runBlocking(std::chrono::seconds(1));
|
||||
using namespace std::chrono_literals;
|
||||
pythonProcess.runBlocking(1s);
|
||||
if (pythonProcess.result() == ProcessResult::FinishedWithSuccess)
|
||||
result.name = pythonProcess.cleanedStdOut().trimmed();
|
||||
if (result.name.isEmpty())
|
||||
|
||||
@@ -149,7 +149,8 @@ QString pythonName(const FilePath &pythonPath)
|
||||
if (name.isEmpty()) {
|
||||
Process pythonProcess;
|
||||
pythonProcess.setCommand({pythonPath, {"--version"}});
|
||||
pythonProcess.runBlocking(std::chrono::seconds(2));
|
||||
using namespace std::chrono_literals;
|
||||
pythonProcess.runBlocking(2s);
|
||||
if (pythonProcess.result() != ProcessResult::FinishedWithSuccess)
|
||||
return {};
|
||||
name = pythonProcess.allOutput().trimmed();
|
||||
|
||||
Reference in New Issue
Block a user