Commit d1cc4bcb authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

run git clang-format

parent b0c8bb75
......@@ -12,10 +12,10 @@
#include <KontactInterface/Core>
#include <QAction>
#include <KActionCollection>
#include "kaddressbookplugin_debug.h"
#include <KActionCollection>
#include <KLocalizedString>
#include <QAction>
#include <QIcon>
......@@ -30,34 +30,25 @@ KAddressBookPlugin::KAddressBookPlugin(KontactInterface::Core *core, const QVari
{
setComponentName(QStringLiteral("kaddressbook"), i18n("KAddressBook"));
QAction *action
= new QAction(QIcon::fromTheme(QStringLiteral("contact-new")),
i18nc("@action:inmenu", "New Contact..."), this);
QAction *action = new QAction(QIcon::fromTheme(QStringLiteral("contact-new")), i18nc("@action:inmenu", "New Contact..."), this);
actionCollection()->addAction(QStringLiteral("new_contact"), action);
connect(action, &QAction::triggered, this, &KAddressBookPlugin::slotNewContact);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_C));
//action->setHelpText(
// action->setHelpText(
// i18nc( "@info:status", "Create a new contact" ) );
action->setWhatsThis(
i18nc("@info:whatsthis",
"You will be presented with a dialog where you can create a new contact."));
action->setWhatsThis(i18nc("@info:whatsthis", "You will be presented with a dialog where you can create a new contact."));
insertNewAction(action);
action
= new QAction(QIcon::fromTheme(QStringLiteral("user-group-new")),
i18nc("@action:inmenu", "New Contact Group..."), this);
action = new QAction(QIcon::fromTheme(QStringLiteral("user-group-new")), i18nc("@action:inmenu", "New Contact Group..."), this);
actionCollection()->addAction(QStringLiteral("new_contactgroup"), action);
connect(action, &QAction::triggered, this, &KAddressBookPlugin::slotNewContactGroup);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_G));
//action->setHelpText(
// action->setHelpText(
// i18nc( "@info:status", "Create a new contact group" ) );
action->setWhatsThis(
i18nc("@info:whatsthis",
"You will be presented with a dialog where you can create a new contact group."));
action->setWhatsThis(i18nc("@info:whatsthis", "You will be presented with a dialog where you can create a new contact group."));
insertNewAction(action);
mUniqueAppWatcher = new KontactInterface::UniqueAppWatcher(
new KontactInterface::UniqueAppHandlerFactory<KAddressBookUniqueAppHandler>(), this);
mUniqueAppWatcher = new KontactInterface::UniqueAppWatcher(new KontactInterface::UniqueAppHandlerFactory<KAddressBookUniqueAppHandler>(), this);
}
KAddressBookPlugin::~KAddressBookPlugin()
......
......@@ -11,7 +11,8 @@
#include <KontactInterface/UniqueAppHandler>
namespace KontactInterface {
namespace KontactInterface
{
class Plugin;
}
......
This diff is collapsed.
......@@ -59,10 +59,10 @@ bool CategoryFilterProxyModel::filterAcceptsRow(int row, const QModelIndex &pare
const Akonadi::Item item = index.data(EntityTreeModel::ItemRole).value<Akonadi::Item>();
if (!d->filterEnabled) {
return true; // filter not enabled
return true; // filter not enabled
}
if (d->filterIdList.isEmpty()) {
return false; // nothing accepted
return false; // nothing accepted
}
// all accepted
if (d->filterIdList.at(0) == CategorySelectWidget::FilterAll) {
......@@ -84,14 +84,14 @@ bool CategoryFilterProxyModel::filterAcceptsRow(int row, const QModelIndex &pare
++validCategories;
Tag::Id id = cat.midRef(idx + 5).toInt();
if (d->filterIdList.contains(id)) {
return true; // a category matches filter
return true; // a category matches filter
}
}
}
}
if (validCategories > 0) {
return false; // categorised but no match
return false; // categorised but no match
} else {
return d->filterIdList.contains(CategorySelectWidget::FilterUntagged);
}
......@@ -99,7 +99,7 @@ bool CategoryFilterProxyModel::filterAcceptsRow(int row, const QModelIndex &pare
return d->filterIdList.contains(CategorySelectWidget::FilterGroups);
}
return true; // not a recognised item
return true; // not a recognised item
}
void CategoryFilterProxyModel::setFilterCategories(const QList<Akonadi::Tag::Id> &idList)
......
......@@ -69,4 +69,4 @@ private:
CategoryFilterProxyModelPrivate *const d_ptr;
};
#endif // CATEGORYFILTERPROXYMODEL_H
#endif // CATEGORYFILTERPROXYMODEL_H
......@@ -7,13 +7,13 @@
#include "categoryselectwidget.h"
#include "kaddressbook_debug.h"
#include <AkonadiCore/monitor.h>
#include <AkonadiCore/tagmodel.h>
#include <KLocalizedString>
#include <QToolButton>
#include <QHBoxLayout>
#include <QStandardItemModel>
#include <QTimer>
#include <QHBoxLayout>
#include <AkonadiCore/monitor.h>
#include <AkonadiCore/tagmodel.h>
#include <QToolButton>
#include <Libkdepim/KCheckComboBox>
......@@ -71,20 +71,16 @@ void CategorySelectWidgetPrivate::init()
checkCombo = new KPIM::KCheckComboBox;
checkCombo->setMinimumWidth(150);
checkCombo->setSqueezeText(true);
connect(checkCombo, &KPIM::KCheckComboBox::checkedItemsChanged,
this, &CategorySelectWidgetPrivate::slotCheckedItemsChanged);
connect(checkCombo, &KPIM::KCheckComboBox::checkedItemsChanged, this, &CategorySelectWidgetPrivate::slotCheckedItemsChanged);
hbox->addWidget(checkCombo);
auto monitor = new Monitor(this);
monitor->setTypeMonitored(Monitor::Tags);
tagModel = new Akonadi::TagModel(monitor, this);
connect(tagModel, &QAbstractItemModel::rowsInserted,
this, &CategorySelectWidgetPrivate::slotTagsInserted);
connect(tagModel, &QAbstractItemModel::rowsRemoved,
this, &CategorySelectWidgetPrivate::slotTagsRemoved);
connect(tagModel, &QAbstractItemModel::dataChanged,
this, &CategorySelectWidgetPrivate::slotTagsChanged);
connect(tagModel, &QAbstractItemModel::rowsInserted, this, &CategorySelectWidgetPrivate::slotTagsInserted);
connect(tagModel, &QAbstractItemModel::rowsRemoved, this, &CategorySelectWidgetPrivate::slotTagsRemoved);
connect(tagModel, &QAbstractItemModel::dataChanged, this, &CategorySelectWidgetPrivate::slotTagsChanged);
updateTimer = new QTimer(this);
updateTimer->setSingleShot(true);
......@@ -168,10 +164,8 @@ void CategorySelectWidgetPrivate::slotTagsInserted(const QModelIndex &parent, in
// FIXME: not tested (no way to create hierarchical tags at present)
if (parent != QModelIndex()) {
const auto parentId = tagModel->data(idx, TagModel::IdRole).value<Tag::Id>();
QModelIndexList matchList = itemModel()->match(itemModel()->index(0, 0), FILTER_ROLE,
parentId, 1,
Qt::MatchExactly | Qt::MatchRecursive);
if (matchList.count() == 1) { // found the parent tag
QModelIndexList matchList = itemModel()->match(itemModel()->index(0, 0), FILTER_ROLE, parentId, 1, Qt::MatchExactly | Qt::MatchRecursive);
if (matchList.count() == 1) { // found the parent tag
QModelIndex parentIndex = matchList.at(0);
itemModel()->itemFromIndex(parentIndex)->appendRow(it);
} else {
......@@ -261,7 +255,7 @@ QList<Akonadi::Tag::Id> CategorySelectWidgetPrivate::filterTags() const
filter.append(CategorySelectWidget::FilterAll);
}
//qCDebug(KADDRESSBOOK_LOG) << "filter" << filter;
// qCDebug(KADDRESSBOOK_LOG) << "filter" << filter;
return filter;
}
......
......@@ -7,8 +7,8 @@
#ifndef CATEGORYSELECTWIDGET_H
#define CATEGORYSELECTWIDGET_H
#include <QWidget>
#include <AkonadiCore/tag.h>
#include <QWidget>
class CategorySelectWidgetPrivate;
......@@ -41,9 +41,9 @@ public:
* Special @c Akonadi::Tag::Id values for filtering.
**/
enum FilterTag {
FilterAll = -2, /**< All items */
FilterUntagged = -3, /**< Untagged items */
FilterGroups = -4 /**< Contact groups */
FilterAll = -2, /**< All items */
FilterUntagged = -3, /**< Untagged items */
FilterGroups = -4 /**< Contact groups */
};
/**
......@@ -70,4 +70,4 @@ private:
CategorySelectWidgetPrivate *const d_ptr;
};
#endif // CATEGORYSELECTWIDGET_H
#endif // CATEGORYSELECTWIDGET_H
......@@ -7,16 +7,15 @@
#include "kaddressbook_config_plugins.h"
#include "kaddressbookconfigpluginlistwidget.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KLocalizedString>
#include <PimCommon/ConfigurePluginsWidget>
#include <KPluginFactory>
#include <PimCommon/ConfigurePluginsListWidget>
#include <PimCommon/ConfigurePluginsWidget>
#include <QHBoxLayout>
using namespace KAddressBook;
K_PLUGIN_FACTORY(KCMKaddressbookPluginsConfigFactory, registerPlugin<KCMKaddressbookPluginsConfig>();
)
K_PLUGIN_FACTORY(KCMKaddressbookPluginsConfigFactory, registerPlugin<KCMKaddressbookPluginsConfig>();)
KCMKaddressbookPluginsConfig::KCMKaddressbookPluginsConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
......@@ -26,7 +25,9 @@ KCMKaddressbookPluginsConfig::KCMKaddressbookPluginsConfig(QWidget *parent, cons
KAboutData *about = new KAboutData(QStringLiteral("kcmakrpluginsconfig"),
i18n("Configure Plugins"),
QString(), QString(), KAboutLicense::GPL,
QString(),
QString(),
KAboutLicense::GPL,
i18n("(c), 2016-2020 Laurent Montel"));
about->addAuthor(i18n("Laurent Montel"), QString(), QStringLiteral("montel@kde.org"));
......
......@@ -10,10 +10,12 @@
#include <KCModule>
#include <QVariant>
namespace PimCommon {
namespace PimCommon
{
class ConfigurePluginsWidget;
}
namespace KAddressBook {
namespace KAddressBook
{
class KCMKaddressbookPluginsConfig : public KCModule
{
Q_OBJECT
......@@ -22,6 +24,7 @@ public:
void load() override;
void save() override;
void defaults() override;
private:
void slotConfigChanged();
PimCommon::ConfigurePluginsWidget *mConfigurePluginWidget = nullptr;
......
......@@ -6,18 +6,17 @@
#include "kaddressbook_config_userfeedback.h"
#include <KAboutData>
#include <KPluginFactory>
#include <KLocalizedString>
#include <KPluginFactory>
#include <QHBoxLayout>
#ifdef WITH_KUSERFEEDBACK
#include <KUserFeedback/FeedbackConfigWidget>
#include "userfeedback/userfeedbackmanager.h"
#include <KUserFeedback/FeedbackConfigWidget>
#endif
using namespace KAddressBook;
K_PLUGIN_FACTORY(KCMKaddressbookUserFeedBackConfigFactory, registerPlugin<KCMKaddressbookUserFeedBackConfig>();
)
K_PLUGIN_FACTORY(KCMKaddressbookUserFeedBackConfigFactory, registerPlugin<KCMKaddressbookUserFeedBackConfig>();)
KCMKaddressbookUserFeedBackConfig::KCMKaddressbookUserFeedBackConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args)
......@@ -27,7 +26,9 @@ KCMKaddressbookUserFeedBackConfig::KCMKaddressbookUserFeedBackConfig(QWidget *pa
KAboutData *about = new KAboutData(QStringLiteral("kcmaddressbookuserfeedbackconfig"),
i18n("Configure User FeedBack"),
QString(), QString(), KAboutLicense::GPL,
QString(),
QString(),
KAboutLicense::GPL,
i18n("(c), 2020 Laurent Montel"));
about->addAuthor(i18n("Laurent Montel"), QString(), QStringLiteral("montel@kde.org"));
......@@ -53,7 +54,7 @@ void KCMKaddressbookUserFeedBackConfig::load()
void KCMKaddressbookUserFeedBackConfig::defaults()
{
//FIXME ?
// FIXME ?
mUserFeedbackWidget->setFeedbackProvider(UserFeedBackManager::self()->userFeedbackProvider());
}
......
......@@ -10,11 +10,13 @@
#include <KCModule>
#include <QVariant>
namespace KUserFeedback {
namespace KUserFeedback
{
class FeedbackConfigWidget;
}
namespace KAddressBook {
namespace KAddressBook
{
class KCMKaddressbookUserFeedBackConfig : public KCModule
{
Q_OBJECT
......@@ -23,6 +25,7 @@ public:
void load() override;
void save() override;
void defaults() override;
private:
KUserFeedback::FeedbackConfigWidget *mUserFeedbackWidget = nullptr;
};
......
......@@ -5,15 +5,16 @@
*/
#include "kaddressbookconfigpluginlistwidget.h"
#include "../plugininterface/kaddressbookplugininterface.h"
#include "../importexport/pluginmanager.h"
#include "../importexport/plugin.h"
#include "../importexport/pluginmanager.h"
#include "../plugininterface/kaddressbookplugininterface.h"
#include "kaddressbook_configure_debug.h"
#include <KLocalizedString>
#include <PimCommon/GenericPlugin>
namespace {
namespace
{
QString kaddressbookPluginToolsGroupName()
{
return QStringLiteral("kaddressbookplugintoolsgroupname");
......@@ -61,9 +62,10 @@ void KAddressBookConfigPluginListWidget::doResetToDefaultsOther()
void KAddressBookConfigPluginListWidget::initialize()
{
mListWidget->clear();
//Necessary to initialize plugins when we load it outside kaddressbook
// Necessary to initialize plugins when we load it outside kaddressbook
KAddressBookPluginInterface::self()->initializePlugins();
PimCommon::ConfigurePluginsListWidget::fillTopItems(KAddressBookPluginInterface::self()->pluginsDataList(), i18n("Tools Plugins"),
PimCommon::ConfigurePluginsListWidget::fillTopItems(KAddressBookPluginInterface::self()->pluginsDataList(),
i18n("Tools Plugins"),
KAddressBookPluginInterface::self()->configGroupName(),
KAddressBookPluginInterface::self()->configPrefixSettingKey(),
mPluginGenericItems,
......
......@@ -20,6 +20,7 @@ public:
void doLoadFromGlobalSettings() override;
void doResetToDefaultsOther() override;
void initialize() override;
private:
void slotConfigureClicked(const QString &configureGroupName, const QString &identifier);
QVector<PluginItem *> mPluginGenericItems;
......
......@@ -20,7 +20,6 @@
#include <KJob>
#include <QImage>
ContactInfoProxyModel::ContactInfoProxyModel(QObject *parent)
: QIdentityProxyModel(parent)
, mMonitor(new Akonadi::Monitor(this))
......@@ -57,9 +56,8 @@ QVariant ContactInfoProxyModel::data(const QModelIndex &index, int role) const
mMonitor->setItemMonitored(item);
mGroupsCache[item.id()] = ContactCacheData::List();
}
if (groupContacts.contactReferenceCount() > 0
&& isCacheItemToFetch(item.id(), groupContacts)) {
if (groupContacts.contactReferenceCount() > 0 && isCacheItemToFetch(item.id(), groupContacts)) {
resolveGroup(item.id(), groupContacts);
}
}
......@@ -124,11 +122,10 @@ QString ContactInfoProxyModel::getDescription(const KContacts::Addressee &contac
emailAddress = i18n("Email: %1", contact.preferredEmail());
}
const QList<KContacts::PhoneNumber> phoneList = contact.phoneNumbers().toList();
QList<KContacts::PhoneNumber>::const_reverse_iterator itPhone = std::find_if(phoneList.rbegin(),
phoneList.rend(),
[&phoneList](const KContacts::PhoneNumber &phone) {
return phone.isPreferred() || phoneList.at(0) == phone;
});
QList<KContacts::PhoneNumber>::const_reverse_iterator itPhone =
std::find_if(phoneList.rbegin(), phoneList.rend(), [&phoneList](const KContacts::PhoneNumber &phone) {
return phone.isPreferred() || phoneList.at(0) == phone;
});
if (itPhone != phoneList.rend()) {
phone = i18n("Phone: %1", (*itPhone).number());
}
......@@ -146,8 +143,7 @@ QString ContactInfoProxyModel::getDescription(const Akonadi::Item::Id groupItemI
for (int idx = 0; idx < groupContacts.dataCount(); idx++) {
QString dataSeparator;
if (!groupContacts.data(idx).name().isEmpty()
&& !groupContacts.data(idx).email().isEmpty()) {
if (!groupContacts.data(idx).name().isEmpty() && !groupContacts.data(idx).email().isEmpty()) {
dataSeparator = QStringLiteral("-");
}
contactDescription = i18n("%1 %2 %3", groupContacts.data(idx).name(), dataSeparator, groupContacts.data(idx).email());
......@@ -202,8 +198,8 @@ bool ContactInfoProxyModel::isCacheItemToFetch(const Akonadi::Item::Id groupItem
QStringList groupCacheRefIds = getIdsCacheContactGroup(groupItemId);
auto sortFunc = [](const QString &lhs, const QString &rhs) -> bool {
return lhs.toLongLong() < rhs.toLongLong();
};
return lhs.toLongLong() < rhs.toLongLong();
};
std::sort(groupRefIds.begin(), groupRefIds.end(), sortFunc);
groupRefIds.erase(std::unique(groupRefIds.begin(), groupRefIds.end()), groupRefIds.end());
......@@ -213,29 +209,29 @@ bool ContactInfoProxyModel::isCacheItemToFetch(const Akonadi::Item::Id groupItem
return !std::equal(groupRefIds.begin(), groupRefIds.end(), groupCacheRefIds.begin(), groupCacheRefIds.end());
}
ContactInfoProxyModel::ContactCacheData::ListIterator ContactInfoProxyModel::findCacheItem(const Akonadi::Item::Id groupItemId, const ContactInfoProxyModel::ContactCacheData &cacheContact)
ContactInfoProxyModel::ContactCacheData::ListIterator ContactInfoProxyModel::findCacheItem(const Akonadi::Item::Id groupItemId,
const ContactInfoProxyModel::ContactCacheData &cacheContact)
{
ContactCacheData::ListIterator it = std::find_if(mGroupsCache[groupItemId].begin(), mGroupsCache[groupItemId].end(),
[&cacheContact](const ContactCacheData &contact) -> bool
{
return contact == cacheContact;
});
ContactCacheData::ListIterator it =
std::find_if(mGroupsCache[groupItemId].begin(), mGroupsCache[groupItemId].end(), [&cacheContact](const ContactCacheData &contact) -> bool {
return contact == cacheContact;
});
return it;
}
ContactInfoProxyModel::ContactCacheData::ConstListIterator ContactInfoProxyModel::findCacheItem(const Akonadi::Item::Id groupItemId, const ContactInfoProxyModel::ContactCacheData &cacheContact) const
ContactInfoProxyModel::ContactCacheData::ConstListIterator
ContactInfoProxyModel::findCacheItem(const Akonadi::Item::Id groupItemId, const ContactInfoProxyModel::ContactCacheData &cacheContact) const
{
ContactCacheData::ConstListIterator it = std::find_if(mGroupsCache[groupItemId].cbegin(), mGroupsCache[groupItemId].cend(),
[&cacheContact](const ContactCacheData &contact) -> bool
{
return contact == cacheContact;
});
ContactCacheData::ConstListIterator it =
std::find_if(mGroupsCache[groupItemId].cbegin(), mGroupsCache[groupItemId].cend(), [&cacheContact](const ContactCacheData &contact) -> bool {
return contact == cacheContact;
});
return it;
}
QMap<const char *, QVariant> ContactInfoProxyModel::buildFetchProperties(const Akonadi::Item::Id groupItemId) const
{
return QMap<const char *, QVariant> {
return QMap<const char *, QVariant>{
{"groupItemId", QVariant::fromValue((groupItemId))},
};
}
......@@ -263,7 +259,6 @@ void ContactInfoProxyModel::resolveGroup(const Akonadi::Item::Id groupItemId, co
mPendingGroupItems << groupItemId;
fetchItems(groupItemsList, buildFetchProperties(groupItemId));
}
}
void ContactInfoProxyModel::fetchItems(const Akonadi::Item::List &items, const QMap<const char *, QVariant> &properties) const
......@@ -288,20 +283,19 @@ void ContactInfoProxyModel::slotFetchJobFinished(KJob *job)
auto fetchJob = qobject_cast<Akonadi::ItemFetchJob *>(job);
const Akonadi::Item::Id groupItemId = job->property("groupItemId").value<Akonadi::Item::Id>();
const auto items = fetchJob->items();
for (const Akonadi::Item &item : items) {
ContactCacheData::List::iterator it_contact = findCacheItem(groupItemId, item);
if (it_contact != mGroupsCache[groupItemId].end()) {
if (it_contact->setData(item)) {
mMonitor->setItemMonitored(item);
}
else {
} else {
qCWarning(KADDRESSBOOK_LOG) << QStringLiteral("item with id %1 cannot be saved into cache").arg(item.id());
}
}
}
if (mPendingGroupItems.contains(groupItemId)) {
mPendingGroupItems.removeOne(groupItemId);
}
......@@ -313,7 +307,7 @@ void ContactInfoProxyModel::slotItemChanged(const Akonadi::Item &item, const QSe
{
Q_UNUSED(partIdentifiers)
Q_ASSERT(item.isValid());
if (item.hasPayload<KContacts::Addressee>()) {
QMapIterator<Akonadi::Item::Id, ContactCacheData::List> it_group(mGroupsCache);
while (it_group.hasNext()) {
......@@ -328,13 +322,11 @@ void ContactInfoProxyModel::slotItemChanged(const Akonadi::Item &item, const QSe
}
}
}
}
else if (item.hasPayload<KContacts::ContactGroup>()) {
} else if (item.hasPayload<KContacts::ContactGroup>()) {
if (mGroupsCache.contains(item.id())) {
const KContacts::ContactGroup groupContacts = item.payload<KContacts::ContactGroup>();
mGroupsCache[item.id()].clear();
if (groupContacts.contactReferenceCount() > 0
&& isCacheItemToFetch(item.id(), groupContacts)) {
if (groupContacts.contactReferenceCount() > 0 && isCacheItemToFetch(item.id(), groupContacts)) {
resolveGroup(item.id(), groupContacts);
}
const QModelIndex index = Akonadi::EntityTreeModel::modelIndexesForItem(this, Akonadi::Item(item.id())).constFirst();
......@@ -343,10 +335,10 @@ void ContactInfoProxyModel::slotItemChanged(const Akonadi::Item &item, const QSe
}
}
void ContactInfoProxyModel::slotRowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
void ContactInfoProxyModel::slotRowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
{
for (int idx = first; idx <= last; idx++) {
const Akonadi::Item item = this->index(idx , 0, parent).data(Akonadi::EntityTreeModel::ItemRole).value<Akonadi::Item>();
const Akonadi::Item item = this->index(idx, 0, parent).data(Akonadi::EntityTreeModel::ItemRole).value<Akonadi::Item>();
Q_ASSERT(item.isValid());
if (item.hasPayload<KContacts::Addressee>()) {
QMapIterator<Akonadi::Item::Id, ContactCacheData::List> it_group(mGroupsCache);
......
......@@ -10,16 +10,18 @@
#define CONTACTINFOPROXYMODEL_H
#include <AkonadiCore/EntityTreeModel>
#include <kcontacts/contactgroup.h>
#include <QObject>
#include <QIdentityProxyModel>
#include <QObject>
#include <kcontacts/contactgroup.h>
namespace Akonadi {
namespace Akonadi
{
class Item;
class Monitor;
}
namespace KContacts {
namespace KContacts
{
class Addressee;
class ContactGroup;
}
......@@ -37,14 +39,13 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
private:
class ContactCacheData
{
public:
using List = QVector<ContactCacheData>;
using ListIterator = ContactCacheData::List::iterator;
using ConstListIterator = ContactCacheData::List::ConstIterator;
ContactCacheData() = default;
~ContactCacheData() = default;
ContactCacheData(const ContactCacheData &) = default;
......@@ -60,15 +61,28 @@ private:
, mGid(other.gid())
{
}
Q_REQUIRED_RESULT bool setData(const Akonadi::Item &item);
friend bool operator==(const ContactCacheData &lhs, const ContactCacheData &rhs);
Q_REQUIRED_RESULT QString uid() const { return mUid; }
Q_REQUIRED_RESULT QString gid() const { return mGid; }
Q_REQUIRED_RESULT QString name() const { return mName; }
Q_REQUIRED_RESULT QString email() const { return mEmail; }
Q_REQUIRED_RESULT QString uid() const
{
return mUid;
}
Q_REQUIRED_RESULT QString gid() const
{
return mGid;
}
Q_REQUIRED_RESULT QString name() const
{
return mName;
}
Q_REQUIRED_RESULT QString email() const
{
return mEmail;