File indexing completed on 2024-04-28 16:11:12

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "servererrorinfohistorymanager.h"
0008 #include "model/servererrorinfohistorymodel.h"
0009 
0010 ServerErrorInfoHistoryManager::ServerErrorInfoHistoryManager(QObject *parent)
0011     : QObject{parent}
0012     , mServerErrorInfoHistoryModel(new ServerErrorInfoHistoryModel(this))
0013 {
0014 }
0015 
0016 ServerErrorInfoHistoryManager::~ServerErrorInfoHistoryManager() = default;
0017 
0018 ServerErrorInfoHistoryManager *ServerErrorInfoHistoryManager::self()
0019 {
0020     static ServerErrorInfoHistoryManager s_self;
0021     return &s_self;
0022 }
0023 
0024 ServerErrorInfoHistoryModel *ServerErrorInfoHistoryManager::serverErrorInfoHistoryModel() const
0025 {
0026     return mServerErrorInfoHistoryModel;
0027 }
0028 
0029 void ServerErrorInfoHistoryManager::addServerErrorInfo(const ServerErrorInfo &info)
0030 {
0031     mServerErrorInfoHistoryModel->addServerErrorInfo(info);
0032     Q_EMIT newServerErrorInfo();
0033 }
0034 
0035 #include "moc_servererrorinfohistorymanager.cpp"