From bf9c16b8e78a87aa44c83ecb9e27956a78e8aa06 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Sat, 7 Dec 2024 16:44:34 +0000 Subject: [PATCH] Privatize KitQueue member of Document. It is no longer used externally. Signed-off-by: Michael Meeks Change-Id: I69ca1d6b01a4ca97b6d4815c21c76c5ce8c939e6 --- kit/Kit.cpp | 4 ++-- kit/Kit.hpp | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/kit/Kit.cpp b/kit/Kit.cpp index 90d1c02b2a224..889cf69780f81 100644 --- a/kit/Kit.cpp +++ b/kit/Kit.cpp @@ -748,7 +748,7 @@ Document::Document(const std::shared_ptr& loKit, const std::string& , _docId(docId) , _url(url) , _obfuscatedFileId(Uri::getFilenameFromURL(docKey)) - , _queue(std::make_shared()) + , _queue(new KitQueue()) , _websocketHandler(websocketHandler) , _modified(ModifiedState::UnModified) , _isBgSaveProcess(false) @@ -1145,7 +1145,7 @@ void Document::trimAfterInactivity() assert(descriptor && "Null callback data."); assert(descriptor->getDoc() && "Null Document instance."); - std::shared_ptr queue = descriptor->getDoc()->_queue; + std::unique_ptr &queue = descriptor->getDoc()->_queue; assert(queue && "Null KitQueue."); const std::string payload = p ? p : "(nil)"; diff --git a/kit/Kit.hpp b/kit/Kit.hpp index 74f261f3ebf56..1b41911274ade 100644 --- a/kit/Kit.hpp +++ b/kit/Kit.hpp @@ -393,8 +393,6 @@ class Document final : public std::enable_shared_from_this /// Are we currently performing a load ? bool isLoadOngoing() const { return _duringLoad > 0; } - std::shared_ptr getQueue() const { return _queue; } - LogUiCmd& getLogUiCmd() { return logUiCmd; } private: @@ -419,7 +417,7 @@ class Document final : public std::enable_shared_from_this #ifdef __ANDROID__ static std::shared_ptr _loKitDocumentForAndroidOnly; #endif - std::shared_ptr _queue; + std::unique_ptr _queue; // Connection to the coolwsd process std::shared_ptr _websocketHandler;