swift
loghistory.cpp
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2020 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #include "misc/loghistory.h"
7 
8 #include "misc/loghandler.h"
9 
10 namespace swift::misc
11 {
12  CLogHistory::CLogHistory(QObject *parent) : CListJournal(parent) {}
13 
14  CLogHistorySource::CLogHistorySource(QObject *parent) : CListMutator(parent)
15  {
17  [this](auto &&...args) { this->addElement(args...); });
18  }
19 
20  CLogHistoryReplica::CLogHistoryReplica(QObject *parent) : CListObserver(parent) {}
21 
22  void CLogHistoryReplica::onElementAdded(const CStatusMessage &msg) { emit elementAdded(msg); }
23 
24  void CLogHistoryReplica::onElementsReplaced(const CStatusMessageList &msgs) { emit elementsReplaced(msgs); }
25 } // namespace swift::misc
void localMessageLogged(const swift::misc::CStatusMessage &message)
Emitted when a message is logged in this process.
static CLogHandler * instance()
Return pointer to the CLogHandler singleton.
CLogHistory(QObject *parent=nullptr)
Constructor.
Definition: loghistory.cpp:12
void elementAdded(const swift::misc::CStatusMessage &msg)
Signal emitted for each new log message.
CLogHistoryReplica(QObject *parent=nullptr)
Constructor.
Definition: loghistory.cpp:20
void elementsReplaced(const swift::misc::CStatusMessageList &msgs)
Signal emitted when the whole history is updated wholesale.
CLogHistorySource(QObject *parent=nullptr)
Constructor.
Definition: loghistory.cpp:14
Streamable status message, e.g.
void addElement(const typename T::value_type &value)
Add list element.
Definition: listmutator.h:57
Free functions in swift::misc.