From 2cd4e14373af4b881354f09be7a8f1e00b6e859e Mon Sep 17 00:00:00 2001 From: Fawzi Mohamed Date: Wed, 22 Dec 2021 09:41:27 +0100 Subject: qmlls qlanguageserver: minor cleanups Fixes that do not affect the running code: Q_ENUM declaration, default constructor, clarifying comment Change-Id: Ic93dba58b33e4532fd16cabdc450fc3920b1ca55 Reviewed-by: Andrei Golubev (cherry picked from commit 2947d1a9ee588fda50580623ae9777775dcd20c1) --- tools/qmlls/qlanguageserver.cpp | 3 +-- tools/qmlls/qlanguageserver.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/qmlls/qlanguageserver.cpp b/tools/qmlls/qlanguageserver.cpp index e6408f6ad1..7ebc4faad1 100644 --- a/tools/qmlls/qlanguageserver.cpp +++ b/tools/qmlls/qlanguageserver.cpp @@ -65,8 +65,6 @@ QLanguageServer::QLanguageServer(const QJsonRpcTransport::DataHandler &h, QObjec d->notifySignals.registerHandlers(&d->protocol); } -QLanguageServer::~QLanguageServer() { } - QLanguageServerProtocol *QLanguageServer::protocol() { Q_D(QLanguageServer); @@ -167,6 +165,7 @@ void QLanguageServer::registerMethods(QJsonRpc::TypedRpc &typedRpc) QJsonValue id = doc.object()[u"id"]; { QMutexLocker l(&d->mutex); + // the normal case is d->runStatus == RunStatus::DidInitialize if (d->runStatus != RunStatus::DidInitialize) { if (d->runStatus == RunStatus::DidSetup && !doc.isNull() && doc.object()[u"method"].toString() diff --git a/tools/qmlls/qlanguageserver.h b/tools/qmlls/qlanguageserver.h index cf4babba00..721eb5478f 100644 --- a/tools/qmlls/qlanguageserver.h +++ b/tools/qmlls/qlanguageserver.h @@ -68,7 +68,6 @@ class QLanguageServer : public QObject Q_PROPERTY(bool isInitialized READ isInitialized) public: QLanguageServer(const QJsonRpcTransport::DataHandler &h, QObject *parent = nullptr); - ~QLanguageServer(); enum class RunStatus { NotSetup, SettingUp, @@ -79,6 +78,7 @@ public: Stopping, Stopped }; + Q_ENUM(RunStatus) QLanguageServerProtocol *protocol(); void finishSetup(); @@ -108,7 +108,6 @@ signals: private: void registerMethods(QJsonRpc::TypedRpc &typedRpc); void executeShutdown(); - Q_DISABLE_COPY(QLanguageServer) Q_DECLARE_PRIVATE(QLanguageServer) }; -- cgit v1.2.3