From 591fc12ffa094e1da419abc0b0acf1931e504608 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Wed, 15 Jun 2022 12:44:44 +0200 Subject: [PATCH] Python: remove static cast of client interface in client constructor Change-Id: I475a2b79438b8392085f1d9bf2cdb8b7369efa68 Reviewed-by: Christian Stenger --- src/plugins/python/pythonlanguageclient.cpp | 4 ++-- src/plugins/python/pythonlanguageclient.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/python/pythonlanguageclient.cpp b/src/plugins/python/pythonlanguageclient.cpp index b129a069049..2a4ea8c7d97 100644 --- a/src/plugins/python/pythonlanguageclient.cpp +++ b/src/plugins/python/pythonlanguageclient.cpp @@ -181,9 +181,9 @@ PyLSClient *clientForPython(const FilePath &python) return client; } -PyLSClient::PyLSClient(BaseClientInterface *interface) +PyLSClient::PyLSClient(PyLSInterface *interface) : Client(interface) - , m_extraCompilerOutputDir(static_cast(interface)->m_extraPythonPath.path()) + , m_extraCompilerOutputDir(interface->m_extraPythonPath.path()) { connect(this, &Client::initialized, this, &PyLSClient::updateConfiguration); connect(PythonSettings::instance(), &PythonSettings::pylsConfigurationChanged, diff --git a/src/plugins/python/pythonlanguageclient.h b/src/plugins/python/pythonlanguageclient.h index ed0c16b5893..c58103c5fbf 100644 --- a/src/plugins/python/pythonlanguageclient.h +++ b/src/plugins/python/pythonlanguageclient.h @@ -40,12 +40,13 @@ namespace Internal { class PySideUicExtraCompiler; class PythonLanguageServerState; +class PyLSInterface; class PyLSClient : public LanguageClient::Client { Q_OBJECT public: - explicit PyLSClient(LanguageClient::BaseClientInterface *interface); + explicit PyLSClient(PyLSInterface *interface); ~PyLSClient(); void openDocument(TextEditor::TextDocument *document) override;