Commit 27dea8e5 authored by Laurent Montel's avatar Laurent Montel 😁

Rename step1

parent a949cc36
......@@ -18,57 +18,57 @@
#include "contactgrantleeprintaddressobject.h"
using namespace KAddressBookGrantlee;
ContactGrantleePrintAddressObject::ContactGrantleePrintAddressObject(const KContacts::Address &address, QObject *parent)
ContactGrantleeAddressObject::ContactGrantleeAddressObject(const KContacts::Address &address, QObject *parent)
: QObject(parent),
mAddress(address)
{
}
ContactGrantleePrintAddressObject::~ContactGrantleePrintAddressObject()
ContactGrantleeAddressObject::~ContactGrantleeAddressObject()
{
}
QString ContactGrantleePrintAddressObject::type() const
QString ContactGrantleeAddressObject::type() const
{
return KContacts::Address::typeLabel(mAddress.type());
}
QString ContactGrantleePrintAddressObject::street() const
QString ContactGrantleeAddressObject::street() const
{
return mAddress.street();
}
QString ContactGrantleePrintAddressObject::postOfficeBox() const
QString ContactGrantleeAddressObject::postOfficeBox() const
{
return mAddress.postOfficeBox();
}
QString ContactGrantleePrintAddressObject::locality() const
QString ContactGrantleeAddressObject::locality() const
{
return mAddress.locality();
}
QString ContactGrantleePrintAddressObject::region() const
QString ContactGrantleeAddressObject::region() const
{
return mAddress.region();
}
QString ContactGrantleePrintAddressObject::postalCode() const
QString ContactGrantleeAddressObject::postalCode() const
{
return mAddress.postalCode();
}
QString ContactGrantleePrintAddressObject::country() const
QString ContactGrantleeAddressObject::country() const
{
return mAddress.country();
}
QString ContactGrantleePrintAddressObject::label() const
QString ContactGrantleeAddressObject::label() const
{
return mAddress.label();
}
QString ContactGrantleePrintAddressObject::formattedAddress() const
QString ContactGrantleeAddressObject::formattedAddress() const
{
return mAddress.formattedAddress().replace(QStringLiteral("\n"), QStringLiteral("<br>"));
}
......@@ -21,7 +21,7 @@
#include <KContacts/Addressee>
namespace KAddressBookGrantlee
{
class ContactGrantleePrintAddressObject : public QObject
class ContactGrantleeAddressObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString type READ type)
......@@ -35,8 +35,8 @@ class ContactGrantleePrintAddressObject : public QObject
Q_PROPERTY(QString formattedAddress READ formattedAddress)
public:
explicit ContactGrantleePrintAddressObject(const KContacts::Address &address, QObject *parent = Q_NULLPTR);
~ContactGrantleePrintAddressObject();
explicit ContactGrantleeAddressObject(const KContacts::Address &address, QObject *parent = Q_NULLPTR);
~ContactGrantleeAddressObject();
QString type() const;
QString street() const;
......
......@@ -24,23 +24,23 @@ inline QString loadCustom(const KContacts::Addressee &contact, const QString &ke
return contact.custom(QStringLiteral("KADDRESSBOOK"), key);
}
ContactGrantleePrintCryptoObject::ContactGrantleePrintCryptoObject(const KContacts::Addressee &address, QObject *parent)
ContactGrantleeCryptoObject::ContactGrantleeCryptoObject(const KContacts::Addressee &address, QObject *parent)
: QObject(parent),
mAddress(address)
{
}
ContactGrantleePrintCryptoObject::~ContactGrantleePrintCryptoObject()
ContactGrantleeCryptoObject::~ContactGrantleeCryptoObject()
{
}
QString ContactGrantleePrintCryptoObject::signaturePreference() const
QString ContactGrantleeCryptoObject::signaturePreference() const
{
return Kleo::signingPreferenceToLabel(Kleo::stringToSigningPreference(loadCustom(mAddress, QStringLiteral("CRYPTOSIGNPREF"))));
}
QString ContactGrantleePrintCryptoObject::cryptoPreference() const
QString ContactGrantleeCryptoObject::cryptoPreference() const
{
return Kleo::encryptionPreferenceToLabel(Kleo::stringToEncryptionPreference(loadCustom(mAddress, QStringLiteral("CRYPTOENCRYPTPREF"))));
}
......@@ -21,14 +21,14 @@
#include <KContacts/Addressee>
namespace KAddressBookGrantlee
{
class ContactGrantleePrintCryptoObject : public QObject
class ContactGrantleeCryptoObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString signaturePreference READ signaturePreference)
Q_PROPERTY(QString cryptoPreference READ cryptoPreference)
public:
explicit ContactGrantleePrintCryptoObject(const KContacts::Addressee &address, QObject *parent = Q_NULLPTR);
~ContactGrantleePrintCryptoObject();
explicit ContactGrantleeCryptoObject(const KContacts::Addressee &address, QObject *parent = Q_NULLPTR);
~ContactGrantleeCryptoObject();
QString signaturePreference() const;
QString cryptoPreference() const;
......
......@@ -18,7 +18,7 @@
#include "contactgrantleeprintemail.h"
using namespace KAddressBookGrantlee;
ContactGrantleePrintEmail::ContactGrantleePrintEmail(const KContacts::Addressee &addressee, const KContacts::Email &email, QObject *parent)
ContactGrantleeEmail::ContactGrantleeEmail(const KContacts::Addressee &addressee, const KContacts::Email &email, QObject *parent)
: QObject(parent),
mEmail(email),
mAddressee(addressee)
......@@ -26,25 +26,25 @@ ContactGrantleePrintEmail::ContactGrantleePrintEmail(const KContacts::Addressee
}
ContactGrantleePrintEmail::~ContactGrantleePrintEmail()
ContactGrantleeEmail::~ContactGrantleeEmail()
{
}
QString ContactGrantleePrintEmail::email() const
QString ContactGrantleeEmail::email() const
{
const QString email = mEmail.mail();
return mAddressee.fullEmail(email);
}
bool ContactGrantleePrintEmail::preferred() const
bool ContactGrantleeEmail::preferred() const
{
const QStringList value = mEmail.parameters().value(QStringLiteral("type"));
//Validate PREF and pref
return value.contains(QStringLiteral("pref"), Qt::CaseInsensitive);
}
QString ContactGrantleePrintEmail::emailFormatted() const
QString ContactGrantleeEmail::emailFormatted() const
{
const QString email = mEmail.mail();
const QString fullEmail = QString::fromLatin1(QUrl::toPercentEncoding(mAddressee.fullEmail(email)));
......
......@@ -25,15 +25,15 @@
namespace KAddressBookGrantlee
{
class ContactGrantleePrintEmail : public QObject
class ContactGrantleeEmail : public QObject
{
Q_OBJECT
Q_PROPERTY(QString emailFormatted READ emailFormatted)
Q_PROPERTY(QString email READ email)
Q_PROPERTY(bool preferred READ preferred)
public:
explicit ContactGrantleePrintEmail(const KContacts::Addressee &addressee, const KContacts::Email &email, QObject *parent = Q_NULLPTR);
~ContactGrantleePrintEmail();
explicit ContactGrantleeEmail(const KContacts::Addressee &addressee, const KContacts::Email &email, QObject *parent = Q_NULLPTR);
~ContactGrantleeEmail();
QString emailFormatted() const;
QString email() const;
......
......@@ -19,19 +19,19 @@
using namespace KAddressBookGrantlee;
ContactGrantleePrintGeoObject::ContactGrantleePrintGeoObject(const KContacts::Geo &geo, QObject *parent)
ContactGrantleeGeoObject::ContactGrantleeGeoObject(const KContacts::Geo &geo, QObject *parent)
: QObject(parent),
mGeo(geo)
{
}
ContactGrantleePrintGeoObject::~ContactGrantleePrintGeoObject()
ContactGrantleeGeoObject::~ContactGrantleeGeoObject()
{
}
float ContactGrantleePrintGeoObject::latitude() const
float ContactGrantleeGeoObject::latitude() const
{
if (mGeo.isValid()) {
return mGeo.latitude();
......@@ -39,7 +39,7 @@ float ContactGrantleePrintGeoObject::latitude() const
return -1;
}
float ContactGrantleePrintGeoObject::longitude() const
float ContactGrantleeGeoObject::longitude() const
{
if (mGeo.isValid()) {
return mGeo.longitude();
......@@ -47,7 +47,7 @@ float ContactGrantleePrintGeoObject::longitude() const
return -1;
}
QString ContactGrantleePrintGeoObject::toString() const
QString ContactGrantleeGeoObject::toString() const
{
QString result;
if (mGeo.isValid()) {
......@@ -56,7 +56,7 @@ QString ContactGrantleePrintGeoObject::toString() const
return result;
}
bool ContactGrantleePrintGeoObject::isValid() const
bool ContactGrantleeGeoObject::isValid() const
{
return mGeo.isValid();
}
......@@ -24,7 +24,7 @@
namespace KAddressBookGrantlee
{
class ContactGrantleePrintGeoObject : public QObject
class ContactGrantleeGeoObject : public QObject
{
Q_OBJECT
Q_PROPERTY(float latitude READ latitude)
......@@ -33,8 +33,8 @@ class ContactGrantleePrintGeoObject : public QObject
Q_PROPERTY(bool isValid READ isValid)
public:
explicit ContactGrantleePrintGeoObject(const KContacts::Geo &geo, QObject *parent = Q_NULLPTR);
~ContactGrantleePrintGeoObject();
explicit ContactGrantleeGeoObject(const KContacts::Geo &geo, QObject *parent = Q_NULLPTR);
~ContactGrantleeGeoObject();
float latitude() const;
float longitude() const;
......
......@@ -19,24 +19,24 @@
#include "akonadi/contact/improtocols.h"
using namespace KAddressBookGrantlee;
ContactGrantleePrintImObject::ContactGrantleePrintImObject(const QString &type, const QString &address, QObject *parent)
ContactGrantleeImObject::ContactGrantleeImObject(const QString &type, const QString &address, QObject *parent)
: QObject(parent),
mType(type),
mAddress(address)
{
}
ContactGrantleePrintImObject::~ContactGrantleePrintImObject()
ContactGrantleeImObject::~ContactGrantleeImObject()
{
}
QString ContactGrantleePrintImObject::type() const
QString ContactGrantleeImObject::type() const
{
return IMProtocols::self()->name(mType);
}
QString ContactGrantleePrintImObject::address() const
QString ContactGrantleeImObject::address() const
{
return mAddress;
}
......@@ -20,15 +20,15 @@
#include <QObject>
namespace KAddressBookGrantlee
{
class ContactGrantleePrintImObject : public QObject
class ContactGrantleeImObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString type READ type)
Q_PROPERTY(QString address READ address)
public:
explicit ContactGrantleePrintImObject(const QString &type, const QString &address, QObject *parent = Q_NULLPTR);
~ContactGrantleePrintImObject();
explicit ContactGrantleeImObject(const QString &type, const QString &address, QObject *parent = Q_NULLPTR);
~ContactGrantleeImObject();
QString type() const;
QString address() const;
......
......@@ -18,27 +18,27 @@
#include "contactgrantleeprintphoneobject.h"
using namespace KAddressBookGrantlee;
ContactGrantleePrintPhoneObject::ContactGrantleePrintPhoneObject(const KContacts::PhoneNumber &phone, QObject *parent)
ContactGrantleePhoneObject::ContactGrantleePhoneObject(const KContacts::PhoneNumber &phone, QObject *parent)
: QObject(parent),
mPhoneNumber(phone)
{
}
ContactGrantleePrintPhoneObject::~ContactGrantleePrintPhoneObject()
ContactGrantleePhoneObject::~ContactGrantleePhoneObject()
{
}
QString ContactGrantleePrintPhoneObject::type() const
QString ContactGrantleePhoneObject::type() const
{
return mPhoneNumber.typeLabel();
}
QString ContactGrantleePrintPhoneObject::number() const
QString ContactGrantleePhoneObject::number() const
{
return mPhoneNumber.number();
}
bool ContactGrantleePrintPhoneObject::preferred() const
bool ContactGrantleePhoneObject::preferred() const
{
return (mPhoneNumber.type() & KContacts::PhoneNumber::Pref);
}
......@@ -21,7 +21,7 @@
#include <KContacts/PhoneNumber>
namespace KAddressBookGrantlee
{
class ContactGrantleePrintPhoneObject : public QObject
class ContactGrantleePhoneObject : public QObject
{
Q_OBJECT
Q_PROPERTY(QString type READ type)
......@@ -29,8 +29,8 @@ class ContactGrantleePrintPhoneObject : public QObject
Q_PROPERTY(bool preferred READ preferred)
public:
explicit ContactGrantleePrintPhoneObject(const KContacts::PhoneNumber &phone, QObject *parent = Q_NULLPTR);
~ContactGrantleePrintPhoneObject();
explicit ContactGrantleePhoneObject(const KContacts::PhoneNumber &phone, QObject *parent = Q_NULLPTR);
~ContactGrantleePhoneObject();
QString type() const;
QString number() const;
......
......@@ -20,24 +20,24 @@
using namespace KAddressBookGrantlee;
ContactGrantleePrintWebSite::ContactGrantleePrintWebSite(const KContacts::ResourceLocatorUrl &resourceLocator, QObject *parent)
ContactGrantleeWebSite::ContactGrantleeWebSite(const KContacts::ResourceLocatorUrl &resourceLocator, QObject *parent)
: QObject(parent),
mResourceLocator(resourceLocator)
{
}
ContactGrantleePrintWebSite::~ContactGrantleePrintWebSite()
ContactGrantleeWebSite::~ContactGrantleeWebSite()
{
}
QString ContactGrantleePrintWebSite::url() const
QString ContactGrantleeWebSite::url() const
{
return mResourceLocator.url().toDisplayString();
}
bool ContactGrantleePrintWebSite::preferred() const
bool ContactGrantleeWebSite::preferred() const
{
const QStringList value = mResourceLocator.parameters().value(QStringLiteral("type"));
//Validate PREF and pref
......
......@@ -22,14 +22,14 @@
#include <KContacts/ResourceLocatorUrl>
namespace KAddressBookGrantlee
{
class ContactGrantleePrintWebSite : public QObject
class ContactGrantleeWebSite : public QObject
{
Q_OBJECT
Q_PROPERTY(QString url READ url)
Q_PROPERTY(bool preferred READ preferred)
public:
explicit ContactGrantleePrintWebSite(const KContacts::ResourceLocatorUrl &resourceLocator, QObject *parent = Q_NULLPTR);
~ContactGrantleePrintWebSite();
explicit ContactGrantleeWebSite(const KContacts::ResourceLocatorUrl &resourceLocator, QObject *parent = Q_NULLPTR);
~ContactGrantleeWebSite();
QString url() const;
bool preferred() const;
private:
......
......@@ -40,25 +40,25 @@ ContactGrantleePrintObject::ContactGrantleePrintObject(const KContacts::Addresse
const auto addresses = address.addresses();
mListAddress.reserve(addresses.size());
Q_FOREACH (const KContacts::Address &addr, addresses) {
mListAddress << new ContactGrantleePrintAddressObject(addr);
mListAddress << new ContactGrantleeAddressObject(addr);
}
const auto webSites = address.extraUrlList();
mListWebSite.reserve(webSites.size());
Q_FOREACH (const KContacts::ResourceLocatorUrl &webSite, webSites) {
mListWebSite << new ContactGrantleePrintWebSite(webSite);
mListWebSite << new ContactGrantleeWebSite(webSite);
}
const auto phoneNumbers = address.phoneNumbers();
mListPhones.reserve(phoneNumbers.size());
Q_FOREACH (const KContacts::PhoneNumber &phone, phoneNumbers) {
mListPhones << new ContactGrantleePrintPhoneObject(phone);
mListPhones << new ContactGrantleePhoneObject(phone);
}
const auto emails = address.emailList();
mListEmails.reserve(emails.size());
Q_FOREACH (const KContacts::Email &email, emails) {
mListEmails << new ContactGrantleePrintEmail(mAddress, email);
mListEmails << new ContactGrantleeEmail(mAddress, email);
}
......@@ -70,12 +70,12 @@ ContactGrantleePrintObject::ContactGrantleePrintObject(const KContacts::Addresse
QString key = custom.left(pos);
key.remove(QStringLiteral("-All"));
const QString value = custom.mid(pos + 1);
mListIm << new ContactGrantleePrintImObject(key, value);
mListIm << new ContactGrantleeImObject(key, value);
}
}
}
mGeoObject = new ContactGrantleePrintGeoObject(address.geo());
mCryptoObject = new ContactGrantleePrintCryptoObject(address);
mGeoObject = new ContactGrantleeGeoObject(address.geo());
mCryptoObject = new ContactGrantleeCryptoObject(address);
}
ContactGrantleePrintObject::~ContactGrantleePrintObject()
......
......@@ -22,12 +22,12 @@
#include <QVariant>
namespace KAddressBookGrantlee
{
class ContactGrantleePrintAddressObject;
class ContactGrantleePrintPhoneObject;
class ContactGrantleePrintImObject;
class ContactGrantleePrintGeoObject;
class ContactGrantleePrintCryptoObject;
class ContactGrantleePrintWebSite;
class ContactGrantleeAddressObject;
class ContactGrantleePhoneObject;
class ContactGrantleeImObject;
class ContactGrantleeGeoObject;
class ContactGrantleeCryptoObject;
class ContactGrantleeWebSite;
class ContactGrantleePrintObject : public QObject
{
Q_OBJECT
......@@ -116,8 +116,8 @@ private:
QList<QObject *> mListIm;
QList<QObject *> mListWebSite;
QList<QObject *> mListEmails;
ContactGrantleePrintGeoObject *mGeoObject;
ContactGrantleePrintCryptoObject *mCryptoObject;
ContactGrantleeGeoObject *mGeoObject;
ContactGrantleeCryptoObject *mCryptoObject;
KContacts::Addressee mAddress;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment