summaryrefslogtreecommitdiff
path: root/src/plugins/python/pythonlanguageclient.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2022-04-26 10:21:12 +0200
committerhjk <hjk@qt.io>2022-04-27 08:55:02 +0000
commit0da130c4eff1b829e968d7e63546aea2cad560fb (patch)
treeadc41fc6d593932aff836ca54d9d54750b76dbee /src/plugins/python/pythonlanguageclient.cpp
parent28cfdf388ae3e3ed7e073e98a83c737d889d887f (diff)
downloadqt-creator-0da130c4eff1b829e968d7e63546aea2cad560fb.tar.gz
Python: Apply 'static' pattern for singleton members
Plus some cosmetics. Change-Id: Ia2c8f425f0491fbe6a0bbf2e508857a5550e4d38 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/python/pythonlanguageclient.cpp')
-rw-r--r--src/plugins/python/pythonlanguageclient.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp
index bf131a73c1..76e6fc2cb3 100644
--- a/src/plugins/python/pythonlanguageclient.cpp
+++ b/src/plugins/python/pythonlanguageclient.cpp
@@ -614,7 +614,7 @@ void PyLSConfigureAssistant::openDocumentWithPython(const FilePath &python,
QPointer<CheckPylsWatcher> watcher = new CheckPylsWatcher();
// cancel and delete watcher after a 10 second timeout
- QTimer::singleShot(10000, this, [watcher]() {
+ QTimer::singleShot(10000, instance(), [watcher]() {
if (watcher) {
watcher->cancel();
watcher->deleteLater();
@@ -623,11 +623,11 @@ void PyLSConfigureAssistant::openDocumentWithPython(const FilePath &python,
connect(watcher,
&CheckPylsWatcher::resultReadyAt,
- this,
+ instance(),
[=, document = QPointer<TextEditor::TextDocument>(document)]() {
if (!document || !watcher)
return;
- handlePyLSState(python, watcher->result(), document);
+ instance()->handlePyLSState(python, watcher->result(), document);
watcher->deleteLater();
});
watcher->setFuture(Utils::runAsync(&checkPythonLanguageServer, python));