Ref T231, Ref T236, Ref T238 made command parsing function mandatory for contexts

* we can send commands to any context
* to send to all contexts use the facade
* application relays to facade
This commit is contained in:
Klaus Basan
2018-01-28 04:46:52 +01:00
parent ebd916f6d8
commit bdda413386
7 changed files with 18 additions and 13 deletions

View File

@@ -23,6 +23,7 @@
#include <QObject>
#include <QString>
#include <QtGlobal>
#include <QStringBuilder>
namespace BlackMisc { class CLogCategoryList; }
namespace BlackCore
@@ -125,9 +126,16 @@ namespace BlackCore
//! Debug enabled?
bool isDebugEnabled() const;
// ---------------------------------------------------------------
// All context must implement those functions
// ---------------------------------------------------------------
//! Id and path name for round trip protection
virtual QString getPathAndContextId() const = 0;
//! Parse a given command line
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) = 0;
signals:
//! Log or debug values changed
void changedLogOrDebugSettings();
@@ -145,7 +153,7 @@ namespace BlackCore
//! Path and context id
QString buildPathAndContextId(const QString &path) const
{
return QString(path) + ":" + QString::number(this->getUniqueId());
return path % QStringLiteral(":") % QString::number(this->getUniqueId());
}
//! Relay signals from this class