Commit 5e6f67b4 authored by Laurent Montel's avatar Laurent Montel 😁

Fix coding style

parent 558e7992
...@@ -43,9 +43,9 @@ KAddressBookPlugin::KAddressBookPlugin(KontactInterface::Core *core, const QVari ...@@ -43,9 +43,9 @@ KAddressBookPlugin::KAddressBookPlugin(KontactInterface::Core *core, const QVari
{ {
setComponentName(QStringLiteral("kaddressbook"), i18n("KAddressBook")); setComponentName(QStringLiteral("kaddressbook"), i18n("KAddressBook"));
QAction *action = QAction *action
new QAction(QIcon::fromTheme(QStringLiteral("contact-new")), = new QAction(QIcon::fromTheme(QStringLiteral("contact-new")),
i18nc("@action:inmenu", "New Contact..."), this); i18nc("@action:inmenu", "New Contact..."), this);
actionCollection()->addAction(QStringLiteral("new_contact"), action); actionCollection()->addAction(QStringLiteral("new_contact"), action);
connect(action, &QAction::triggered, this, &KAddressBookPlugin::slotNewContact); connect(action, &QAction::triggered, this, &KAddressBookPlugin::slotNewContact);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C)); actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C));
...@@ -56,9 +56,9 @@ KAddressBookPlugin::KAddressBookPlugin(KontactInterface::Core *core, const QVari ...@@ -56,9 +56,9 @@ KAddressBookPlugin::KAddressBookPlugin(KontactInterface::Core *core, const QVari
"You will be presented with a dialog where you can create a new contact.")); "You will be presented with a dialog where you can create a new contact."));
insertNewAction(action); insertNewAction(action);
action = action
new QAction(QIcon::fromTheme(QStringLiteral("user-group-new")), = new QAction(QIcon::fromTheme(QStringLiteral("user-group-new")),
i18nc("@action:inmenu", "New Contact Group..."), this); i18nc("@action:inmenu", "New Contact Group..."), this);
actionCollection()->addAction(QStringLiteral("new_contactgroup"), action); actionCollection()->addAction(QStringLiteral("new_contactgroup"), action);
connect(action, &QAction::triggered, this, &KAddressBookPlugin::slotNewContactGroup); connect(action, &QAction::triggered, this, &KAddressBookPlugin::slotNewContactGroup);
actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_G)); actionCollection()->setDefaultShortcut(action, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_G));
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
#include <KontactInterface/UniqueAppHandler> #include <KontactInterface/UniqueAppHandler>
namespace KontactInterface namespace KontactInterface {
{
class Plugin; class Plugin;
} }
...@@ -33,7 +32,10 @@ class KAddressBookUniqueAppHandler : public KontactInterface::UniqueAppHandler ...@@ -33,7 +32,10 @@ class KAddressBookUniqueAppHandler : public KontactInterface::UniqueAppHandler
Q_OBJECT Q_OBJECT
public: public:
explicit KAddressBookUniqueAppHandler(KontactInterface::Plugin *plugin) explicit KAddressBookUniqueAppHandler(KontactInterface::Plugin *plugin)
: KontactInterface::UniqueAppHandler(plugin) {} : KontactInterface::UniqueAppHandler(plugin)
{
}
void loadCommandLineOptions(QCommandLineParser *parser) Q_DECL_OVERRIDE; void loadCommandLineOptions(QCommandLineParser *parser) Q_DECL_OVERRIDE;
int activate(const QStringList &args, const QString &workingDir) Q_DECL_OVERRIDE; int activate(const QStringList &args, const QString &workingDir) Q_DECL_OVERRIDE;
}; };
...@@ -64,8 +66,6 @@ private Q_SLOTS: ...@@ -64,8 +66,6 @@ private Q_SLOTS:
private: private:
KontactInterface::UniqueAppWatcher *mUniqueAppWatcher; KontactInterface::UniqueAppWatcher *mUniqueAppWatcher;
}; };
#endif #endif
...@@ -32,8 +32,8 @@ AboutData::AboutData() ...@@ -32,8 +32,8 @@ AboutData::AboutData()
KAboutLicense::GPL_V2, KAboutLicense::GPL_V2,
i18n("Copyright © 2007–2017 KAddressBook authors")) i18n("Copyright © 2007–2017 KAddressBook authors"))
{ {
addAuthor(i18n("Laurent Montel"), i18n("Current maintainer"), QStringLiteral("montel@kde.org")); addAuthor(i18n("Laurent Montel"), i18n("Current maintainer"), QStringLiteral("montel@kde.org"));
addAuthor(i18n("Tobias Koenig"), i18n("Previous maintainer"), QStringLiteral("tokoe@kde.org")); addAuthor(i18n("Tobias Koenig"), i18n("Previous maintainer"), QStringLiteral("tokoe@kde.org"));
} }
AboutData::~AboutData() AboutData::~AboutData()
......
...@@ -40,4 +40,3 @@ public: ...@@ -40,4 +40,3 @@ public:
}; };
#endif /* ABOUTDATA_H */ #endif /* ABOUTDATA_H */
...@@ -23,12 +23,10 @@ ...@@ -23,12 +23,10 @@
AkonadiContactGroupRepository::AkonadiContactGroupRepository() AkonadiContactGroupRepository::AkonadiContactGroupRepository()
: Domain::ContactGroupRepository() : Domain::ContactGroupRepository()
{ {
} }
AkonadiContactGroupRepository::~AkonadiContactGroupRepository() AkonadiContactGroupRepository::~AkonadiContactGroupRepository()
{ {
} }
KJob *AkonadiContactGroupRepository::createContactGroup(Domain::ContactGroup *contactGroup) KJob *AkonadiContactGroupRepository::createContactGroup(Domain::ContactGroup *contactGroup)
......
...@@ -23,8 +23,7 @@ ...@@ -23,8 +23,7 @@
#include "contactgrouprepository.h" #include "contactgrouprepository.h"
#include <QObject> #include <QObject>
namespace Domain namespace Domain {
{
class ContactGroup; class ContactGroup;
} }
class KJob; class KJob;
......
...@@ -22,12 +22,10 @@ ...@@ -22,12 +22,10 @@
AkonadiContactRepository::AkonadiContactRepository() AkonadiContactRepository::AkonadiContactRepository()
{ {
} }
AkonadiContactRepository::~AkonadiContactRepository() AkonadiContactRepository::~AkonadiContactRepository()
{ {
} }
KJob *AkonadiContactRepository::createContact(Domain::Contact *contact) KJob *AkonadiContactRepository::createContact(Domain::Contact *contact)
......
#include "../kaddressbookimportexportcontactfields.h" #include "../kaddressbookimportexportcontactfields.h"
#include <qtest.h> #include <qtest.h>
...@@ -86,18 +85,23 @@ void ContactFieldsTest::testSetGet() ...@@ -86,18 +85,23 @@ void ContactFieldsTest::testSetGet()
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday, s_birthday, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday, s_birthday, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::Anniversary, s_anniversary, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::Anniversary, s_anniversary, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressStreet, s_homeAddressStreet, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressStreet, s_homeAddressStreet, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostOfficeBox, s_homeAddressPostOfficeBox, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostOfficeBox, s_homeAddressPostOfficeBox,
contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLocality, s_homeAddressLocality, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLocality, s_homeAddressLocality, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressRegion, s_homeAddressRegion, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressRegion, s_homeAddressRegion, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostalCode, s_homeAddressPostalCode, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostalCode, s_homeAddressPostalCode, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressCountry, s_homeAddressCountry, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressCountry, s_homeAddressCountry, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLabel, s_homeAddressLabel, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLabel, s_homeAddressLabel, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressStreet, s_businessAddressStreet, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressStreet, s_businessAddressStreet, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostOfficeBox, s_businessAddressPostOfficeBox, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostOfficeBox,
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLocality, s_businessAddressLocality, contact); s_businessAddressPostOfficeBox, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLocality, s_businessAddressLocality,
contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressRegion, s_businessAddressRegion, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressRegion, s_businessAddressRegion, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostalCode, s_businessAddressPostalCode, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostalCode, s_businessAddressPostalCode,
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressCountry, s_businessAddressCountry, contact); contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressCountry, s_businessAddressCountry,
contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLabel, s_businessAddressLabel, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLabel, s_businessAddressLabel, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomePhone, s_homePhone, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomePhone, s_homePhone, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessPhone, s_businessPhone, contact); KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessPhone, s_businessPhone, contact);
...@@ -136,20 +140,34 @@ void ContactFieldsTest::testSetGet() ...@@ -136,20 +140,34 @@ void ContactFieldsTest::testSetGet()
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::NickName, contactCopy), s_nickName); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::NickName, contactCopy), s_nickName);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday, contactCopy), s_birthday); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday, contactCopy), s_birthday);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::Anniversary, contactCopy), s_anniversary); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::Anniversary, contactCopy), s_anniversary);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressStreet, contactCopy), s_homeAddressStreet); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressStreet,
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostOfficeBox, contactCopy), s_homeAddressPostOfficeBox); contactCopy), s_homeAddressStreet);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLocality, contactCopy), s_homeAddressLocality); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostOfficeBox,
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressRegion, contactCopy), s_homeAddressRegion); contactCopy), s_homeAddressPostOfficeBox);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostalCode, contactCopy), s_homeAddressPostalCode); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLocality,
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressCountry, contactCopy), s_homeAddressCountry); contactCopy), s_homeAddressLocality);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLabel, contactCopy), s_homeAddressLabel); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressRegion,
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressStreet, contactCopy), s_businessAddressStreet); contactCopy), s_homeAddressRegion);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostOfficeBox, contactCopy), s_businessAddressPostOfficeBox); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostalCode,
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLocality, contactCopy), s_businessAddressLocality); contactCopy), s_homeAddressPostalCode);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressRegion, contactCopy), s_businessAddressRegion); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressCountry,
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostalCode, contactCopy), s_businessAddressPostalCode); contactCopy), s_homeAddressCountry);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressCountry, contactCopy), s_businessAddressCountry); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLabel, contactCopy),
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLabel, contactCopy), s_businessAddressLabel); s_homeAddressLabel);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressStreet,
contactCopy), s_businessAddressStreet);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostOfficeBox,
contactCopy), s_businessAddressPostOfficeBox);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLocality,
contactCopy), s_businessAddressLocality);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressRegion,
contactCopy), s_businessAddressRegion);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostalCode,
contactCopy), s_businessAddressPostalCode);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressCountry,
contactCopy), s_businessAddressCountry);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLabel,
contactCopy), s_businessAddressLabel);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomePhone, contactCopy), s_homePhone); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomePhone, contactCopy), s_homePhone);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessPhone, contactCopy), s_businessPhone); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessPhone, contactCopy), s_businessPhone);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::MobilePhone, contactCopy), s_mobilePhone); QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::MobilePhone, contactCopy), s_mobilePhone);
......
...@@ -48,15 +48,15 @@ private: ...@@ -48,15 +48,15 @@ private:
}; };
CategoryFilterProxyModelPrivate::CategoryFilterProxyModelPrivate(CategoryFilterProxyModel *parent) CategoryFilterProxyModelPrivate::CategoryFilterProxyModelPrivate(CategoryFilterProxyModel *parent)
: QObject(), : QObject()
filterEnabled(false), , filterEnabled(false)
q_ptr(parent) , q_ptr(parent)
{ {
} }
CategoryFilterProxyModel::CategoryFilterProxyModel(QObject *parent) CategoryFilterProxyModel::CategoryFilterProxyModel(QObject *parent)
: QSortFilterProxyModel(parent), : QSortFilterProxyModel(parent)
d_ptr(new CategoryFilterProxyModelPrivate(this)) , d_ptr(new CategoryFilterProxyModelPrivate(this))
{ {
setDynamicSortFilter(true); setDynamicSortFilter(true);
} }
......
...@@ -76,7 +76,7 @@ protected: ...@@ -76,7 +76,7 @@ protected:
/** /**
* @reimp * @reimp
**/ **/
bool filterAcceptsRow(int row, const QModelIndex &parent) const Q_DECL_OVERRIDE; bool filterAcceptsRow(int row, const QModelIndex &parent) const Q_DECL_OVERRIDE;
private: private:
CategoryFilterProxyModelPrivate *const d_ptr; CategoryFilterProxyModelPrivate *const d_ptr;
......
...@@ -69,12 +69,12 @@ private: ...@@ -69,12 +69,12 @@ private:
}; };
CategorySelectWidgetPrivate::CategorySelectWidgetPrivate(CategorySelectWidget *parent) CategorySelectWidgetPrivate::CategorySelectWidgetPrivate(CategorySelectWidget *parent)
: QObject(), : QObject()
tagModel(nullptr), , tagModel(nullptr)
rowOffset(0), , rowOffset(0)
updateTimer(nullptr), , updateTimer(nullptr)
checkCombo(nullptr), , checkCombo(nullptr)
q_ptr(parent) , q_ptr(parent)
{ {
} }
...@@ -110,7 +110,7 @@ void CategorySelectWidgetPrivate::init() ...@@ -110,7 +110,7 @@ void CategorySelectWidgetPrivate::init()
connect(updateTimer, &QTimer::timeout, this, &CategorySelectWidgetPrivate::slotCheckedItemsTimer); connect(updateTimer, &QTimer::timeout, this, &CategorySelectWidgetPrivate::slotCheckedItemsTimer);
QToolButton *but = new QToolButton(q); QToolButton *but = new QToolButton(q);
but ->setAutoRaise(true); but->setAutoRaise(true);
but->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo"))); but->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo")));
but->setToolTip(i18nc("@action:button", "Reset category filter")); but->setToolTip(i18nc("@action:button", "Reset category filter"));
connect(but, &QToolButton::clicked, this, &CategorySelectWidgetPrivate::slotSelectAll); connect(but, &QToolButton::clicked, this, &CategorySelectWidgetPrivate::slotSelectAll);
...@@ -184,8 +184,8 @@ void CategorySelectWidgetPrivate::slotTagsInserted(const QModelIndex &parent, in ...@@ -184,8 +184,8 @@ void CategorySelectWidgetPrivate::slotTagsInserted(const QModelIndex &parent, in
if (parent != QModelIndex()) { if (parent != QModelIndex()) {
const Tag::Id parentId = tagModel->data(idx, TagModel::IdRole).value<Tag::Id>(); const Tag::Id parentId = tagModel->data(idx, TagModel::IdRole).value<Tag::Id>();
QModelIndexList matchList = itemModel()->match(itemModel()->index(0, 0), FILTER_ROLE, QModelIndexList matchList = itemModel()->match(itemModel()->index(0, 0), FILTER_ROLE,
parentId, 1, parentId, 1,
Qt::MatchExactly | Qt::MatchRecursive); Qt::MatchExactly | Qt::MatchRecursive);
if (matchList.count() == 1) { // found the parent tag if (matchList.count() == 1) { // found the parent tag
QModelIndex parentIndex = matchList.at(0); QModelIndex parentIndex = matchList.at(0);
itemModel()->itemFromIndex(parentIndex)->appendRow(it); itemModel()->itemFromIndex(parentIndex)->appendRow(it);
...@@ -281,8 +281,8 @@ QList<Akonadi::Tag::Id> CategorySelectWidgetPrivate::filterTags() const ...@@ -281,8 +281,8 @@ QList<Akonadi::Tag::Id> CategorySelectWidgetPrivate::filterTags() const
} }
CategorySelectWidget::CategorySelectWidget(QWidget *parent) CategorySelectWidget::CategorySelectWidget(QWidget *parent)
: QWidget(parent), : QWidget(parent)
d_ptr(new CategorySelectWidgetPrivate(this)) , d_ptr(new CategorySelectWidgetPrivate(this))
{ {
Q_D(CategorySelectWidget); Q_D(CategorySelectWidget);
d->init(); d->init();
......
...@@ -29,7 +29,8 @@ ...@@ -29,7 +29,8 @@
using namespace KAddressBook; using namespace KAddressBook;
K_PLUGIN_FACTORY(KCMKaddressbookPluginsConfigFactory, registerPlugin<KCMKaddressbookPluginsConfig>();) K_PLUGIN_FACTORY(KCMKaddressbookPluginsConfigFactory, registerPlugin<KCMKaddressbookPluginsConfig>();
)
KCMKaddressbookPluginsConfig::KCMKaddressbookPluginsConfig(QWidget *parent, const QVariantList &args) KCMKaddressbookPluginsConfig::KCMKaddressbookPluginsConfig(QWidget *parent, const QVariantList &args)
: KCModule(parent, args) : KCModule(parent, args)
......
...@@ -23,12 +23,10 @@ ...@@ -23,12 +23,10 @@
#include <KCModule> #include <KCModule>
#include <QVariant> #include <QVariant>
namespace PimCommon namespace PimCommon {
{
class ConfigurePluginsWidget; class ConfigurePluginsWidget;
} }
namespace KAddressBook namespace KAddressBook {
{
class KCMKaddressbookPluginsConfig : public KCModule class KCMKaddressbookPluginsConfig : public KCModule
{ {
Q_OBJECT Q_OBJECT
......
...@@ -25,12 +25,12 @@ ...@@ -25,12 +25,12 @@
#include <KLocalizedString> #include <KLocalizedString>
#include <PimCommon/GenericPlugin> #include <PimCommon/GenericPlugin>
namespace namespace {
{
QString kaddressbookPluginToolsGroupName() QString kaddressbookPluginToolsGroupName()
{ {
return QStringLiteral("kaddressbookplugintoolsgroupname"); return QStringLiteral("kaddressbookplugintoolsgroupname");
} }
QString kaddressbookImportExportGroupName() QString kaddressbookImportExportGroupName()
{ {
return QStringLiteral("kaddressbookpluginimportexportgroupname"); return QStringLiteral("kaddressbookpluginimportexportgroupname");
...@@ -45,18 +45,17 @@ KAddressBookConfigPluginListWidget::KAddressBookConfigPluginListWidget(QWidget * ...@@ -45,18 +45,17 @@ KAddressBookConfigPluginListWidget::KAddressBookConfigPluginListWidget(QWidget *
KAddressBookConfigPluginListWidget::~KAddressBookConfigPluginListWidget() KAddressBookConfigPluginListWidget::~KAddressBookConfigPluginListWidget()
{ {
} }
void KAddressBookConfigPluginListWidget::save() void KAddressBookConfigPluginListWidget::save()
{ {
PimCommon::ConfigurePluginsListWidget::savePlugins(KAddressBookPluginInterface::self()->configGroupName(), PimCommon::ConfigurePluginsListWidget::savePlugins(KAddressBookPluginInterface::self()->configGroupName(),
KAddressBookPluginInterface::self()->configPrefixSettingKey(), KAddressBookPluginInterface::self()->configPrefixSettingKey(),
mPluginGenericItems); mPluginGenericItems);
PimCommon::ConfigurePluginsListWidget::savePlugins(KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configGroupName(), PimCommon::ConfigurePluginsListWidget::savePlugins(KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configGroupName(),
KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configPrefixSettingKey(), KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configPrefixSettingKey(),
mPluginImportExportItems); mPluginImportExportItems);
} }
void KAddressBookConfigPluginListWidget::doLoadFromGlobalSettings() void KAddressBookConfigPluginListWidget::doLoadFromGlobalSettings()
...@@ -75,17 +74,17 @@ void KAddressBookConfigPluginListWidget::initialize() ...@@ -75,17 +74,17 @@ void KAddressBookConfigPluginListWidget::initialize()
//Necessary to initialize pluging when we load it outside kaddressbook //Necessary to initialize pluging when we load it outside kaddressbook
KAddressBookPluginInterface::self()->initializePlugins(); 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()->configGroupName(),
KAddressBookPluginInterface::self()->configPrefixSettingKey(), KAddressBookPluginInterface::self()->configPrefixSettingKey(),
mPluginGenericItems, mPluginGenericItems,
kaddressbookPluginToolsGroupName()); kaddressbookPluginToolsGroupName());
PimCommon::ConfigurePluginsListWidget::fillTopItems(KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->pluginsDataList(), PimCommon::ConfigurePluginsListWidget::fillTopItems(KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->pluginsDataList(),
i18n("Import/Export Plugins"), i18n("Import/Export Plugins"),
KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configGroupName(), KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configGroupName(),
KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configPrefixSettingKey(), KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configPrefixSettingKey(),
mPluginImportExportItems, mPluginImportExportItems,
kaddressbookImportExportGroupName()); kaddressbookImportExportGroupName());
mListWidget->expandAll(); mListWidget->expandAll();
} }
......
...@@ -26,35 +26,35 @@ class ContactSortHelper ...@@ -26,35 +26,35 @@ class ContactSortHelper
{ {
public: public:
ContactSortHelper(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field, Qt::SortOrder sortOrder) ContactSortHelper(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field, Qt::SortOrder sortOrder)
: mSortField(field), mSortOrder(sortOrder) : mSortField(field)
, mSortOrder(sortOrder)
{ {
} }
inline bool operator()(const KContacts::Addressee &contact, inline bool operator()(const KContacts::Addressee &contact, const KContacts::Addressee &otherContact) const
const KContacts::Addressee &otherContact) const
{ {
int result = int result
QString::localeAwareCompare( = QString::localeAwareCompare(
KAddressBookImportExport::KAddressBookImportExportContactFields::value(mSortField, contact), KAddressBookImportExport::KAddressBookImportExportContactFields::value(mSortField, contact),
KAddressBookImportExport::KAddressBookImportExportContactFields::value(mSortField, otherContact)); KAddressBookImportExport::KAddressBookImportExportContactFields::value(mSortField, otherContact));
if (result == 0) { if (result == 0) {
int givenNameResult = int givenNameResult
QString::localeAwareCompare( = QString::localeAwareCompare(
KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::GivenName, contact), KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::GivenName, contact),
KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::GivenName, otherContact)); KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::GivenName, otherContact));
if (givenNameResult == 0) { if (givenNameResult == 0) {
int familyNameResult = int familyNameResult
QString::localeAwareCompare( = QString::localeAwareCompare(
KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FamilyName, contact), KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FamilyName, contact),
KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FamilyName, otherContact)); KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FamilyName, otherContact));
if (familyNameResult == 0) { if (familyNameResult == 0) {
result = result
QString::localeAwareCompare( = QString::localeAwareCompare(
KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, contact), KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, contact),
KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, otherContact)); KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, otherContact));
} else { } else {
result = familyNameResult; result = familyNameResult;
} }
...@@ -78,7 +78,8 @@ private: ...@@ -78,7 +78,8 @@ private:
}; };
ContactSorter::ContactSorter(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field, Qt::SortOrder sortOrder) ContactSorter::ContactSorter(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field, Qt::SortOrder sortOrder)
: mSortField(field), mSortOrder(sortOrder) : mSortField(field)
, mSortOrder(sortOrder)
{ {
} }
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
class ContactSorter class ContactSorter
{ {
public: public:
explicit ContactSorter(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field, explicit ContactSorter(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field, Qt::SortOrder sortOrder = Qt::AscendingOrder);
Qt::SortOrder sortOrder = Qt::AscendingOrder);