From e5755b7d283bf1700358f2eaa3e9fb7e3997955e Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sun, 24 Mar 2024 15:36:02 +0100 Subject: [PATCH] refactor: Directly get HTML help string from parser The context returns CSimpleCommandParser::commandsHtmlHelp() as well --- src/blackcore/context/contextapplication.h | 3 --- src/blackcore/context/contextapplicationempty.h | 7 ------- src/blackcore/context/contextapplicationimpl.cpp | 5 ----- src/blackcore/context/contextapplicationimpl.h | 3 --- src/blackcore/context/contextapplicationproxy.cpp | 5 ----- src/blackcore/context/contextapplicationproxy.h | 3 --- src/blackgui/components/commandinput.cpp | 5 +---- 7 files changed, 1 insertion(+), 30 deletions(-) diff --git a/src/blackcore/context/contextapplication.h b/src/blackcore/context/contextapplication.h index e29bd3030..2292d8f02 100644 --- a/src/blackcore/context/contextapplication.h +++ b/src/blackcore/context/contextapplication.h @@ -149,9 +149,6 @@ namespace BlackCore //! Forward to facade virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override; - //! The HTML help for dot commands - virtual QString dotCommandsHtmlHelp() const = 0; - protected: static constexpr int PingIdentifiersMs = 20000; //!< how often identifiers are pinged diff --git a/src/blackcore/context/contextapplicationempty.h b/src/blackcore/context/contextapplicationempty.h index 2959c5fce..8054b388d 100644 --- a/src/blackcore/context/contextapplicationempty.h +++ b/src/blackcore/context/contextapplicationempty.h @@ -131,13 +131,6 @@ namespace BlackCore logEmptyContextWarning(Q_FUNC_INFO); return BlackMisc::CIdentifier(); } - - //! \copydoc IContextApplication::dotCommandsHtmlHelp - virtual QString dotCommandsHtmlHelp() const override - { - logEmptyContextWarning(Q_FUNC_INFO); - return QString(); - } }; } // namespace } // namespace diff --git a/src/blackcore/context/contextapplicationimpl.cpp b/src/blackcore/context/contextapplicationimpl.cpp index e9654773e..deb75bee0 100644 --- a/src/blackcore/context/contextapplicationimpl.cpp +++ b/src/blackcore/context/contextapplicationimpl.cpp @@ -146,9 +146,4 @@ namespace BlackCore::Context if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO; } return this->identifier(); } - - QString CContextApplication::dotCommandsHtmlHelp() const - { - return CSimpleCommandParser::commandsHtmlHelp(); - } } // ns diff --git a/src/blackcore/context/contextapplicationimpl.h b/src/blackcore/context/contextapplicationimpl.h index 257bb95dc..2136a91b4 100644 --- a/src/blackcore/context/contextapplicationimpl.h +++ b/src/blackcore/context/contextapplicationimpl.h @@ -83,9 +83,6 @@ namespace BlackCore //! \copydoc BlackCore::Context::IContextApplication::getApplicationIdentifier virtual BlackMisc::CIdentifier getApplicationIdentifier() const override; - //! \copydoc BlackCore::Context::IContextApplication::dotCommandsHtmlHelp - virtual QString dotCommandsHtmlHelp() const override; - protected: //! Constructor CContextApplication(CCoreFacadeConfig::ContextMode mode, CCoreFacade *runtime); diff --git a/src/blackcore/context/contextapplicationproxy.cpp b/src/blackcore/context/contextapplicationproxy.cpp index 6e2d6de23..b3a8f0157 100644 --- a/src/blackcore/context/contextapplicationproxy.cpp +++ b/src/blackcore/context/contextapplicationproxy.cpp @@ -129,11 +129,6 @@ namespace BlackCore::Context return m_dBusInterface->callDBusRet(QLatin1String("getApplicationIdentifier")); } - QString CContextApplicationProxy::dotCommandsHtmlHelp() const - { - return m_dBusInterface->callDBusRet(QLatin1String("dotCommandsHtmlHelp")); - } - void CContextApplicationProxy::reRegisterApplications() { if (!m_dBusInterface) { return; } diff --git a/src/blackcore/context/contextapplicationproxy.h b/src/blackcore/context/contextapplicationproxy.h index c7344f83b..57e65058f 100644 --- a/src/blackcore/context/contextapplicationproxy.h +++ b/src/blackcore/context/contextapplicationproxy.h @@ -86,9 +86,6 @@ namespace BlackCore //! \copydoc BlackCore::Context::IContextApplication::getApplicationIdentifier virtual BlackMisc::CIdentifier getApplicationIdentifier() const override; - //! \copydoc BlackCore::Context::IContextApplication::dotCommandsHtmlHelp - virtual QString dotCommandsHtmlHelp() const override; - //! Used to test if there is a core running? //! \note creates and connects via proxy object, so not meant for very frequent tests //! \sa CDBusServer::isDBusAvailable as lightweight, but less accurate alternative diff --git a/src/blackgui/components/commandinput.cpp b/src/blackgui/components/commandinput.cpp index bfafeae35..ac7438d28 100644 --- a/src/blackgui/components/commandinput.cpp +++ b/src/blackgui/components/commandinput.cpp @@ -81,12 +81,9 @@ namespace BlackGui::Components void CCommandInput::setCommandToolTip() { - const bool context = (sGui && sGui->getIContextApplication()); if (m_showToolTip) { - this->setToolTip(context ? - sGui->getIContextApplication()->dotCommandsHtmlHelp() : - CSimpleCommandParser::commandsHtmlHelp()); + this->setToolTip(CSimpleCommandParser::commandsHtmlHelp()); } else {