refactor: Directly get HTML help string from parser

The context returns CSimpleCommandParser::commandsHtmlHelp() as well
This commit is contained in:
Lars Toenning
2024-03-24 15:36:02 +01:00
parent 607c57ebb8
commit e5755b7d28
7 changed files with 1 additions and 30 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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);

View File

@@ -129,11 +129,6 @@ namespace BlackCore::Context
return m_dBusInterface->callDBusRet<BlackMisc::CIdentifier>(QLatin1String("getApplicationIdentifier"));
}
QString CContextApplicationProxy::dotCommandsHtmlHelp() const
{
return m_dBusInterface->callDBusRet<QString>(QLatin1String("dotCommandsHtmlHelp"));
}
void CContextApplicationProxy::reRegisterApplications()
{
if (!m_dBusInterface) { return; }

View File

@@ -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

View File

@@ -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
{