MailImporter

filterinfo.cpp
1/*
2 SPDX-FileCopyrightText: 2000 Hans Dijkema <kmailcvt@hum.org>
3 SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
4
5 SPDX-License-Identifier: GPL-2.0-or-later
6*/
7
8#include "filterinfo.h"
9#include "filterinfogui.h"
10
11using namespace MailImporter;
12
13class Q_DECL_HIDDEN FilterInfo::FilterInfoPrivate
14{
15public:
16 FilterInfoPrivate()
17 {
18 }
19
20 ~FilterInfoPrivate()
21 {
22 delete m_filterInfoGui;
23 m_filterInfoGui = nullptr;
24 }
25
26 bool m_removeDupMsg = false;
27 FilterInfoGui *m_filterInfoGui = nullptr;
28 static bool s_terminateASAP;
29};
30
31bool FilterInfo::FilterInfoPrivate::s_terminateASAP = false;
32
33FilterInfo::FilterInfo()
34 : d(new FilterInfoPrivate)
35{
36 FilterInfoPrivate::s_terminateASAP = false;
37}
38
39FilterInfo::~FilterInfo() = default;
40
41void FilterInfo::setFilterInfoGui(FilterInfoGui *filterinfogui)
42{
43 delete d->m_filterInfoGui;
44 d->m_filterInfoGui = filterinfogui;
45}
46
47void FilterInfo::setStatusMessage(const QString &status)
48{
49 if (d->m_filterInfoGui) {
50 d->m_filterInfoGui->setStatusMessage(status);
51 }
52}
53
54void FilterInfo::setFrom(const QString &from)
55{
56 if (d->m_filterInfoGui) {
57 d->m_filterInfoGui->setFrom(from);
58 }
59}
60
61void FilterInfo::setTo(const QString &to)
62{
63 if (d->m_filterInfoGui) {
64 d->m_filterInfoGui->setTo(to);
65 }
66}
67
68void FilterInfo::setCurrent(const QString &current)
69{
70 if (d->m_filterInfoGui) {
71 d->m_filterInfoGui->setCurrent(current);
72 }
73}
74
75void FilterInfo::setCurrent(int percent)
76{
77 if (d->m_filterInfoGui) {
78 d->m_filterInfoGui->setCurrent(percent);
79 }
80}
81
82void FilterInfo::setOverall(int percent)
83{
84 if (d->m_filterInfoGui) {
85 d->m_filterInfoGui->setOverall(percent);
86 }
87}
88
89void FilterInfo::addInfoLogEntry(const QString &log)
90{
91 if (d->m_filterInfoGui) {
92 d->m_filterInfoGui->addInfoLogEntry(log);
93 }
94}
95
96void FilterInfo::addErrorLogEntry(const QString &log)
97{
98 if (d->m_filterInfoGui) {
99 d->m_filterInfoGui->addErrorLogEntry(log);
100 }
101}
102
103void FilterInfo::clear()
104{
105 if (d->m_filterInfoGui) {
106 d->m_filterInfoGui->clear();
107 }
108}
109
110void FilterInfo::alert(const QString &message)
111{
112 if (d->m_filterInfoGui) {
113 d->m_filterInfoGui->alert(message);
114 }
115}
116
117void FilterInfo::terminateASAP()
118{
119 FilterInfoPrivate::s_terminateASAP = true;
120}
121
122bool FilterInfo::shouldTerminate() const
123{
124 return FilterInfoPrivate::s_terminateASAP;
125}
126
127void FilterInfo::setRemoveDupMessage(bool removeDupMessage)
128{
129 d->m_removeDupMsg = removeDupMessage;
130}
131
132bool FilterInfo::removeDupMessage() const
133{
134 return d->m_removeDupMsg;
135}
136
137QWidget *FilterInfo::parentWidget() const
138{
139 if (d->m_filterInfoGui) {
140 return d->m_filterInfoGui->parent();
141 }
142 return nullptr;
143}
The FilterInfoGui class.
The FilterInfo class.
Definition filterinfo.h:21
Q_SCRIPTABLE CaptureState status()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:08:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.