From 94f717bd3ca841a8a91cf9660f85fd278177764a Mon Sep 17 00:00:00 2001 From: David Schulz Date: Mon, 30 Sep 2019 10:00:20 +0200 Subject: Python: make pyls install kill timer a member Change-Id: I62515673ef65e87b2f23345aa52a22a86a2be763 Reviewed-by: Christian Stenger --- src/plugins/python/pythoneditor.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/plugins/python/pythoneditor.cpp') diff --git a/src/plugins/python/pythoneditor.cpp b/src/plugins/python/pythoneditor.cpp index 8b0c3b8454..6fbe46aaf9 100644 --- a/src/plugins/python/pythoneditor.cpp +++ b/src/plugins/python/pythoneditor.cpp @@ -207,8 +207,6 @@ public: void run() { - auto killTimer = new QTimer(&m_process); - connect(&m_process, QOverload::of(&QProcess::finished), this, @@ -221,7 +219,7 @@ public: &QProcess::readyReadStandardOutput, this, &PythonLSInstallHelper::outputAvailable); - connect(killTimer, &QTimer::timeout, [this]() { + connect(&m_killTimer, &QTimer::timeout, [this]() { SynchronousProcess::stopProcess(m_process); Core::MessageManager::write(tr("The Python language server installation timed out.")); }); @@ -237,7 +235,7 @@ public: Core::MessageManager::write(tr("Running '%1 %2' to install python language server") .arg(m_process.program(), m_process.arguments().join(' '))); - killTimer->start(5 /*minutes*/ * 60 * 1000); + m_killTimer.start(5 /*minutes*/ * 60 * 1000); } private: @@ -267,6 +265,7 @@ private: } QProcess m_process; + QTimer m_killTimer; const PythonForProject m_python; QPointer m_document; }; -- cgit v1.2.1