8#include "addresseehelper_p.h"
11#include <KConfigGroup>
12#include <KLocalizedString>
14using namespace KContacts;
16Q_GLOBAL_STATIC(AddresseeHelper, s_self)
19AddresseeHelper *AddresseeHelper::self()
24AddresseeHelper::AddresseeHelper()
29AddresseeHelper::~AddresseeHelper() =
default;
33 for (
const auto &str : list) {
40void AddresseeHelper::initSettings()
46 mTitles.insert(
i18n(
"Dr."));
47 mTitles.insert(
i18n(
"Miss"));
48 mTitles.insert(
i18n(
"Mr."));
49 mTitles.insert(
i18n(
"Mrs."));
50 mTitles.insert(
i18n(
"Ms."));
51 mTitles.insert(
i18n(
"Prof."));
53 mSuffixes.insert(
i18n(
"I"));
54 mSuffixes.insert(
i18n(
"II"));
55 mSuffixes.insert(
i18n(
"III"));
56 mSuffixes.insert(
i18n(
"Jr."));
57 mSuffixes.insert(
i18n(
"Sr."));
59 mPrefixes.insert(QStringLiteral(
"van"));
60 mPrefixes.insert(QStringLiteral(
"von"));
61 mPrefixes.insert(QStringLiteral(
"de"));
64 KConfigGroup config(&_config, QStringLiteral(
"General"));
66 addToSet(config.readEntry(
"Prefixes",
QStringList()), mTitles);
67 addToSet(config.readEntry(
"Inclusions",
QStringList()), mPrefixes);
68 addToSet(config.readEntry(
"Suffixes",
QStringList()), mSuffixes);
69 mTreatAsFamilyName = config.readEntry(
"TreatAsFamilyName",
true);
72bool AddresseeHelper::containsTitle(
const QString &title)
const
74 return mTitles.contains(title);
77bool AddresseeHelper::containsPrefix(
const QString &prefix)
const
79 return mPrefixes.contains(prefix);
82bool AddresseeHelper::containsSuffix(
const QString &suffix)
const
84 return mSuffixes.contains(suffix);
87bool AddresseeHelper::treatAsFamilyName()
const
89 return mTreatAsFamilyName;
QString i18n(const char *text, const TYPE &arg...)
iterator insert(const T &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:06:34 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.