MailImporter

filterinfo.cpp
1 /***************************************************************************
2  filters.cxx - description
3  -------------------
4  begin : Fri Jun 30 2000
5  copyright : (C) 2000 by Hans Dijkema
6  email : [email protected]
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 /* Copyright (c) 2012-2020 Laurent Montel <[email protected]> */
18 
19 #include "filterinfo.h"
20 #include "filterinfogui.h"
21 
22 using namespace MailImporter;
23 
24 class Q_DECL_HIDDEN FilterInfo::Private
25 {
26 public:
27  Private()
28  {
29  }
30 
31  ~Private()
32  {
33  delete m_filterInfoGui;
34  m_filterInfoGui = nullptr;
35  }
36 
37  bool m_removeDupMsg = false;
38  FilterInfoGui *m_filterInfoGui = nullptr;
39  static bool s_terminateASAP;
40 };
41 
42 bool FilterInfo::Private::s_terminateASAP = false;
43 
44 FilterInfo::FilterInfo()
45  : d(new Private)
46 {
47  Private::s_terminateASAP = false;
48 }
49 
50 FilterInfo::~FilterInfo()
51 {
52  delete d;
53 }
54 
55 void FilterInfo::setFilterInfoGui(FilterInfoGui *filterinfogui)
56 {
57  delete d->m_filterInfoGui;
58  d->m_filterInfoGui = filterinfogui;
59 }
60 
61 void FilterInfo::setStatusMessage(const QString &status)
62 {
63  if (d->m_filterInfoGui) {
64  d->m_filterInfoGui->setStatusMessage(status);
65  }
66 }
67 
68 void FilterInfo::setFrom(const QString &from)
69 {
70  if (d->m_filterInfoGui) {
71  d->m_filterInfoGui->setFrom(from);
72  }
73 }
74 
75 void FilterInfo::setTo(const QString &to)
76 {
77  if (d->m_filterInfoGui) {
78  d->m_filterInfoGui->setTo(to);
79  }
80 }
81 
82 void FilterInfo::setCurrent(const QString &current)
83 {
84  if (d->m_filterInfoGui) {
85  d->m_filterInfoGui->setCurrent(current);
86  }
87 }
88 
89 void FilterInfo::setCurrent(int percent)
90 {
91  if (d->m_filterInfoGui) {
92  d->m_filterInfoGui->setCurrent(percent);
93  }
94 }
95 
96 void FilterInfo::setOverall(int percent)
97 {
98  if (d->m_filterInfoGui) {
99  d->m_filterInfoGui->setOverall(percent);
100  }
101 }
102 
103 void FilterInfo::addInfoLogEntry(const QString &log)
104 {
105  if (d->m_filterInfoGui) {
106  d->m_filterInfoGui->addInfoLogEntry(log);
107  }
108 }
109 
110 void FilterInfo::addErrorLogEntry(const QString &log)
111 {
112  if (d->m_filterInfoGui) {
113  d->m_filterInfoGui->addErrorLogEntry(log);
114  }
115 }
116 
117 void FilterInfo::clear()
118 {
119  if (d->m_filterInfoGui) {
120  d->m_filterInfoGui->clear();
121  }
122 }
123 
124 void FilterInfo::alert(const QString &message)
125 {
126  if (d->m_filterInfoGui) {
127  d->m_filterInfoGui->alert(message);
128  }
129 }
130 
131 void FilterInfo::terminateASAP()
132 {
133  Private::s_terminateASAP = true;
134 }
135 
136 bool FilterInfo::shouldTerminate() const
137 {
138  return Private::s_terminateASAP;
139 }
140 
141 void FilterInfo::setRemoveDupMessage(bool removeDupMessage)
142 {
143  d->m_removeDupMsg = removeDupMessage;
144 }
145 
146 bool FilterInfo::removeDupMessage() const
147 {
148  return d->m_removeDupMsg;
149 }
150 
151 QWidget *FilterInfo::parentWidget() const
152 {
153  if (d->m_filterInfoGui) {
154  return d->m_filterInfoGui->parent();
155  }
156  return nullptr;
157 }
The FilterInfoGui class.
Definition: filterinfogui.h:29
The FilterInfo class.
Definition: filterinfo.h:30
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jul 5 2020 23:15:54 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.