forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user