summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-11-16 13:04:01 (GMT)
committerMontel Laurent <montel@kde.org>2016-11-16 13:04:01 (GMT)
commita492229ff2d141ee168b01d1f8f7874d423899a7 (patch)
tree154438c4e787da299eaf74c204c0d4af8c8f364e
parentfe49c595ea3a896646569ecbacd9f29157f2a10e (diff)
Astyle kdelibs
-rw-r--r--kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp2
-rw-r--r--plugins/messageviewerheaderplugins/fancyheaderstyleplugin/fancyheaderstyle.cpp2
-rw-r--r--plugins/plasma/pimeventsplugin/eventmodel.cpp78
-rw-r--r--plugins/plasma/pimeventsplugin/eventmodel.h4
-rw-r--r--plugins/plasma/pimeventsplugin/pimcalendarsmodel.cpp6
-rw-r--r--plugins/plasma/pimeventsplugin/pimeventsplugin.h2
6 files changed, 44 insertions, 50 deletions
diff --git a/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp b/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
index 367dee2..7526e19 100644
--- a/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
+++ b/kaddressbook/importexportplugins/vcards/vcardimportexportplugininterface.cpp
@@ -488,7 +488,7 @@ void VCardImportExportPluginInterface::exportVCard()
QLatin1Char(QLatin1Char('_')) +
list[ 0 ].familyName() +
QLatin1String(".vcf")))
- , QString(), Q_NULLPTR, options);
+ , QString(), Q_NULLPTR, options);
if (url.isEmpty()) { // user canceled export
return;
}
diff --git a/plugins/messageviewerheaderplugins/fancyheaderstyleplugin/fancyheaderstyle.cpp b/plugins/messageviewerheaderplugins/fancyheaderstyleplugin/fancyheaderstyle.cpp
index 642d9f7..658747e 100644
--- a/plugins/messageviewerheaderplugins/fancyheaderstyleplugin/fancyheaderstyle.cpp
+++ b/plugins/messageviewerheaderplugins/fancyheaderstyleplugin/fancyheaderstyle.cpp
@@ -229,7 +229,7 @@ QString FancyHeaderStyle::format(KMime::Message *message) const
}
}
- if (strategy->showHeader(QStringLiteral("disposition-notification-to"))){
+ if (strategy->showHeader(QStringLiteral("disposition-notification-to"))) {
if (auto hrd = message->headerByType("Disposition-Notification-To")) {
const QString to = hrd->asUnicodeString();
headerStr.append(QStringLiteral("<tr><th>%1</th>\n"
diff --git a/plugins/plasma/pimeventsplugin/eventmodel.cpp b/plugins/plasma/pimeventsplugin/eventmodel.cpp
index 76c28c9..6bd089b 100644
--- a/plugins/plasma/pimeventsplugin/eventmodel.cpp
+++ b/plugins/plasma/pimeventsplugin/eventmodel.cpp
@@ -30,7 +30,7 @@
#include <AkonadiCore/AttributeFactory>
#include <AkonadiCore/ItemFetchJob>
-EventModel::EventModel(QObject* parent)
+EventModel::EventModel(QObject *parent)
: Akonadi::CalendarBase(parent)
, mMonitor(Q_NULLPTR)
{
@@ -54,44 +54,43 @@ void EventModel::createMonitor()
mMonitor->fetchCollection(true);
connect(mMonitor, &Akonadi::Monitor::itemAdded,
- this, [this](const Akonadi::Item &item) {
- // This is super-ugly, but the only way how to insert into CalendarBase
- // without having direct access to CalendarBasePrivate.
- // changeId is luckily ignored by CalendarBase.
- incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
- });
+ this, [this](const Akonadi::Item & item) {
+ // This is super-ugly, but the only way how to insert into CalendarBase
+ // without having direct access to CalendarBasePrivate.
+ // changeId is luckily ignored by CalendarBase.
+ incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
+ });
connect(mMonitor, &Akonadi::Monitor::itemChanged,
- this, [this](const Akonadi::Item &item) {
- const KCalCore::Incidence::Ptr incidence = item.payload<KCalCore::Incidence::Ptr>();
- if (!incidence) {
- return; // HUH?!
- }
- const KCalCore::Incidence::Ptr oldIncidence = this->incidence(incidence->instanceIdentifier());
- if (!oldIncidence) {
- // Change for event we don't know about -> discard
- return;
- }
-
- // Unfortunately the plasma applet does not handle event moves
- // so we have to simulate via remove+add
- if (oldIncidence->allDay() != incidence->allDay()
- || oldIncidence->dtStart() != incidence->dtStart()
- || oldIncidence->dateTime(KCalCore::IncidenceBase::RoleEnd) != incidence->dateTime(KCalCore::IncidenceBase::RoleEnd)) {
- incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
- incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
- } else {
- incidenceChanger()->modifyFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
- }
- });
+ this, [this](const Akonadi::Item & item) {
+ const KCalCore::Incidence::Ptr incidence = item.payload<KCalCore::Incidence::Ptr>();
+ if (!incidence) {
+ return; // HUH?!
+ }
+ const KCalCore::Incidence::Ptr oldIncidence = this->incidence(incidence->instanceIdentifier());
+ if (!oldIncidence) {
+ // Change for event we don't know about -> discard
+ return;
+ }
+
+ // Unfortunately the plasma applet does not handle event moves
+ // so we have to simulate via remove+add
+ if (oldIncidence->allDay() != incidence->allDay()
+ || oldIncidence->dtStart() != incidence->dtStart()
+ || oldIncidence->dateTime(KCalCore::IncidenceBase::RoleEnd) != incidence->dateTime(KCalCore::IncidenceBase::RoleEnd)) {
+ incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
+ incidenceChanger()->createFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
+ } else {
+ incidenceChanger()->modifyFinished(0, item, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
+ }
+ });
connect(mMonitor, &Akonadi::Monitor::itemRemoved,
- this, [this](const Akonadi::Item &item) {
- incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
- });
+ this, [this](const Akonadi::Item & item) {
+ incidenceChanger()->deleteFinished(0, { item.id() }, Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
+ });
connect(mMonitor, &Akonadi::Monitor::collectionRemoved,
this, &EventModel::removeCalendar);
}
-
void EventModel::addCalendar(const Akonadi::Collection &col)
{
if (!mCols.contains(col)) {
@@ -128,7 +127,6 @@ Akonadi::Collection EventModel::collection(qint64 id) const
return it == mCols.cend() ? Akonadi::Collection(id) : *it;
}
-
void EventModel::populateCollection(const Akonadi::Collection &col)
{
qCDebug(PIMEVENTSPLUGIN_LOG) << "Populating events from collection" << col.id();
@@ -140,11 +138,11 @@ void EventModel::populateCollection(const Akonadi::Collection &col)
connect(job, &Akonadi::ItemFetchJob::itemsReceived,
this, &EventModel::onItemsReceived);
connect(job, &Akonadi::ItemFetchJob::result,
- job, [this, col](KJob *job) {
- mFetchJobs.remove(col.id());
- auto fetch = qobject_cast<Akonadi::ItemFetchJob*>(job);
- qCDebug(PIMEVENTSPLUGIN_LOG) << "Received" << fetch->count() << "events for collection" << col.id();
- });
+ job, [this, col](KJob * job) {
+ mFetchJobs.remove(col.id());
+ auto fetch = qobject_cast<Akonadi::ItemFetchJob *>(job);
+ qCDebug(PIMEVENTSPLUGIN_LOG) << "Received" << fetch->count() << "events for collection" << col.id();
+ });
}
void EventModel::onItemsReceived(const Akonadi::Item::List &items)
@@ -152,7 +150,7 @@ void EventModel::onItemsReceived(const Akonadi::Item::List &items)
qCDebug(PIMEVENTSPLUGIN_LOG) << "Batch: received" << items.count() << "items";
for (const auto &item : items) {
incidenceChanger()->createFinished(0, item,
- Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
+ Akonadi::IncidenceChanger::ResultCodeSuccess, QString());
}
}
diff --git a/plugins/plasma/pimeventsplugin/eventmodel.h b/plugins/plasma/pimeventsplugin/eventmodel.h
index efd8873..1feff69 100644
--- a/plugins/plasma/pimeventsplugin/eventmodel.h
+++ b/plugins/plasma/pimeventsplugin/eventmodel.h
@@ -59,7 +59,3 @@ private:
#endif
-
-
-
-
diff --git a/plugins/plasma/pimeventsplugin/pimcalendarsmodel.cpp b/plugins/plasma/pimeventsplugin/pimcalendarsmodel.cpp
index 69839df..ca402f6 100644
--- a/plugins/plasma/pimeventsplugin/pimcalendarsmodel.cpp
+++ b/plugins/plasma/pimeventsplugin/pimcalendarsmodel.cpp
@@ -49,9 +49,9 @@ PimCalendarsModel::PimCalendarsModel(QObject *parent)
mEtm->setItemPopulationStrategy(Akonadi::EntityTreeModel::NoItemPopulation);
mEtm->setListFilter(Akonadi::CollectionFetchScope::Enabled);
connect(mEtm, &Akonadi::EntityTreeModel::collectionTreeFetched,
- this, [this]() {
- sort(0, Qt::AscendingOrder);
- });
+ this, [this]() {
+ sort(0, Qt::AscendingOrder);
+ });
setSourceModel(mEtm);
diff --git a/plugins/plasma/pimeventsplugin/pimeventsplugin.h b/plugins/plasma/pimeventsplugin/pimeventsplugin.h
index 21ed889..3a2a79b 100644
--- a/plugins/plasma/pimeventsplugin/pimeventsplugin.h
+++ b/plugins/plasma/pimeventsplugin/pimeventsplugin.h
@@ -30,7 +30,7 @@ class ETMCalendar;
class PimDataSource;
class PimEventsPlugin : public CalendarEvents::CalendarEventsPlugin
- , public KCalCore::Calendar::CalendarObserver
+ , public KCalCore::Calendar::CalendarObserver
{
Q_OBJECT
Q_INTERFACES(CalendarEvents::CalendarEventsPlugin)