File indexing completed on 2024-12-15 03:44:58

0001 /*
0002     SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 #include "aggregator.h"
0008 
0009 #include <model/singlerowfilterproxymodel.h>
0010 
0011 using namespace KUserFeedback::Console;
0012 
0013 Aggregator::Aggregator() = default;
0014 Aggregator::~Aggregator() = default;
0015 
0016 Aggregation Aggregator::aggregation() const
0017 {
0018     return m_aggregation;
0019 }
0020 
0021 void Aggregator::setAggregation(const Aggregation& aggr)
0022 {
0023     m_aggregation = aggr;
0024 }
0025 
0026 QAbstractItemModel* Aggregator::sourceModel() const
0027 {
0028     return m_sourceModel;
0029 }
0030 
0031 void Aggregator::setSourceModel(QAbstractItemModel* model)
0032 {
0033     m_sourceModel = model;
0034 }
0035 
0036 QString Aggregator::displayName() const
0037 {
0038     return m_aggregation.name();
0039 }
0040 
0041 Aggregator::ChartModes Aggregator::chartModes() const
0042 {
0043     return None;
0044 }
0045 
0046 QAbstractItemModel* Aggregator::timeAggregationModel()
0047 {
0048     return nullptr;
0049 }
0050 
0051 QAbstractItemModel* Aggregator::singularAggregationModel()
0052 {
0053     if (!m_singularModel) {
0054         m_singularModel.reset(new SingleRowFilterProxyModel);
0055         m_singularModel->setSourceModel(timeAggregationModel());
0056     }
0057     return m_singularModel.get();
0058 }
0059 
0060 void Aggregator::setSingularTime(int row)
0061 {
0062     singularAggregationModel();
0063     m_singularModel->setRow(row);
0064 }
0065 
0066 QChart *Aggregator::singlularChart()
0067 {
0068     return nullptr;
0069 }
0070 
0071 QChart *Aggregator::timelineChart()
0072 {
0073     return nullptr;
0074 }