diff --git a/kaddressbookgrantlee/src/CMakeLists.txt b/kaddressbookgrantlee/src/CMakeLists.txt --- a/kaddressbookgrantlee/src/CMakeLists.txt +++ b/kaddressbookgrantlee/src/CMakeLists.txt @@ -4,7 +4,6 @@ widget/grantleecontactviewer.cpp formatter/grantleecontactformatter.cpp formatter/grantleecontactgroupformatter.cpp - formatter/grantleecontactutils.cpp contactobject/contactgrantleewrapper.cpp printing/grantleeprint.cpp ) diff --git a/kaddressbookgrantlee/src/formatter/grantleecontactutils.h b/kaddressbookgrantlee/src/formatter/grantleecontactutils.h deleted file mode 100644 --- a/kaddressbookgrantlee/src/formatter/grantleecontactutils.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2013-2019 Montel Laurent - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef GRANTLEECONTACTUTILS_H -#define GRANTLEECONTACTUTILS_H - -#include -namespace KAddressBookGrantlee { -class GrantleeContactUtils -{ -public: - GrantleeContactUtils(); - Q_REQUIRED_RESULT QString variableI18n(const QString &variable); - void insertVariableToQVariantHash(QVariantHash &contactI18n, const QString &variable); -}; -} -#endif // GRANTLEECONTACTUTILS_H diff --git a/kaddressbookgrantlee/src/formatter/grantleecontactutils.cpp b/kaddressbookgrantlee/src/formatter/grantleecontactutils.cpp deleted file mode 100644 --- a/kaddressbookgrantlee/src/formatter/grantleecontactutils.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - Copyright (C) 2013-2019 Montel Laurent - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; see the file COPYING. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "grantleecontactutils.h" - -#include -using namespace KAddressBookGrantlee; - -GrantleeContactUtils::GrantleeContactUtils() -{ -} - -void GrantleeContactUtils::insertVariableToQVariantHash(QVariantHash &contactI18n, const QString &variable) -{ - contactI18n.insert(variable, variableI18n(variable)); -} - -QString GrantleeContactUtils::variableI18n(const QString &variable) -{ - if (variable == QLatin1String("birthdayi18n")) { - return i18n("Birthday"); - } else if (variable == QLatin1String("anniversaryi18n")) { - return i18nc("The wedding anniversary of a contact", "Anniversary"); - } else if (variable == QLatin1String("emailsi18n")) { - return i18n("Emails"); - } else if (variable == QLatin1String("websitei18n")) { - return i18n("Website"); - } else if (variable == QLatin1String("blogUrli18n")) { - return i18n("Blog Feed"); - } else if (variable == QLatin1String("addressBookNamei18n")) { - return i18n("Address Book"); - } else if (variable == QLatin1String("notei18n")) { - return i18n("Note"); - } else if (variable == QLatin1String("departmenti18n")) { - return i18n("Department"); - } else if (variable == QLatin1String("Professioni18n")) { - return i18n("Profession"); - } else if (variable == QLatin1String("officei18n")) { - return i18n("Office"); - } else if (variable == QLatin1String("manageri18n")) { - return i18n("Manager's Name"); - } else if (variable == QLatin1String("assistanti18n")) { - return i18n("Assistant's Name"); - } else if (variable == QLatin1String("spousei18n")) { - return i18n("Partner's Name"); - } else if (variable == QLatin1String("imAddressi18n")) { - return i18n("IM Address"); - } else if (variable == QLatin1String("latitudei18n")) { - return i18n("Latitude"); - } else if (variable == QLatin1String("longitudei18n")) { - return i18n("Longitude"); - } else if (variable == QLatin1String("organizationi18n")) { - return i18n("Organization"); - } else if (variable == QLatin1String("namei18n")) { - return i18n("Name"); - } else if (variable == QLatin1String("titlei18n")) { - return i18n("Title"); - } else if (variable == QLatin1String("nextcontacti18n")) { - return i18n("Contact"); - } else { - return variable; - } -} diff --git a/kaddressbookgrantlee/src/printing/grantleeprint.cpp b/kaddressbookgrantlee/src/printing/grantleeprint.cpp --- a/kaddressbookgrantlee/src/printing/grantleeprint.cpp +++ b/kaddressbookgrantlee/src/printing/grantleeprint.cpp @@ -19,7 +19,6 @@ #include "grantleeprint.h" #include "contactobject/contactgrantleewrapper.h" -#include "formatter/grantleecontactutils.h" #include #include @@ -93,28 +92,6 @@ contactsList.push_back(QVariant::fromValue(ContactGrantleeWrapper(contact))); } QVariantHash mapping; - QVariantHash contactI18n; - GrantleeContactUtils grantleeContactUtil; - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("birthdayi18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("anniversaryi18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("emailsi18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("websitei18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("blogUrli18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("addressBookNamei18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("notei18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("departmenti18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("Professioni18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("officei18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("manageri18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("assistanti18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("spousei18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("imAddressi18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("latitudei18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("longitudei18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("organizationi18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("titlei18n")); - grantleeContactUtil.insertVariableToQVariantHash(contactI18n, QStringLiteral("nextcontacti18n")); - mapping.insert(QStringLiteral("contacti18n"), contactI18n); mapping.insert(QStringLiteral("contacts"), contactsList); return render(mapping);