kit/ChildSession.cpp | 2 +- kit/ChildSession.hpp | 9 ++++----- kit/Kit.cpp | 2 +- kit/Kit.hpp | 4 ++-- test/WhiteBoxTests.cpp | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-)
New commits: commit 87b85ff8f0761a3461cb2615b0f70670865cdaef Author: Tor Lillqvist <[email protected]> AuthorDate: Wed Sep 12 19:05:01 2018 +0300 Commit: Tor Lillqvist <[email protected]> CommitDate: Wed Sep 12 19:27:23 2018 +0300 Be consistent in how we name "interface" abstract classes We already use a suffix "Interface" for SocketHandlerInterface, so rename IDocumentManager to DocumentManagerInterface. Naming "interface" classes with an "I" prefix is C# and COM style. Sure, that is a convention as good as any other, but let's try to be consistent within this rather small code-base. Change-Id: I9c356df327debd780f23ed2b2e6d6e630328861e diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index d5324f4ad..a8380fc81 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -40,7 +40,7 @@ std::recursive_mutex ChildSession::Mutex; ChildSession::ChildSession(const std::string& id, const std::string& jailId, - IDocumentManager& docManager) : + DocumentManagerInterface& docManager) : Session("ToMaster-" + id, id, false), _jailId(jailId), _docManager(docManager), diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp index b690d95cd..4071ee466 100644 --- a/kit/ChildSession.hpp +++ b/kit/ChildSession.hpp @@ -32,9 +32,8 @@ enum class LokEventTargetEnum Window }; -/// An abstract interface that defines the -/// DocumentManager interface and functionality. -class IDocumentManager +// An abstract interface. +class DocumentManagerInterface { public: /// Reqest loading a document, or a new view, if one exists. @@ -142,7 +141,7 @@ public: // used by downloadas to construct jailed path. ChildSession(const std::string& id, const std::string& jailId, - IDocumentManager& docManager); + DocumentManagerInterface& docManager); virtual ~ChildSession(); bool getStatus(const char* buffer, int length); @@ -221,7 +220,7 @@ private: private: const std::string _jailId; - IDocumentManager& _docManager; + DocumentManagerInterface& _docManager; std::queue<std::chrono::steady_clock::time_point> _cursorInvalidatedEvent; const unsigned _eventStorageIntervalMs = 15*1000; diff --git a/kit/Kit.cpp b/kit/Kit.cpp index 278000392..f67617a8f 100644 --- a/kit/Kit.cpp +++ b/kit/Kit.cpp @@ -752,7 +752,7 @@ static FILE* ProcSMapsFile = nullptr; /// per process. But for security reasons don't. /// However, we could have a loolkit instance /// per user or group of users (a trusted circle). -class Document : public Runnable, public IDocumentManager +class Document : public Runnable, public DocumentManagerInterface { public: /// We have two types of password protected documents diff --git a/kit/Kit.hpp b/kit/Kit.hpp index b2c768baa..19543e733 100644 --- a/kit/Kit.hpp +++ b/kit/Kit.hpp @@ -71,13 +71,13 @@ bool globalPreinit(const std::string& loTemplate); /// Wrapper around private Document::ViewCallback(). void documentViewCallback(const int type, const char* p, void* data); -class IDocumentManager; +class DocumentManagerInterface; /// Descriptor class used to link a LOK /// callback to a specific view. struct CallbackDescriptor { - IDocumentManager* const Doc; + DocumentManagerInterface* const Doc; const int ViewId; }; diff --git a/test/WhiteBoxTests.cpp b/test/WhiteBoxTests.cpp index 580df11e3..a85b09fbd 100644 --- a/test/WhiteBoxTests.cpp +++ b/test/WhiteBoxTests.cpp @@ -323,8 +323,8 @@ void WhiteBoxTests::testRegexListMatcher_Init() CPPUNIT_ASSERT(matcher.match("192.168..")); } -/// A stub IDocumentManager implementation for unit test purposes. -class DummyDocument : public IDocumentManager +/// A stub DocumentManagerInterface implementation for unit test purposes. +class DummyDocument : public DocumentManagerInterface { std::shared_ptr<TileQueue> _tileQueue; std::mutex _mutex; _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
