summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-05-02 08:16:31 +0200
committerMontel Laurent <[email protected]>2017-05-02 08:16:31 +0200
commit5e6f67b44b49886ac058e35f74f8d6f2606af50f (patch)
tree432a497321d05dc17a81fec582359534a267facc
parent558e79922bab5833c86f2359e7dad50898ae1e9f (diff)
Fix coding style
-rw-r--r--kontactplugin/kaddressbook_plugin.cpp12
-rw-r--r--kontactplugin/kaddressbook_plugin.h10
-rw-r--r--src/aboutdata.cpp4
-rw-r--r--src/aboutdata.h1
-rw-r--r--src/akonadi/akonadicontactgrouprepository.cpp2
-rw-r--r--src/akonadi/akonadicontactgrouprepository.h3
-rw-r--r--src/akonadi/akonadicontactrepository.cpp2
-rw-r--r--src/autotests/contactfieldstest.cpp58
-rw-r--r--src/categoryfilterproxymodel.cpp10
-rw-r--r--src/categoryfilterproxymodel.h2
-rw-r--r--src/categoryselectwidget.cpp22
-rw-r--r--src/configuration/kaddressbook_config_plugins.cpp3
-rw-r--r--src/configuration/kaddressbook_config_plugins.h6
-rw-r--r--src/configuration/kaddressbookconfigpluginlistwidget.cpp31
-rw-r--r--src/contactsorter.cpp41
-rw-r--r--src/contactsorter.h3
-rw-r--r--src/contactswitcher.cpp12
-rw-r--r--src/domain/autotests/contactgrouptest.cpp2
-rw-r--r--src/domain/autotests/contacttest.cpp2
-rw-r--r--src/domain/autotests/contacttest.h1
-rw-r--r--src/domain/contact.cpp2
-rw-r--r--src/domain/contact.h3
-rw-r--r--src/domain/contactgroup.cpp2
-rw-r--r--src/domain/contactgroup.h3
-rw-r--r--src/domain/contactgrouprepository.cpp2
-rw-r--r--src/domain/contactgrouprepository.h3
-rw-r--r--src/domain/contactrepository.cpp2
-rw-r--r--src/domain/contactrepository.h3
-rw-r--r--src/globalcontactmodel.h3
-rw-r--r--src/kaddressbookmigrateapplication.cpp1
-rw-r--r--src/kaddressbookpart.cpp7
-rw-r--r--src/kaddressbookpart.h2
-rw-r--r--src/listview/tests/addressbooklistviewmodel.cpp2
-rw-r--r--src/listview/tests/addressbookmainwidget.cpp22
-rw-r--r--src/listview/tests/addressbookquickwidget.cpp1
-rw-r--r--src/listview/tests/mainwindow.cpp1
-rw-r--r--src/main.cpp5
-rw-r--r--src/mainwidget.cpp68
-rw-r--r--src/mainwidget.h15
-rw-r--r--src/mainwindow.cpp4
-rw-r--r--src/manageshowcollectionproperties.cpp8
-rw-r--r--src/manageshowcollectionproperties.h4
-rw-r--r--src/modelcolumnmanager.cpp5
-rw-r--r--src/plugininterface/kaddressbookplugininterface.cpp7
-rw-r--r--src/printing/compact/compactstyle.cpp36
-rw-r--r--src/printing/compact/compactstyle.h5
-rw-r--r--src/printing/detailled/detailledstyle.cpp39
-rw-r--r--src/printing/detailled/detailledstyle.h5
-rw-r--r--src/printing/grantlee/grantleeprintstyle.cpp7
-rw-r--r--src/printing/grantlee/grantleeprintstyle.h8
-rw-r--r--src/printing/mike/mikesstyle.cpp2
-rw-r--r--src/printing/mike/mikesstyle.h5
-rw-r--r--src/printing/printingwizard.cpp19
-rw-r--r--src/printing/printingwizard.h21
-rw-r--r--src/printing/printprogress.cpp5
-rw-r--r--src/printing/printprogress.h5
-rw-r--r--src/printing/printstyle.cpp5
-rw-r--r--src/printing/printstyle.h5
-rw-r--r--src/printing/ringbinder/ringbinderstyle.cpp21
-rw-r--r--src/printing/ringbinder/ringbinderstyle.h5
-rw-r--r--src/printing/stylepage.cpp11
61 files changed, 268 insertions, 338 deletions
diff --git a/kontactplugin/kaddressbook_plugin.cpp b/kontactplugin/kaddressbook_plugin.cpp
index ec4ea94..7d6a318 100644
--- a/kontactplugin/kaddressbook_plugin.cpp
+++ b/kontactplugin/kaddressbook_plugin.cpp
@@ -43,9 +43,9 @@ 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));
@@ -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."));
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));
diff --git a/kontactplugin/kaddressbook_plugin.h b/kontactplugin/kaddressbook_plugin.h
index fc1cd3f..e431cc7 100644
--- a/kontactplugin/kaddressbook_plugin.h
+++ b/kontactplugin/kaddressbook_plugin.h
@@ -23,8 +23,7 @@
#include <KontactInterface/UniqueAppHandler>
-namespace KontactInterface
-{
+namespace KontactInterface {
class Plugin;
}
@@ -33,7 +32,10 @@ class KAddressBookUniqueAppHandler : public KontactInterface::UniqueAppHandler
Q_OBJECT
public:
explicit KAddressBookUniqueAppHandler(KontactInterface::Plugin *plugin)
- : KontactInterface::UniqueAppHandler(plugin) {}
+ : KontactInterface::UniqueAppHandler(plugin)
+ {
+ }
+
void loadCommandLineOptions(QCommandLineParser *parser) Q_DECL_OVERRIDE;
int activate(const QStringList &args, const QString &workingDir) Q_DECL_OVERRIDE;
};
@@ -64,8 +66,6 @@ private Q_SLOTS:
private:
KontactInterface::UniqueAppWatcher *mUniqueAppWatcher;
-
};
#endif
-
diff --git a/src/aboutdata.cpp b/src/aboutdata.cpp
index 1074780..187b7a4 100644
--- a/src/aboutdata.cpp
+++ b/src/aboutdata.cpp
@@ -32,8 +32,8 @@ AboutData::AboutData()
KAboutLicense::GPL_V2,
i18n("Copyright © 2007–2017 KAddressBook authors"))
{
- addAuthor(i18n("Laurent Montel"), i18n("Current maintainer"), QStringLiteral("[email protected]"));
- addAuthor(i18n("Tobias Koenig"), i18n("Previous maintainer"), QStringLiteral("[email protected]"));
+ addAuthor(i18n("Laurent Montel"), i18n("Current maintainer"), QStringLiteral("[email protected]"));
+ addAuthor(i18n("Tobias Koenig"), i18n("Previous maintainer"), QStringLiteral("[email protected]"));
}
AboutData::~AboutData()
diff --git a/src/aboutdata.h b/src/aboutdata.h
index f8caa91..381f96c 100644
--- a/src/aboutdata.h
+++ b/src/aboutdata.h
@@ -40,4 +40,3 @@ public:
};
#endif /* ABOUTDATA_H */
-
diff --git a/src/akonadi/akonadicontactgrouprepository.cpp b/src/akonadi/akonadicontactgrouprepository.cpp
index a645825..a34b644 100644
--- a/src/akonadi/akonadicontactgrouprepository.cpp
+++ b/src/akonadi/akonadicontactgrouprepository.cpp
@@ -23,12 +23,10 @@
AkonadiContactGroupRepository::AkonadiContactGroupRepository()
: Domain::ContactGroupRepository()
{
-
}
AkonadiContactGroupRepository::~AkonadiContactGroupRepository()
{
-
}
KJob *AkonadiContactGroupRepository::createContactGroup(Domain::ContactGroup *contactGroup)
diff --git a/src/akonadi/akonadicontactgrouprepository.h b/src/akonadi/akonadicontactgrouprepository.h
index 45571b8..d4ca1fd 100644
--- a/src/akonadi/akonadicontactgrouprepository.h
+++ b/src/akonadi/akonadicontactgrouprepository.h
@@ -23,8 +23,7 @@
#include "contactgrouprepository.h"
#include <QObject>
-namespace Domain
-{
+namespace Domain {
class ContactGroup;
}
class KJob;
diff --git a/src/akonadi/akonadicontactrepository.cpp b/src/akonadi/akonadicontactrepository.cpp
index 75436e4..a20fd77 100644
--- a/src/akonadi/akonadicontactrepository.cpp
+++ b/src/akonadi/akonadicontactrepository.cpp
@@ -22,12 +22,10 @@
AkonadiContactRepository::AkonadiContactRepository()
{
-
}
AkonadiContactRepository::~AkonadiContactRepository()
{
-
}
KJob *AkonadiContactRepository::createContact(Domain::Contact *contact)
diff --git a/src/autotests/contactfieldstest.cpp b/src/autotests/contactfieldstest.cpp
index eb73ca3..7c7497f 100644
--- a/src/autotests/contactfieldstest.cpp
+++ b/src/autotests/contactfieldstest.cpp
@@ -1,4 +1,3 @@
-
#include "../kaddressbookimportexportcontactfields.h"
#include <qtest.h>
@@ -86,18 +85,23 @@ void ContactFieldsTest::testSetGet()
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday, s_birthday, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::Anniversary, s_anniversary, 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::HomeAddressRegion, s_homeAddressRegion, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostalCode, s_homeAddressPostalCode, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressCountry, s_homeAddressCountry, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLabel, s_homeAddressLabel, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressStreet, s_businessAddressStreet, contact);
- KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostOfficeBox, s_businessAddressPostOfficeBox, contact);
- KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLocality, s_businessAddressLocality, contact);
+ KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostOfficeBox,
+ 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::BusinessAddressPostalCode, s_businessAddressPostalCode, contact);
- KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressCountry, s_businessAddressCountry, contact);
+ KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostalCode, s_businessAddressPostalCode,
+ contact);
+ KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressCountry, s_businessAddressCountry,
+ contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLabel, s_businessAddressLabel, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::HomePhone, s_homePhone, contact);
KAddressBookImportExport::KAddressBookImportExportContactFields::setValue(KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessPhone, s_businessPhone, contact);
@@ -136,20 +140,34 @@ void ContactFieldsTest::testSetGet()
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::Anniversary, contactCopy), s_anniversary);
- QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressStreet, contactCopy), s_homeAddressStreet);
- QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostOfficeBox, contactCopy), s_homeAddressPostOfficeBox);
- QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLocality, contactCopy), s_homeAddressLocality);
- QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressRegion, contactCopy), s_homeAddressRegion);
- QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostalCode, contactCopy), s_homeAddressPostalCode);
- QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressCountry, contactCopy), s_homeAddressCountry);
- QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLabel, contactCopy), 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::HomeAddressStreet,
+ contactCopy), s_homeAddressStreet);
+ QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostOfficeBox,
+ contactCopy), s_homeAddressPostOfficeBox);
+ QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLocality,
+ contactCopy), s_homeAddressLocality);
+ QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressRegion,
+ contactCopy), s_homeAddressRegion);
+ QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostalCode,
+ contactCopy), s_homeAddressPostalCode);
+ QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressCountry,
+ contactCopy), s_homeAddressCountry);
+ QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLabel, contactCopy),
+ 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::BusinessPhone, contactCopy), s_businessPhone);
QCOMPARE(KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::MobilePhone, contactCopy), s_mobilePhone);
diff --git a/src/categoryfilterproxymodel.cpp b/src/categoryfilterproxymodel.cpp
index 35d6b05..95e7629 100644
--- a/src/categoryfilterproxymodel.cpp
+++ b/src/categoryfilterproxymodel.cpp
@@ -48,15 +48,15 @@ private:
};
CategoryFilterProxyModelPrivate::CategoryFilterProxyModelPrivate(CategoryFilterProxyModel *parent)
- : QObject(),
- filterEnabled(false),
- q_ptr(parent)
+ : QObject()
+ , filterEnabled(false)
+ , q_ptr(parent)
{
}
CategoryFilterProxyModel::CategoryFilterProxyModel(QObject *parent)
- : QSortFilterProxyModel(parent),
- d_ptr(new CategoryFilterProxyModelPrivate(this))
+ : QSortFilterProxyModel(parent)
+ , d_ptr(new CategoryFilterProxyModelPrivate(this))
{
setDynamicSortFilter(true);
}
diff --git a/src/categoryfilterproxymodel.h b/src/categoryfilterproxymodel.h
index e06b9b6..789c8c2 100644
--- a/src/categoryfilterproxymodel.h
+++ b/src/categoryfilterproxymodel.h
@@ -76,7 +76,7 @@ protected:
/**
* @reimp
**/
- bool filterAcceptsRow(int row, const QModelIndex &parent) const Q_DECL_OVERRIDE;
+ bool filterAcceptsRow(int row, const QModelIndex &parent) const Q_DECL_OVERRIDE;
private:
CategoryFilterProxyModelPrivate *const d_ptr;
diff --git a/src/categoryselectwidget.cpp b/src/categoryselectwidget.cpp
index b770015..0a069ed 100644
--- a/src/categoryselectwidget.cpp
+++ b/src/categoryselectwidget.cpp
@@ -69,12 +69,12 @@ private:
};
CategorySelectWidgetPrivate::CategorySelectWidgetPrivate(CategorySelectWidget *parent)
- : QObject(),
- tagModel(nullptr),
- rowOffset(0),
- updateTimer(nullptr),
- checkCombo(nullptr),
- q_ptr(parent)
+ : QObject()
+ , tagModel(nullptr)
+ , rowOffset(0)
+ , updateTimer(nullptr)
+ , checkCombo(nullptr)
+ , q_ptr(parent)
{
}
@@ -110,7 +110,7 @@ void CategorySelectWidgetPrivate::init()
connect(updateTimer, &QTimer::timeout, this, &CategorySelectWidgetPrivate::slotCheckedItemsTimer);
QToolButton *but = new QToolButton(q);
- but ->setAutoRaise(true);
+ but->setAutoRaise(true);
but->setIcon(QIcon::fromTheme(QStringLiteral("edit-undo")));
but->setToolTip(i18nc("@action:button", "Reset category filter"));
connect(but, &QToolButton::clicked, this, &CategorySelectWidgetPrivate::slotSelectAll);
@@ -184,8 +184,8 @@ void CategorySelectWidgetPrivate::slotTagsInserted(const QModelIndex &parent, in
if (parent != QModelIndex()) {
const Tag::Id 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);
+ parentId, 1,
+ Qt::MatchExactly | Qt::MatchRecursive);
if (matchList.count() == 1) { // found the parent tag
QModelIndex parentIndex = matchList.at(0);
itemModel()->itemFromIndex(parentIndex)->appendRow(it);
@@ -281,8 +281,8 @@ QList<Akonadi::Tag::Id> CategorySelectWidgetPrivate::filterTags() const
}
CategorySelectWidget::CategorySelectWidget(QWidget *parent)
- : QWidget(parent),
- d_ptr(new CategorySelectWidgetPrivate(this))
+ : QWidget(parent)
+ , d_ptr(new CategorySelectWidgetPrivate(this))
{
Q_D(CategorySelectWidget);
d->init();
diff --git a/src/configuration/kaddressbook_config_plugins.cpp b/src/configuration/kaddressbook_config_plugins.cpp
index 286dfd2..630a311 100644
--- a/src/configuration/kaddressbook_config_plugins.cpp
+++ b/src/configuration/kaddressbook_config_plugins.cpp
@@ -29,7 +29,8 @@
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)
diff --git a/src/configuration/kaddressbook_config_plugins.h b/src/configuration/kaddressbook_config_plugins.h
index d7423de..fe26acb 100644
--- a/src/configuration/kaddressbook_config_plugins.h
+++ b/src/configuration/kaddressbook_config_plugins.h
@@ -23,12 +23,10 @@
#include <KCModule>
#include <QVariant>
-namespace PimCommon
-{
+namespace PimCommon {
class ConfigurePluginsWidget;
}
-namespace KAddressBook
-{
+namespace KAddressBook {
class KCMKaddressbookPluginsConfig : public KCModule
{
Q_OBJECT
diff --git a/src/configuration/kaddressbookconfigpluginlistwidget.cpp b/src/configuration/kaddressbookconfigpluginlistwidget.cpp
index ae77d69..ddbfd29 100644
--- a/src/configuration/kaddressbookconfigpluginlistwidget.cpp
+++ b/src/configuration/kaddressbookconfigpluginlistwidget.cpp
@@ -25,12 +25,12 @@
#include <KLocalizedString>
#include <PimCommon/GenericPlugin>
-namespace
-{
+namespace {
QString kaddressbookPluginToolsGroupName()
{
return QStringLiteral("kaddressbookplugintoolsgroupname");
}
+
QString kaddressbookImportExportGroupName()
{
return QStringLiteral("kaddressbookpluginimportexportgroupname");
@@ -45,18 +45,17 @@ KAddressBookConfigPluginListWidget::KAddressBookConfigPluginListWidget(QWidget *
KAddressBookConfigPluginListWidget::~KAddressBookConfigPluginListWidget()
{
-
}
void KAddressBookConfigPluginListWidget::save()
{
PimCommon::ConfigurePluginsListWidget::savePlugins(KAddressBookPluginInterface::self()->configGroupName(),
- KAddressBookPluginInterface::self()->configPrefixSettingKey(),
- mPluginGenericItems);
+ KAddressBookPluginInterface::self()->configPrefixSettingKey(),
+ mPluginGenericItems);
PimCommon::ConfigurePluginsListWidget::savePlugins(KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configGroupName(),
- KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configPrefixSettingKey(),
- mPluginImportExportItems);
+ KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configPrefixSettingKey(),
+ mPluginImportExportItems);
}
void KAddressBookConfigPluginListWidget::doLoadFromGlobalSettings()
@@ -75,17 +74,17 @@ void KAddressBookConfigPluginListWidget::initialize()
//Necessary to initialize pluging when we load it outside kaddressbook
KAddressBookPluginInterface::self()->initializePlugins();
PimCommon::ConfigurePluginsListWidget::fillTopItems(KAddressBookPluginInterface::self()->pluginsDataList(), i18n("Tools Plugins"),
- KAddressBookPluginInterface::self()->configGroupName(),
- KAddressBookPluginInterface::self()->configPrefixSettingKey(),
- mPluginGenericItems,
- kaddressbookPluginToolsGroupName());
+ KAddressBookPluginInterface::self()->configGroupName(),
+ KAddressBookPluginInterface::self()->configPrefixSettingKey(),
+ mPluginGenericItems,
+ kaddressbookPluginToolsGroupName());
PimCommon::ConfigurePluginsListWidget::fillTopItems(KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->pluginsDataList(),
- i18n("Import/Export Plugins"),
- KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configGroupName(),
- KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configPrefixSettingKey(),
- mPluginImportExportItems,
- kaddressbookImportExportGroupName());
+ i18n("Import/Export Plugins"),
+ KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configGroupName(),
+ KAddressBookImportExport::KAddressBookImportExportPluginManager::self()->configPrefixSettingKey(),
+ mPluginImportExportItems,
+ kaddressbookImportExportGroupName());
mListWidget->expandAll();
}
diff --git a/src/contactsorter.cpp b/src/contactsorter.cpp
index ad2bd1e..14b7f56 100644
--- a/src/contactsorter.cpp
+++ b/src/contactsorter.cpp
@@ -26,35 +26,35 @@ class ContactSortHelper
{
public:
ContactSortHelper(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field, Qt::SortOrder sortOrder)
- : mSortField(field), mSortOrder(sortOrder)
+ : mSortField(field)
+ , mSortOrder(sortOrder)
{
}
- inline bool operator()(const KContacts::Addressee &contact,
- const KContacts::Addressee &otherContact) const
+ inline bool operator()(const KContacts::Addressee &contact, const KContacts::Addressee &otherContact) const
{
- int result =
- QString::localeAwareCompare(
- KAddressBookImportExport::KAddressBookImportExportContactFields::value(mSortField, contact),
- KAddressBookImportExport::KAddressBookImportExportContactFields::value(mSortField, otherContact));
+ int result
+ = QString::localeAwareCompare(
+ KAddressBookImportExport::KAddressBookImportExportContactFields::value(mSortField, contact),
+ KAddressBookImportExport::KAddressBookImportExportContactFields::value(mSortField, otherContact));
if (result == 0) {
- int givenNameResult =
- QString::localeAwareCompare(
- KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::GivenName, contact),
- KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::GivenName, otherContact));
+ int givenNameResult
+ = QString::localeAwareCompare(
+ KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::GivenName, contact),
+ KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::GivenName, otherContact));
if (givenNameResult == 0) {
- int familyNameResult =
- QString::localeAwareCompare(
- KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FamilyName, contact),
- KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FamilyName, otherContact));
+ int familyNameResult
+ = QString::localeAwareCompare(
+ KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FamilyName, contact),
+ KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FamilyName, otherContact));
if (familyNameResult == 0) {
- result =
- QString::localeAwareCompare(
- KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, contact),
- KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, otherContact));
+ result
+ = QString::localeAwareCompare(
+ KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, contact),
+ KAddressBookImportExport::KAddressBookImportExportContactFields::value(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, otherContact));
} else {
result = familyNameResult;
}
@@ -78,7 +78,8 @@ private:
};
ContactSorter::ContactSorter(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field, Qt::SortOrder sortOrder)
- : mSortField(field), mSortOrder(sortOrder)
+ : mSortField(field)
+ , mSortOrder(sortOrder)
{
}
diff --git a/src/contactsorter.h b/src/contactsorter.h
index 6cb7c33..3111e76 100644
--- a/src/contactsorter.h
+++ b/src/contactsorter.h
@@ -26,8 +26,7 @@
class ContactSorter
{
public:
- explicit ContactSorter(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field,
- Qt::SortOrder sortOrder = Qt::AscendingOrder);
+ explicit ContactSorter(KAddressBookImportExport::KAddressBookImportExportContactFields::Field field, Qt::SortOrder sortOrder = Qt::AscendingOrder);
void sort(KContacts::Addressee::List &contacts) const;
diff --git a/src/contactswitcher.cpp b/src/contactswitcher.cpp
index a4f3fc4..d1fc195 100644
--- a/src/contactswitcher.cpp
+++ b/src/contactswitcher.cpp
@@ -27,7 +27,8 @@
#include <QPushButton>
ContactSwitcher::ContactSwitcher(QWidget *parent)
- : QWidget(parent), mView(nullptr)
+ : QWidget(parent)
+ , mView(nullptr)
{
QHBoxLayout *layout = new QHBoxLayout(this);
@@ -84,8 +85,8 @@ void ContactSwitcher::nextClicked()
}
mView->selectionModel()->setCurrentIndex(mView->model()->index(row, 0),
- QItemSelectionModel::Rows |
- QItemSelectionModel::ClearAndSelect);
+ QItemSelectionModel::Rows
+ |QItemSelectionModel::ClearAndSelect);
updateStatus();
}
@@ -104,8 +105,8 @@ void ContactSwitcher::previousClicked()
}
mView->selectionModel()->setCurrentIndex(mView->model()->index(row, 0),
- QItemSelectionModel::Rows |
- QItemSelectionModel::ClearAndSelect);
+ QItemSelectionModel::Rows
+ |QItemSelectionModel::ClearAndSelect);
updateStatus();
}
@@ -133,4 +134,3 @@ void ContactSwitcher::updateStatus()
mStatusLabel->clear();
}
}
-
diff --git a/src/domain/autotests/contactgrouptest.cpp b/src/domain/autotests/contactgrouptest.cpp
index 2a7dd49..3c88db6 100644
--- a/src/domain/autotests/contactgrouptest.cpp
+++ b/src/domain/autotests/contactgrouptest.cpp
@@ -25,12 +25,10 @@
ContactGroupTest::ContactGroupTest(QObject *parent)
: QObject(parent)
{
-
}
ContactGroupTest::~ContactGroupTest()
{
-
}
void ContactGroupTest::shouldHaveDefaultValue()
diff --git a/src/domain/autotests/contacttest.cpp b/src/domain/autotests/contacttest.cpp
index 557c3ae..0e2185e 100644
--- a/src/domain/autotests/contacttest.cpp
+++ b/src/domain/autotests/contacttest.cpp
@@ -25,12 +25,10 @@
ContactTest::ContactTest(QObject *parent)
: QObject(parent)
{
-
}
ContactTest::~ContactTest()
{
-
}
void ContactTest::shouldHaveDefaultValue()
diff --git a/src/domain/autotests/contacttest.h b/src/domain/autotests/contacttest.h
index ec70083..283e639 100644
--- a/src/domain/autotests/contacttest.h
+++ b/src/domain/autotests/contacttest.h
@@ -32,7 +32,6 @@ public:
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldAssignAddresse();
-
};
#endif // CONTACTTEST_H
diff --git a/src/domain/contact.cpp b/src/domain/contact.cpp
index 5266f8d..8a40f74 100644
--- a/src/domain/contact.cpp
+++ b/src/domain/contact.cpp
@@ -24,12 +24,10 @@ using namespace Domain;
Contact::Contact()
{
-
}
Contact::~Contact()
{
-
}
KContacts::Addressee Contact::addressee() const
diff --git a/src/domain/contact.h b/src/domain/contact.h
index 7fd7d3b..142d76b 100644
--- a/src/domain/contact.h
+++ b/src/domain/contact.h
@@ -23,8 +23,7 @@
#include <KContacts/Addressee>
#include "kaddressbookdomain_export.h"
-namespace Domain
-{
+namespace Domain {
class KADDRESSBOOKDOMAIN_EXPORT Contact
{
public:
diff --git a/src/domain/contactgroup.cpp b/src/domain/contactgroup.cpp
index 654b08f..8345a05 100644
--- a/src/domain/contactgroup.cpp
+++ b/src/domain/contactgroup.cpp
@@ -24,12 +24,10 @@ using namespace Domain;
ContactGroup::ContactGroup()
{
-
}
ContactGroup::~ContactGroup()
{
-
}
QString ContactGroup::groupName() const
diff --git a/src/domain/contactgroup.h b/src/domain/contactgroup.h
index 09bdc5e..ceec5f4 100644
--- a/src/domain/contactgroup.h
+++ b/src/domain/contactgroup.h
@@ -24,8 +24,7 @@
#include <QString>
#include "kaddressbookdomain_export.h"
-namespace Domain
-{
+namespace Domain {
class KADDRESSBOOKDOMAIN_EXPORT ContactGroup
{
public:
diff --git a/src/domain/contactgrouprepository.cpp b/src/domain/contactgrouprepository.cpp
index 7a16d23..a0673f3 100644
--- a/src/domain/contactgrouprepository.cpp
+++ b/src/domain/contactgrouprepository.cpp
@@ -24,10 +24,8 @@ using namespace Domain;
ContactGroupRepository::ContactGroupRepository()
{
-
}
ContactGroupRepository::~ContactGroupRepository()
{
-
}
diff --git a/src/domain/contactgrouprepository.h b/src/domain/contactgrouprepository.h
index a5b300e..ee87118 100644
--- a/src/domain/contactgrouprepository.h
+++ b/src/domain/contactgrouprepository.h
@@ -22,8 +22,7 @@
#define CONTACTGROUPREPOSITORY_H
#include "kaddressbookdomain_export.h"
class KJob;
-namespace Domain
-{
+namespace Domain {
class ContactGroup;
class KADDRESSBOOKDOMAIN_EXPORT ContactGroupRepository
{
diff --git a/src/domain/contactrepository.cpp b/src/domain/contactrepository.cpp
index ff5f560..fcf756a 100644
--- a/src/domain/contactrepository.cpp
+++ b/src/domain/contactrepository.cpp
@@ -24,10 +24,8 @@ using namespace Domain;
ContactRepository::ContactRepository()
{
-
}
ContactRepository::~ContactRepository()
{
-
}
diff --git a/src/domain/contactrepository.h b/src/domain/contactrepository.h
index e4c358e..e782314 100644
--- a/src/domain/contactrepository.h
+++ b/src/domain/contactrepository.h
@@ -23,8 +23,7 @@
#include "kaddressbookdomain_export.h"
class KJob;
-namespace Domain
-{
+namespace Domain {
class Contact;
class KADDRESSBOOKDOMAIN_EXPORT ContactRepository
{
diff --git a/src/globalcontactmodel.h b/src/globalcontactmodel.h
index 8612f0a..e3a8b42 100644
--- a/src/globalcontactmodel.h
+++ b/src/globalcontactmodel.h
@@ -21,8 +21,7 @@
#ifndef GLOBALCONTACTMODEL_H
#define GLOBALCONTACTMODEL_H
-namespace Akonadi
-{
+namespace Akonadi {
class ChangeRecorder;
class ContactsTreeModel;
class Monitor;
diff --git a/src/kaddressbookmigrateapplication.cpp b/src/kaddressbookmigrateapplication.cpp
index 8a0bcfb..7d7508d 100644
--- a/src/kaddressbookmigrateapplication.cpp
+++ b/src/kaddressbookmigrateapplication.cpp
@@ -78,4 +78,3 @@ void KAddressBookMigrateApplication::initializeMigrator()
//TODO add folder to migrate
}
-
diff --git a/src/kaddressbookpart.cpp b/src/kaddressbookpart.cpp
index 55eef3b..aebd3bc 100644
--- a/src/kaddressbookpart.cpp
+++ b/src/kaddressbookpart.cpp
@@ -33,10 +33,10 @@
#include <QVBoxLayout>
-K_PLUGIN_FACTORY(KAddressBookFactory, registerPlugin<KAddressBookPart>();)
+K_PLUGIN_FACTORY(KAddressBookFactory, registerPlugin<KAddressBookPart>();
+ )
-KAddressBookPart::KAddressBookPart(QWidget *parentWidget, QObject *parent,
- const QVariantList &)
+KAddressBookPart::KAddressBookPart(QWidget *parentWidget, QObject *parent, const QVariantList &)
: KParts::ReadOnlyPart(parent)
{
setComponentName(QStringLiteral("kaddressbook"), i18n("KAddressBook"));
@@ -91,7 +91,6 @@ bool KAddressBookPart::openFile()
void KAddressBookPart::guiActivateEvent(KParts::GUIActivateEvent *e)
{
-
KParts::ReadOnlyPart::guiActivateEvent(e);
mMainWidget->initializePluginActions();
}
diff --git a/src/kaddressbookpart.h b/src/kaddressbookpart.h
index acc2988..b4c3875 100644
--- a/src/kaddressbookpart.h
+++ b/src/kaddressbookpart.h
@@ -27,7 +27,7 @@
class MainWidget;
-class KAddressBookPart: public KParts::ReadOnlyPart
+class KAddressBookPart : public KParts::ReadOnlyPart
{
Q_OBJECT
diff --git a/src/listview/tests/addressbooklistviewmodel.cpp b/src/listview/tests/addressbooklistviewmodel.cpp
index 1301871..63edb63 100644
--- a/src/listview/tests/addressbooklistviewmodel.cpp
+++ b/src/listview/tests/addressbooklistviewmodel.cpp
@@ -22,12 +22,10 @@
AddressBookListViewModel::AddressBookListViewModel(QObject *parent)
: QIdentityProxyModel(parent)
{
-
}
AddressBookListViewModel::~AddressBookListViewModel()
{
-
}
QHash<int, QByteArray> AddressBookListViewModel::roleNames() const
diff --git a/src/listview/tests/addressbookmainwidget.cpp b/src/listview/tests/addressbookmainwidget.cpp
index c7ff267..92e50c3 100644
--- a/src/listview/tests/addressbookmainwidget.cpp
+++ b/src/listview/tests/addressbookmainwidget.cpp
@@ -64,8 +64,8 @@ public:
if (role == Qt::CheckStateRole) {
// Don't show the checkbox if the collection can't contain incidences
- const Akonadi::Collection collection =
- index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
+ const Akonadi::Collection collection
+ = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
if (collection.isValid() && isStructuralCollection(collection)) {
return QVariant();
}
@@ -89,8 +89,8 @@ AddressBookMainWidget::AddressBookMainWidget(QWidget *parent)
mCollectionSelectionModel = new QItemSelectionModel(mCollectionTree);
- StructuralCollectionsNotCheckableProxy *checkableProxyModel =
- new StructuralCollectionsNotCheckableProxy(this);
+ StructuralCollectionsNotCheckableProxy *checkableProxyModel
+ = new StructuralCollectionsNotCheckableProxy(this);
checkableProxyModel->setSelectionModel(mCollectionSelectionModel);
checkableProxyModel->setSourceModel(mCollectionTree);
@@ -106,8 +106,8 @@ AddressBookMainWidget::AddressBookMainWidget(QWidget *parent)
connect(mCollectionView, SIGNAL(currentChanged(Akonadi::Collection)),
this, SLOT(slotCurrentCollectionChanged(Akonadi::Collection)));
#endif
- KSelectionProxyModel *selectionProxyModel =
- new KSelectionProxyModel(mCollectionSelectionModel, this);
+ KSelectionProxyModel *selectionProxyModel
+ = new KSelectionProxyModel(mCollectionSelectionModel, this);
selectionProxyModel->setSourceModel(GlobalContactModel::instance()->model());
selectionProxyModel->setFilterBehavior(KSelectionProxyModel::ChildrenOfExactSelection);
@@ -126,7 +126,7 @@ AddressBookMainWidget::AddressBookMainWidget(QWidget *parent)
#endif
mContactsFilterModel = new Akonadi::ContactsFilterProxyModel(this);
- mContactsFilterModel->setSourceModel(/*mCategoryFilterModel*/mItemTree);
+ mContactsFilterModel->setSourceModel(/*mCategoryFilterModel*/ mItemTree);
mItemView->setModel(mContactsFilterModel);
mAddressbookQuickWidget->addressBookModel()->setSourceModel(mContactsFilterModel);
//mItemView->setXmlGuiClient(guiClient);
@@ -180,7 +180,6 @@ AddressBookMainWidget::AddressBookMainWidget(QWidget *parent)
AddressBookMainWidget::~AddressBookMainWidget()
{
-
}
void AddressBookMainWidget::itemSelected(const Akonadi::Item &item)
@@ -207,9 +206,9 @@ void AddressBookMainWidget::initGrantleeThemeName()
void AddressBookMainWidget::setupAction(KActionCollection *collection)
{
mGrantleeThemeManager = new GrantleeTheme::ThemeManager(QStringLiteral("addressbook"),
- QStringLiteral("theme.desktop"),
- collection,
- QStringLiteral("kaddressbook/viewertemplates/"));
+ QStringLiteral("theme.desktop"),
+ collection,
+ QStringLiteral("kaddressbook/viewertemplates/"));
mGrantleeThemeManager->setDownloadNewStuffConfigFile(QStringLiteral("kaddressbook_themes.knsrc"));
//connect(mGrantleeThemeManager, &GrantleeTheme::ThemeManager::grantleeThemeSelected, this, &MainWidget::slotGrantleeThemeSelected);
//connect(mGrantleeThemeManager, &GrantleeTheme::ThemeManager::updateThemes, this, &MainWidget::slotGrantleeThemesUpdated);
@@ -292,4 +291,3 @@ void AddressBookMainWidget::setupGui()
mContactGroupDetails->setContactGroupFormatter(mGroupFormatter);
}
-
diff --git a/src/listview/tests/addressbookquickwidget.cpp b/src/listview/tests/addressbookquickwidget.cpp
index cb07bfe..16f8e85 100644
--- a/src/listview/tests/addressbookquickwidget.cpp
+++ b/src/listview/tests/addressbookquickwidget.cpp
@@ -35,7 +35,6 @@ AddressBookQuickWidget::AddressBookQuickWidget(QWidget *parent)
AddressBookQuickWidget::~AddressBookQuickWidget()
{
-
}
void AddressBookQuickWidget::loadQmlFile(const QString &qmlFilePath)
diff --git a/src/listview/tests/mainwindow.cpp b/src/listview/tests/mainwindow.cpp
index 2188978..35c516f 100644
--- a/src/listview/tests/mainwindow.cpp
+++ b/src/listview/tests/mainwindow.cpp
@@ -28,5 +28,4 @@ MainWindow::MainWindow(QWidget *parent)
MainWindow::~MainWindow()
{
-
}
diff --git a/src/main.cpp b/src/main.cpp
index 2e6f1ad..e68f02a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -36,10 +36,11 @@ class KAddressBookApplication : public KontactInterface::PimUniqueApplication
{
public:
KAddressBookApplication(int &argc, char **argv[])
- : KontactInterface::PimUniqueApplication(argc, argv),
- mMainWindow(nullptr)
+ : KontactInterface::PimUniqueApplication(argc, argv)
+ , mMainWindow(nullptr)
{
}
+
int activate(const QStringList &arguments, const QString &) Q_DECL_OVERRIDE;
private:
diff --git a/src/mainwidget.cpp b/src/mainwidget.cpp
index ef46589..231a73a 100644
--- a/src/mainwidget.cpp
+++ b/src/mainwidget.cpp
@@ -100,8 +100,7 @@
#include "plugininterface/kaddressbookplugininterface.h"
-namespace
-{
+namespace {
static bool isStructuralCollection(const Akonadi::Collection &collection)
{
const QStringList mimeTypes = {KContacts::Addressee::mimeType(), KContacts::ContactGroup::mimeType()};
@@ -130,8 +129,8 @@ public:
if (role == Qt::CheckStateRole) {
// Don't show the checkbox if the collection can't contain incidences
- const Akonadi::Collection collection =
- index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
+ const Akonadi::Collection collection
+ = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
if (collection.isValid() && isStructuralCollection(collection)) {
return QVariant();
}
@@ -139,19 +138,17 @@ public:
return KCheckableProxyModel::data(index, role);
}
};
-
}
MainWidget::MainWidget(KXMLGUIClient *guiClient, QWidget *parent)
- : QWidget(parent),
- mAllContactsModel(nullptr),
- mXmlGuiClient(guiClient),
- mGrantleeThemeManager(nullptr),
- mQuickSearchAction(nullptr),
- mServerSideSubscription(nullptr)
+ : QWidget(parent)
+ , mAllContactsModel(nullptr)
+ , mXmlGuiClient(guiClient)
+ , mGrantleeThemeManager(nullptr)
+ , mQuickSearchAction(nullptr)
+ , mServerSideSubscription(nullptr)
{
-
- (void) new KaddressbookAdaptor(this);
+ (void)new KaddressbookAdaptor(this);
QDBusConnection::sessionBus().registerObject(QStringLiteral("/KAddressBook"), this);
mManageShowCollectionProperties = new ManageShowCollectionProperties(this, this);
@@ -224,8 +221,8 @@ MainWidget::MainWidget(KXMLGUIClient *guiClient, QWidget *parent)
mCollectionTree->setHeaderGroup(Akonadi::EntityTreeModel::CollectionTreeHeaders);
mCollectionSelectionModel = new QItemSelectionModel(mCollectionTree);
- StructuralCollectionsNotCheckableProxy *checkableProxyModel =
- new StructuralCollectionsNotCheckableProxy(this);
+ StructuralCollectionsNotCheckableProxy *checkableProxyModel
+ = new StructuralCollectionsNotCheckableProxy(this);
checkableProxyModel->setSelectionModel(mCollectionSelectionModel);
checkableProxyModel->setSourceModel(mCollectionTree);
@@ -240,8 +237,8 @@ MainWidget::MainWidget(KXMLGUIClient *guiClient, QWidget *parent)
connect(mCollectionView, SIGNAL(currentChanged(Akonadi::Collection)),
this, SLOT(slotCurrentCollectionChanged(Akonadi::Collection)));
- KSelectionProxyModel *selectionProxyModel =
- new KSelectionProxyModel(mCollectionSelectionModel, this);
+ KSelectionProxyModel *selectionProxyModel
+ = new KSelectionProxyModel(mCollectionSelectionModel, this);
selectionProxyModel->setSourceModel(GlobalContactModel::instance()->model());
selectionProxyModel->setFilterBehavior(KSelectionProxyModel::ChildrenOfExactSelection);
@@ -308,7 +305,8 @@ MainWidget::MainWidget(KXMLGUIClient *guiClient, QWidget *parent)
}
mActionManager->interceptAction(Akonadi::StandardActionManager::CollectionProperties);
- connect(mActionManager->action(Akonadi::StandardActionManager::CollectionProperties), &QAction::triggered, mManageShowCollectionProperties, &ManageShowCollectionProperties::showCollectionProperties);
+ connect(mActionManager->action(
+ Akonadi::StandardActionManager::CollectionProperties), &QAction::triggered, mManageShowCollectionProperties, &ManageShowCollectionProperties::showCollectionProperties);
connect(mItemView, SIGNAL(currentChanged(Akonadi::Item)),
this, SLOT(itemSelected(Akonadi::Item)));
@@ -347,7 +345,8 @@ void MainWidget::initializeImportExportPlugin(KActionCollection *collection)
QList<QAction *> exportActions;
for (KAddressBookImportExport::KAddressBookImportExportPlugin *plugin : listPlugins) {
if (plugin->isEnabled()) {
- KAddressBookImportExport::KAddressBookImportExportPluginInterface *interface = static_cast<KAddressBookImportExport::KAddressBookImportExportPluginInterface *>(plugin->createInterface(collection, this));
+ KAddressBookImportExport::KAddressBookImportExportPluginInterface *interface
+ = static_cast<KAddressBookImportExport::KAddressBookImportExportPluginInterface *>(plugin->createInterface(collection, this));
interface->setItemSelectionModel(mItemView->selectionModel());
interface->createAction(collection);
importActions.append(interface->importActions());
@@ -618,14 +617,14 @@ void MainWidget::setupActions(KActionCollection *collection)
KAddressBookPluginInterface::self()->createPluginInterface();
mGrantleeThemeManager = new GrantleeTheme::ThemeManager(QStringLiteral("addressbook"),
- QStringLiteral("theme.desktop"),
- collection,
- QStringLiteral("kaddressbook/viewertemplates/"));
+ QStringLiteral("theme.desktop"),
+ collection,
+ QStringLiteral("kaddressbook/viewertemplates/"));
mGrantleeThemeManager->setDownloadNewStuffConfigFile(QStringLiteral("kaddressbook_themes.knsrc"));
connect(mGrantleeThemeManager, &GrantleeTheme::ThemeManager::grantleeThemeSelected, this, &MainWidget::slotGrantleeThemeSelected);
connect(mGrantleeThemeManager, &GrantleeTheme::ThemeManager::updateThemes, this, &MainWidget::slotGrantleeThemesUpdated);
- KActionMenu *themeMenu = new KActionMenu(i18n("&Themes"), this);
+ KActionMenu *themeMenu = new KActionMenu(i18n("&Themes"), this);
collection->addAction(QStringLiteral("theme_menu"), themeMenu);
initGrantleeThemeName();
@@ -677,7 +676,7 @@ void MainWidget::setupActions(KActionCollection *collection)
act->setCheckable(true);
act->setData(2);
collection->addAction(QStringLiteral("view_mode_2columns"), act);
- collection->setDefaultShortcut(act, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_2));
+ collection->setDefaultShortcut(act, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_2));
act = new QAction(i18nc("@action:inmenu", "Three Columns"), mViewModeGroup);
act->setCheckable(true);
@@ -685,7 +684,7 @@ void MainWidget::setupActions(KActionCollection *collection)
collection->setDefaultShortcut(act, QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_3));
collection->addAction(QStringLiteral("view_mode_3columns"), act);
- connect(mViewModeGroup, SIGNAL(triggered(QAction*)), SLOT(setViewMode(QAction*)));
+ connect(mViewModeGroup, SIGNAL(triggered(QAction *)), SLOT(setViewMode(QAction *)));
KToggleAction *actTheme = mGrantleeThemeManager->actionForTheme();
if (actTheme) {
@@ -801,8 +800,8 @@ void MainWidget::selectFirstItem()
// in the item view, so that the detailsview is updated
if (mItemView && mItemView->selectionModel()) {
mItemView->selectionModel()->setCurrentIndex(mItemView->model()->index(0, 0),
- QItemSelectionModel::Rows |
- QItemSelectionModel::ClearAndSelect);
+ QItemSelectionModel::Rows
+ |QItemSelectionModel::ClearAndSelect);
}
}
@@ -837,8 +836,8 @@ void MainWidget::setQRCodeShow(bool on)
Akonadi::Item::List MainWidget::selectedItems()
{
Akonadi::Item::List items;
- QPointer<KAddressBookImportExport::KAddressBookContactSelectionDialog> dlg =
- new KAddressBookImportExport::KAddressBookContactSelectionDialog(mItemView->selectionModel(), false, this);
+ QPointer<KAddressBookImportExport::KAddressBookContactSelectionDialog> dlg
+ = new KAddressBookImportExport::KAddressBookContactSelectionDialog(mItemView->selectionModel(), false, this);
dlg->setDefaultAddressBook(currentAddressBook());
if (!dlg->exec() || !dlg) {
delete dlg;
@@ -855,8 +854,8 @@ Akonadi::Collection MainWidget::currentAddressBook() const
{
if (mCollectionView->selectionModel() && mCollectionView->selectionModel()->hasSelection()) {
const QModelIndex index = mCollectionView->selectionModel()->selectedIndexes().first();
- const Akonadi::Collection collection =
- index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
+ const Akonadi::Collection collection
+ = index.data(Akonadi::EntityTreeModel::CollectionRole).value<Akonadi::Collection>();
return collection;
}
@@ -1044,10 +1043,10 @@ const Akonadi::Item::List MainWidget::collectSelectedAllContactsItem(QItemSelect
for (int i = 0; i < indexes.count(); ++i) {
const QModelIndex index = indexes.at(i);
if (index.isValid()) {
- const Akonadi::Item item =
- index.data(Akonadi::EntityTreeModel::ItemRole).value<Akonadi::Item>();
+ const Akonadi::Item item
+ = index.data(Akonadi::EntityTreeModel::ItemRole).value<Akonadi::Item>();
if (item.isValid()) {
- if (item.hasPayload<KContacts::Addressee>() || item.hasPayload<KContacts::ContactGroup>()) {
+ if (item.hasPayload<KContacts::Addressee>() || item.hasPayload<KContacts::ContactGroup>()) {
lst.append(item);
}
}
@@ -1075,4 +1074,3 @@ void MainWidget::slotCurrentCollectionChanged(const Akonadi::Collection &col)
bool isOnline;
mServerSideSubscription->setEnabled(PimCommon::MailUtil::isImapFolder(col, isOnline));
}
-
diff --git a/src/mainwidget.h b/src/mainwidget.h
index 349e8f4..8cb713f 100644
--- a/src/mainwidget.h
+++ b/src/mainwidget.h
@@ -26,13 +26,11 @@
#include <QItemSelection>
#include <QWidget>
-namespace GrantleeTheme
-{
+namespace GrantleeTheme {
class ThemeManager;
}
class QAction;
-namespace Akonadi
-{
+namespace Akonadi {
class Collection;
class ContactGroupViewer;
class ContactViewer;
@@ -43,18 +41,15 @@ class Item;
class StandardContactActionManager;
class EntityTreeModel;
}
-namespace PimCommon
-{
+namespace PimCommon {
class AbstractGenericPluginInterface;
}
-namespace KAddressBookGrantlee
-{
+namespace KAddressBookGrantlee {
class GrantleeContactFormatter;
class GrantleeContactGroupFormatter;
}
-namespace KAddressBookImportExport
-{
+namespace KAddressBookImportExport {
class KAddressBookImportExportPluginManager;
class KAddressBookImportExportPluginInterface;
}
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 68bd87e..7cfdcdd 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -70,8 +70,8 @@ void MainWindow::initActions()
KStandardAction::quit(this, &MainWindow::close, actionCollection());
mHideMenuBarAction = KStandardAction::showMenubar(this, &MainWindow::slotToggleMenubar, actionCollection());
- QAction *action =
- KStandardAction::keyBindings(this, &MainWindow::configureKeyBindings, actionCollection());
+ QAction *action
+ = KStandardAction::keyBindings(this, &MainWindow::configureKeyBindings, actionCollection());
action->setWhatsThis(
i18nc("@info:whatsthis",
"You will be presented with a dialog where you can configure "
diff --git a/src/manageshowcollectionproperties.cpp b/src/manageshowcollectionproperties.cpp
index 2e36e08..b49162c 100644
--- a/src/manageshowcollectionproperties.cpp
+++ b/src/manageshowcollectionproperties.cpp
@@ -17,7 +17,6 @@
Boston, MA 02110-1301, USA.
*/
-
#include "manageshowcollectionproperties.h"
#include "mainwidget.h"
#include "kaddressbook_debug.h"
@@ -32,8 +31,8 @@
#include <KLocalizedString>
ManageShowCollectionProperties::ManageShowCollectionProperties(MainWidget *mainWidget, QObject *parent)
- : QObject(parent),
- mMainWidget(mainWidget)
+ : QObject(parent)
+ , mMainWidget(mainWidget)
{
static bool pageRegistered = false;
@@ -50,7 +49,6 @@ ManageShowCollectionProperties::ManageShowCollectionProperties(MainWidget *mainW
ManageShowCollectionProperties::~ManageShowCollectionProperties()
{
-
}
void ManageShowCollectionProperties::showCollectionProperties()
@@ -82,7 +80,7 @@ void ManageShowCollectionProperties::slotCollectionPropertiesContinued(KJob *job
}
}
Akonadi::CollectionFetchJob *fetch = new Akonadi::CollectionFetchJob(mMainWidget->currentAddressBook(),
- Akonadi::CollectionFetchJob::Base);
+ Akonadi::CollectionFetchJob::Base);
fetch->fetchScope().setIncludeStatistics(true);
connect(fetch, &KJob::result,
this, &ManageShowCollectionProperties::slotCollectionPropertiesFinished);
diff --git a/src/manageshowcollectionproperties.h b/src/manageshowcollectionproperties.h
index 29cc912..59430da 100644
--- a/src/manageshowcollectionproperties.h
+++ b/src/manageshowcollectionproperties.h
@@ -17,15 +17,13 @@
Boston, MA 02110-1301, USA.
*/
-
#ifndef MANAGESHOWCOLLECTIONPROPERTIES_H
#define MANAGESHOWCOLLECTIONPROPERTIES_H
#include <QObject>
#include <QPointer>
#include <AkonadiCore/Collection>
-namespace Akonadi
-{
+namespace Akonadi {
class CollectionPropertiesDialog;
}
class MainWidget;
diff --git a/src/modelcolumnmanager.cpp b/src/modelcolumnmanager.cpp
index 148e30c..ed6a281 100644
--- a/src/modelcolumnmanager.cpp
+++ b/src/modelcolumnmanager.cpp
@@ -33,7 +33,9 @@
#include <QWidget>
ModelColumnManager::ModelColumnManager(Akonadi::ContactsTreeModel *model, QObject *parent)
- : QObject(parent), mModel(model), mWidget(nullptr)
+ : QObject(parent)
+ , mModel(model)
+ , mWidget(nullptr)
{
}
@@ -206,4 +208,3 @@ void ModelColumnManager::adaptHeaderView()
view->setDefaultAlignment(mModel->columns().count() == 1 ? Qt::AlignCenter : Qt::AlignLeft);
}
}
-
diff --git a/src/plugininterface/kaddressbookplugininterface.cpp b/src/plugininterface/kaddressbookplugininterface.cpp
index 18b67a4..89b2c2c 100644
--- a/src/plugininterface/kaddressbookplugininterface.cpp
+++ b/src/plugininterface/kaddressbookplugininterface.cpp
@@ -38,14 +38,15 @@ public:
{
delete kaddressBookPluginInterface;
}
+
KAddressBookPluginInterface *kaddressBookPluginInterface;
};
Q_GLOBAL_STATIC(KAddressBookPluginInterfacePrivate, sInstance)
KAddressBookPluginInterface::KAddressBookPluginInterface(QObject *parent)
- : PimCommon::PluginInterface(parent),
- mMainWidget(nullptr)
+ : PimCommon::PluginInterface(parent)
+ , mMainWidget(nullptr)
{
setPluginName(QStringLiteral("kaddressbook"));
setServiceTypeName(QStringLiteral("KAddressBook/MainViewPlugin"));
@@ -53,7 +54,6 @@ KAddressBookPluginInterface::KAddressBookPluginInterface(QObject *parent)
KAddressBookPluginInterface::~KAddressBookPluginInterface()
{
-
}
KAddressBookPluginInterface *KAddressBookPluginInterface::self()
@@ -87,4 +87,3 @@ void KAddressBookPluginInterface::setMainWidget(MainWidget *mainWidget)
{
mMainWidget = mainWidget;
}
-
diff --git a/src/printing/compact/compactstyle.cpp b/src/printing/compact/compactstyle.cpp
index 0d79361..0bfe061 100644
--- a/src/printing/compact/compactstyle.cpp
+++ b/src/printing/compact/compactstyle.cpp
@@ -49,9 +49,7 @@ const char *WithEMail = "WithEMail";
const char *FirstColor = "FirstColor";
const char *SecondColor = "SecondColor";
-namespace KABPrinting
-{
-
+namespace KABPrinting {
class CompactStyleForm : public QWidget, public Ui::CompactStyleForm_Base
{
public:
@@ -62,33 +60,32 @@ public:
setupUi(this);
}
};
-
}
QString CompactStyle::contactsToHtml(const KContacts::Addressee::List &contacts) const
{
// collect the fields are need to print
KAddressBookImportExport::KAddressBookImportExportContactFields::Fields fields;
- fields << KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName;
+ fields << KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName;
if (this->withHomeAddress) {
- fields << KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressStreet
- << KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostalCode
- << KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLocality
- << KAddressBookImportExport::KAddressBookImportExportContactFields::HomePhone
- << KAddressBookImportExport::KAddressBookImportExportContactFields::MobilePhone;
+ fields << KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressStreet
+ << KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressPostalCode
+ << KAddressBookImportExport::KAddressBookImportExportContactFields::HomeAddressLocality
+ << KAddressBookImportExport::KAddressBookImportExportContactFields::HomePhone
+ << KAddressBookImportExport::KAddressBookImportExportContactFields::MobilePhone;
}
if (this->withBusinessAddress) {
- fields << KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressStreet
- << KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostalCode
- << KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLocality
- << KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessPhone;
+ fields << KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressStreet
+ << KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressPostalCode
+ << KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessAddressLocality
+ << KAddressBookImportExport::KAddressBookImportExportContactFields::BusinessPhone;
}
if (this->withEMail) {
- fields << KAddressBookImportExport::KAddressBookImportExportContactFields::PreferredEmail
- << KAddressBookImportExport::KAddressBookImportExportContactFields::Email2;
+ fields << KAddressBookImportExport::KAddressBookImportExportContactFields::PreferredEmail
+ << KAddressBookImportExport::KAddressBookImportExportContactFields::Email2;
}
if (this->withBirthday) {
- fields << KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday;
+ fields << KAddressBookImportExport::KAddressBookImportExportContactFields::Birthday;
}
QString content = QLatin1String("<html>\n");
@@ -127,8 +124,8 @@ QString CompactStyle::contactsToHtml(const KContacts::Addressee::List &contacts)
}
CompactStyle::CompactStyle(PrintingWizard *parent)
- : PrintStyle(parent),
- mPageSettings(new CompactStyleForm(parent))
+ : PrintStyle(parent)
+ , mPageSettings(new CompactStyleForm(parent))
{
setPreview(QStringLiteral("compact-style.png"));
setPreferredSortOptions(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, Qt::AscendingOrder);
@@ -225,4 +222,3 @@ QString CompactStyleFactory::description() const
{
return i18n("Compact Printing Style");
}
-
diff --git a/src/printing/compact/compactstyle.h b/src/printing/compact/compactstyle.h
index e06bc58..1242c18 100644
--- a/src/printing/compact/compactstyle.h
+++ b/src/printing/compact/compactstyle.h
@@ -26,9 +26,7 @@
#include "printstyle.h"
-namespace KABPrinting
-{
-
+namespace KABPrinting {
class CompactStyleForm;
class CompactStyle : public PrintStyle
@@ -76,7 +74,6 @@ public:
PrintStyle *create() const Q_DECL_OVERRIDE;
QString description() const Q_DECL_OVERRIDE;
};
-
}
#endif
diff --git a/src/printing/detailled/detailledstyle.cpp b/src/printing/detailled/detailledstyle.cpp
index fea7b96..b4a83ee 100644
--- a/src/printing/detailled/detailledstyle.cpp
+++ b/src/printing/detailled/detailledstyle.cpp
@@ -96,9 +96,9 @@ QString contactsToHtml(const KContacts::Addressee::List &contacts, const ColorSe
if (!contact.emails().isEmpty()) {
ContactBlock block;
- block.header = (contact.emails().count() == 1 ?
- i18n("Email address:") :
- i18n("Email addresses:"));
+ block.header = (contact.emails().count() == 1
+ ? i18n("Email address:")
+ : i18n("Email addresses:"));
block.entries = contact.emails();
blocks.append(block);
@@ -108,9 +108,9 @@ QString contactsToHtml(const KContacts::Addressee::List &contacts, const ColorSe
const KContacts::PhoneNumber::List numbers = contact.phoneNumbers();
ContactBlock block;
- block.header = (numbers.count() == 1 ?
- i18n("Telephone:") :
- i18n("Telephones:"));
+ block.header = (numbers.count() == 1
+ ? i18n("Telephone:")
+ : i18n("Telephones:"));
for (const KContacts::PhoneNumber &number : numbers) {
const QString line = number.typeLabel() + QLatin1String(": ") + number.number();
@@ -176,14 +176,14 @@ QString contactsToHtml(const KContacts::Addressee::List &contacts, const ColorSe
content += QLatin1String(" <table style=\"border-width: 0px; border-spacing: 0px; "
"page-break-inside: avoid\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n");
content += QLatin1String(" <tr>\n");
- content += QLatin1String(" <td style=\"color: ") + settings.headerTextColor +
- QLatin1String(";\" bgcolor=\"") + settings.headerBackgroundColor +
- QLatin1String("\" style=\"padding-left: 20px\">") +
- name + QLatin1String("</td>\n");
- content += QLatin1String(" <td style=\"color: ") + settings.headerTextColor +
- QLatin1String(";\" align=\"right\" bgcolor=\"") + settings.headerBackgroundColor +
- QLatin1String("\" style=\"padding-right: 20px\">") +
- birthday + QLatin1String("</td>\n");
+ content += QLatin1String(" <td style=\"color: ") + settings.headerTextColor
+ +QLatin1String(";\" bgcolor=\"") + settings.headerBackgroundColor
+ +QLatin1String("\" style=\"padding-left: 20px\">")
+ +name + QLatin1String("</td>\n");
+ content += QLatin1String(" <td style=\"color: ") + settings.headerTextColor
+ +QLatin1String(";\" align=\"right\" bgcolor=\"") + settings.headerBackgroundColor
+ +QLatin1String("\" style=\"padding-right: 20px\">")
+ +birthday + QLatin1String("</td>\n");
content += QLatin1String(" </tr>\n");
for (int i = 0; i < blocks.count(); i += 2) {
@@ -195,9 +195,9 @@ QString contactsToHtml(const KContacts::Addressee::List &contacts, const ColorSe
// add real block data
const ContactBlock leftBlock = blocks.at(i);
- const ContactBlock rightBlock = ((i + 1 < blocks.count()) ?
- blocks.at(i + 1) :
- ContactBlock());
+ const ContactBlock rightBlock = ((i + 1 < blocks.count())
+ ? blocks.at(i + 1)
+ : ContactBlock());
content += QLatin1String(" <tr>\n");
content += QLatin1String(" <td>") + leftBlock.header + QLatin1String("</td>\n");
@@ -248,7 +248,8 @@ public:
};
DetailledPrintStyle::DetailledPrintStyle(PrintingWizard *parent)
- : PrintStyle(parent), mPageAppearance(new AppearancePage(parent))
+ : PrintStyle(parent)
+ , mPageAppearance(new AppearancePage(parent))
{
setPreview(QStringLiteral("detailed-style.png"));
setPreferredSortOptions(KAddressBookImportExport::KAddressBookImportExportContactFields::FormattedName, Qt::AscendingOrder);
@@ -262,7 +263,6 @@ DetailledPrintStyle::DetailledPrintStyle(PrintingWizard *parent)
mPageAppearance->kcbHeaderTextColor->
setColor(config.readEntry(ContactHeaderForeColor, QColor(Qt::white)));
-
}
DetailledPrintStyle::~DetailledPrintStyle()
@@ -316,4 +316,3 @@ QString DetailledPrintStyleFactory::description() const
{
return i18n("Detailed Style");
}
-
diff --git a/src/printing/detailled/detailledstyle.h b/src/printing/detailled/detailledstyle.h
index bd195aa..86000a4 100644
--- a/src/printing/detailled/detailledstyle.h
+++ b/src/printing/detailled/detailledstyle.h
@@ -28,9 +28,7 @@
#include <KContacts/Addressee>
-namespace KABPrinting
-{
-
+namespace KABPrinting {
class AppearancePage;
class DetailledPrintStyle : public PrintStyle
@@ -55,7 +53,6 @@ public:
PrintStyle *create() const Q_DECL_OVERRIDE;
QString description() const Q_DECL_OVERRIDE;
};
-
}
#endif
diff --git a/src/printing/grantlee/grantleeprintstyle.cpp b/src/printing/grantlee/grantleeprintstyle.cpp
index fc6ea3f..bb754c7 100644
--- a/src/printing/grantlee/grantleeprintstyle.cpp
+++ b/src/printing/grantlee/grantleeprintstyle.cpp
@@ -70,9 +70,9 @@ void GrantleePrintStyle::print(const KContacts::Addressee::List &contacts, Print
}
GrantleeStyleFactory::GrantleeStyleFactory(const QString &name, const QString &themePath, PrintingWizard *parent)
- : PrintStyleFactory(parent),
- mThemePath(themePath),
- mName(name)
+ : PrintStyleFactory(parent)
+ , mThemePath(themePath)
+ , mName(name)
{
}
@@ -85,4 +85,3 @@ QString GrantleeStyleFactory::description() const
{
return mName;
}
-
diff --git a/src/printing/grantlee/grantleeprintstyle.h b/src/printing/grantlee/grantleeprintstyle.h
index cf1f05e..f49d43b 100644
--- a/src/printing/grantlee/grantleeprintstyle.h
+++ b/src/printing/grantlee/grantleeprintstyle.h
@@ -22,14 +22,11 @@
#include "printstyle.h"
-namespace KAddressBookGrantlee
-{
+namespace KAddressBookGrantlee {
class GrantleePrint;
}
-namespace KABPrinting
-{
-
+namespace KABPrinting {
class PrintProgress;
class GrantleePrintStyle : public PrintStyle
@@ -56,7 +53,6 @@ private:
QString mThemePath;
QString mName;
};
-
}
#endif // GRANTLEEPRINTSTYLE_H
diff --git a/src/printing/mike/mikesstyle.cpp b/src/printing/mike/mikesstyle.cpp
index f772744..f26f1f0 100644
--- a/src/printing/mike/mikesstyle.cpp
+++ b/src/printing/mike/mikesstyle.cpp
@@ -40,7 +40,6 @@ using namespace KABPrinting;
static QString contactsToHtml(const KContacts::Addressee::List &contacts)
{
-
KAddressBookImportExport::KAddressBookImportExportContactFields::Fields leftFields, rightFields;
KAddressBookImportExport::KAddressBookImportExportContactFields::Fields allFields = KAddressBookImportExport::KAddressBookImportExportContactFields::allFields();
allFields.remove(0); // drop 'Undefined' field
@@ -154,4 +153,3 @@ QString MikesStyleFactory::description() const
{
return i18n("Mike's Printing Style");
}
-
diff --git a/src/printing/mike/mikesstyle.h b/src/printing/mike/mikesstyle.h
index d989ddd..f140e50 100644
--- a/src/printing/mike/mikesstyle.h
+++ b/src/printing/mike/mikesstyle.h
@@ -27,9 +27,7 @@
#include "printstyle.h"
-namespace KABPrinting
-{
-
+namespace KABPrinting {
class PrintProgress;
class MikesStyle : public PrintStyle
@@ -51,7 +49,6 @@ public:
PrintStyle *create() const Q_DECL_OVERRIDE;
QString description() const Q_DECL_OVERRIDE;
};
-
}
#endif
diff --git a/src/printing/printingwizard.cpp b/src/printing/printingwizard.cpp
index 7d94816..c0e245b 100644
--- a/src/printing/printingwizard.cpp
+++ b/src/printing/printingwizard.cpp
@@ -26,7 +26,6 @@
#include "printingwizard.h"
#include "settings.h"
-
#include <KAddressBookImportExport/KAddressBookContactSelectionWidget>
#include "contactsorter.h"
#include "printprogress.h"
@@ -52,17 +51,18 @@
using namespace KABPrinting;
-PrintingWizard::PrintingWizard(QPrinter *printer, QItemSelectionModel *selectionModel,
- QWidget *parent)
- : KAssistantDialog(parent), mPrinter(printer), mStyle(nullptr)
+PrintingWizard::PrintingWizard(QPrinter *printer, QItemSelectionModel *selectionModel, QWidget *parent)
+ : KAssistantDialog(parent)
+ , mPrinter(printer)
+ , mStyle(nullptr)
{
setWindowTitle(i18n("Print Contacts"));
mSelectionPage = new KAddressBookImportExport::KAddressBookContactSelectionWidget(selectionModel, this);
mSelectionPage->setMessageText(i18n("Which contacts do you want to print?"));
- KPageWidgetItem *mSelectionPageItem =
- new KPageWidgetItem(mSelectionPage, i18n("Choose Contacts to Print"));
+ KPageWidgetItem *mSelectionPageItem
+ = new KPageWidgetItem(mSelectionPage, i18n("Choose Contacts to Print"));
addPage(mSelectionPageItem);
setAppropriate(mSelectionPageItem, true);
@@ -77,9 +77,9 @@ PrintingWizard::PrintingWizard(QPrinter *printer, QItemSelectionModel *selection
slotStyleSelected(Settings::self()->printingStyle());
}
- mStylePage->setSortOrder(Settings::self()->sortOrder() == 0 ?
- Qt::AscendingOrder :
- Qt::DescendingOrder);
+ mStylePage->setSortOrder(Settings::self()->sortOrder() == 0
+ ? Qt::AscendingOrder
+ : Qt::DescendingOrder);
readConfig();
}
@@ -234,4 +234,3 @@ void PrintingWizard::print()
button(QDialogButtonBox::Cancel)->setEnabled(false);
mStyle->print(contacts, mProgress);
}
-
diff --git a/src/printing/printingwizard.h b/src/printing/printingwizard.h
index 2174b4a..85e6a81 100644
--- a/src/printing/printingwizard.h
+++ b/src/printing/printingwizard.h
@@ -32,8 +32,7 @@
#include <QStringList>
-namespace KAddressBookImportExport
-{
+namespace KAddressBookImportExport {
class KAddressBookContactSelectionWidget;
}
class StylePage;
@@ -41,14 +40,11 @@ class StylePage;
class QItemSelectionModel;
class QPrinter;
-namespace Akonadi
-{
+namespace Akonadi {
class Collection;
}
-namespace KABPrinting
-{
-
+namespace KABPrinting {
class PrintProgress;
class PrintStyle;
class PrintStyleFactory;
@@ -69,9 +65,7 @@ public:
* @param selectionModel The selection model to get the selected contacts from.
* @param parent The parent widget.
*/
- PrintingWizard(QPrinter *printer,
- QItemSelectionModel *selectionModel,
- QWidget *parent = nullptr);
+ PrintingWizard(QPrinter *printer, QItemSelectionModel *selectionModel, QWidget *parent = nullptr);
/**
* Destroys the printing wizard.
@@ -120,11 +114,11 @@ protected:
{
public:
PrintStyleDefinition(PrintStyleFactory *factory = nullptr, PrintStyle *style = nullptr)
- : printstyleFactory(factory),
- printStyle(style)
+ : printstyleFactory(factory)
+ , printStyle(style)
{
-
}
+
PrintStyleFactory *printstyleFactory;
PrintStyle *printStyle;
};
@@ -151,7 +145,6 @@ private:
void readConfig();
void loadGrantleeStyle();
};
-
}
#endif
diff --git a/src/printing/printprogress.cpp b/src/printing/printprogress.cpp
index 1982b7c..d462e32 100644
--- a/src/printing/printprogress.cpp
+++ b/src/printing/printprogress.cpp
@@ -58,8 +58,8 @@ void PrintProgress::addMessage(const QString &msg)
{
mMessages.append(msg);
- QString head = QLatin1String("<qt><b>") + i18n("Progress") +
- QLatin1String(":</b><ul>");
+ QString head = QLatin1String("<qt><b>") + i18n("Progress")
+ +QLatin1String(":</b><ul>");
const QString foot = QStringLiteral("</ul></qt>");
@@ -79,4 +79,3 @@ void PrintProgress::setProgress(int step)
mProgressBar->setValue(step);
qApp->processEvents();
}
-
diff --git a/src/printing/printprogress.h b/src/printing/printprogress.h
index 5889347..63decde 100644
--- a/src/printing/printprogress.h
+++ b/src/printing/printprogress.h
@@ -31,9 +31,7 @@ class QString;
class QTextBrowser;
-namespace KABPrinting
-{
-
+namespace KABPrinting {
/**
This defines a simple widget to display print progress
information. It is provided to all print styles during a print
@@ -63,7 +61,6 @@ private:
QTextBrowser *mLogBrowser;
QProgressBar *mProgressBar;
};
-
}
#endif
diff --git a/src/printing/printstyle.cpp b/src/printing/printstyle.cpp
index b472e46..3163ca5 100644
--- a/src/printing/printstyle.cpp
+++ b/src/printing/printstyle.cpp
@@ -24,7 +24,6 @@
#include "printstyle.h"
#include "printingwizard.h"
-
#include "kaddressbook_debug.h"
#include <QPushButton>
@@ -35,7 +34,8 @@
using namespace KABPrinting;
PrintStyle::PrintStyle(PrintingWizard *parent)
- : QObject(parent), mWizard(parent)
+ : QObject(parent)
+ , mWizard(parent)
{
mSortField = KAddressBookImportExport::KAddressBookImportExportContactFields::GivenName;
mSortOrder = Qt::AscendingOrder;
@@ -135,4 +135,3 @@ PrintStyleFactory::PrintStyleFactory(PrintingWizard *parent)
PrintStyleFactory::~PrintStyleFactory()
{
}
-
diff --git a/src/printing/printstyle.h b/src/printing/printstyle.h
index c1e0e3d..a855dc4 100644
--- a/src/printing/printstyle.h
+++ b/src/printing/printstyle.h
@@ -35,9 +35,7 @@
class KPageWidgetItem;
-namespace KABPrinting
-{
-
+namespace KABPrinting {
class PrintingWizard;
class PrintProgress;
@@ -186,7 +184,6 @@ public:
protected:
PrintingWizard *mParent;
};
-
}
#endif
diff --git a/src/printing/ringbinder/ringbinderstyle.cpp b/src/printing/ringbinder/ringbinderstyle.cpp
index 2850180..b1f62f3 100644
--- a/src/printing/ringbinder/ringbinderstyle.cpp
+++ b/src/printing/ringbinder/ringbinderstyle.cpp
@@ -99,8 +99,8 @@ static QString contactsToHtml(const KContacts::Addressee::List &contacts, int fi
if (fields & Addresses) {
const KContacts::Address::List addresses = contact.addresses();
for (const KContacts::Address &address : addresses) {
- const QString data =
- address.formattedAddress().replace(QLatin1String("\n\n"), QStringLiteral("\n")).replace(QLatin1Char('\n'), QStringLiteral("<br/>"));
+ const QString data
+ = address.formattedAddress().replace(QLatin1String("\n\n"), QStringLiteral("\n")).replace(QLatin1Char('\n'), QStringLiteral("<br/>"));
const QString subBlock = QLatin1String("<p style=\"margin-top: 0px; margin-left: 20px\">") + data + QLatin1String("</p>");
leftBlock.append(subBlock);
@@ -109,11 +109,11 @@ static QString contactsToHtml(const KContacts::Addressee::List &contacts, int fi
content += QLatin1String(" <tr>\n");
content += QLatin1String(" <td style=\"padding-left: 3px; padding-top: 3px; padding-right: 3px; "
- "padding-bottom: 3px;\">") +
- nameString + leftBlock.join(QString()) + QLatin1String("</td>\n");
+ "padding-bottom: 3px;\">")
+ +nameString + leftBlock.join(QString()) + QLatin1String("</td>\n");
content += QLatin1String(" <td style=\"padding-left: 3px; padding-top: 3px; padding-right: 3px; "
- "padding-bottom: 3px;\">") +
- rightBlock.join(QStringLiteral("<br/>")) + QLatin1String("</td>\n");
+ "padding-bottom: 3px;\">")
+ +rightBlock.join(QStringLiteral("<br/>")) + QLatin1String("</td>\n");
content += QLatin1String(" </tr>\n");
}
content += QLatin1String(" </table>\n");
@@ -123,9 +123,7 @@ static QString contactsToHtml(const KContacts::Addressee::List &contacts, int fi
return content;
}
-namespace KABPrinting
-{
-
+namespace KABPrinting {
class RingBinderStyleAppearanceForm : public QWidget, public Ui::RingBinderStyleAppearanceForm_Base
{
public:
@@ -136,12 +134,11 @@ public:
setupUi(this);
}
};
-
}
RingBinderPrintStyle::RingBinderPrintStyle(PrintingWizard *parent)
- : PrintStyle(parent),
- mPageAppearance(new RingBinderStyleAppearanceForm(parent))
+ : PrintStyle(parent)
+ , mPageAppearance(new RingBinderStyleAppearanceForm(parent))
{
setPreview(QStringLiteral("ringbinder-style.png"));
setPreferredSortOptions(KAddressBookImportExport::KAddressBookImportExportContactFields::FamilyName, Qt::AscendingOrder);
diff --git a/src/printing/ringbinder/ringbinderstyle.h b/src/printing/ringbinder/ringbinderstyle.h
index 1fe5f43..5b183a2 100644
--- a/src/printing/ringbinder/ringbinderstyle.h
+++ b/src/printing/ringbinder/ringbinderstyle.h
@@ -28,9 +28,7 @@
#include "printstyle.h"
-namespace KABPrinting
-{
-
+namespace KABPrinting {
class RingBinderStyleAppearanceForm;
class RingBinderPrintStyle : public PrintStyle
@@ -53,7 +51,6 @@ public:
PrintStyle *create() const Q_DECL_OVERRIDE;
QString description() const Q_DECL_OVERRIDE;
};
-
}
#endif
diff --git a/src/printing/stylepage.cpp b/src/printing/stylepage.cpp
index 8de8982..74f922b 100644
--- a/src/printing/stylepage.cpp
+++ b/src/printing/stylepage.cpp
@@ -38,8 +38,8 @@
static bool contactFieldsNameLesser(const KAddressBookImportExport::KAddressBookImportExportContactFields::Field &field,
const KAddressBookImportExport::KAddressBookImportExportContactFields::Field &otherField)
{
- return (QString::localeAwareCompare(KAddressBookImportExport::KAddressBookImportExportContactFields::label(field),
- KAddressBookImportExport::KAddressBookImportExportContactFields::label(otherField)) < 0);
+ return QString::localeAwareCompare(KAddressBookImportExport::KAddressBookImportExportContactFields::label(field),
+ KAddressBookImportExport::KAddressBookImportExportContactFields::label(otherField)) < 0;
}
StylePage::StylePage(QWidget *parent, const QString &name)
@@ -104,7 +104,7 @@ KAddressBookImportExport::KAddressBookImportExportContactFields::Field StylePage
Qt::SortOrder StylePage::sortOrder() const
{
- return (mSortTypeCombo->currentIndex() == 0 ? Qt::AscendingOrder : Qt::DescendingOrder);
+ return mSortTypeCombo->currentIndex() == 0 ? Qt::AscendingOrder : Qt::DescendingOrder;
}
void StylePage::initFieldCombo()
@@ -129,8 +129,8 @@ void StylePage::initGUI()
QGridLayout *topLayout = new QGridLayout(this);
- QLabel *label =
- new QLabel(
+ QLabel *label
+ = new QLabel(
i18nc("@label:textbox",
"What should the print look like?\n"
"KAddressBook has several printing styles, designed for different purposes.\n"
@@ -205,4 +205,3 @@ void StylePage::setPrintingStyle(int index)
{
mStyleCombo->setCurrentIndex(index);
}
-