Messagelib

headerstrategy.cpp
1/* -*- c++ -*-
2 headerstrategy.cpp
3
4 This file is part of KMail, the KDE mail client.
5 SPDX-FileCopyrightText: 2003 Marc Mutz <mutz@kde.org>
6
7 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
8
9 SPDX-License-Identifier: GPL-2.0-or-later
10*/
11
12#include "headerstrategy.h"
13
14//
15// HeaderStrategy abstract base:
16//
17using namespace MessageViewer;
18HeaderStrategy::HeaderStrategy() = default;
19
20HeaderStrategy::~HeaderStrategy() = default;
21
22QStringList HeaderStrategy::headersToDisplay() const
23{
24 return {};
25}
26
27QStringList HeaderStrategy::headersToHide() const
28{
29 return {};
30}
31
32bool HeaderStrategy::showHeader(const QString &header) const
33{
34 const QString headerLower(header.toLower());
35 if (headersToDisplay().contains(headerLower)) {
36 return true;
37 }
38 if (headersToHide().contains(headerLower)) {
39 return false;
40 }
41 return defaultPolicy() == Display;
42}
43
44QStringList HeaderStrategy::stringList(const char *const headers[], int numHeaders)
45{
46 QStringList sl;
47 sl.reserve(numHeaders);
48 for (int i = 0; i < numHeaders; ++i) {
49 sl.push_back(QLatin1StringView(headers[i]));
50 }
51 return sl;
52}
void push_back(const T &value)
void reserve(int alloc)
QString toLower() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:37:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.