Commit 1b915dba authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Clean forward declaration + port to for(...:...)

parent 8bae05eb
......@@ -31,7 +31,6 @@ class AuthJob;
}
class ImapAccount;
class KJob;
class GmailSettings : public Settings
{
......
......@@ -29,7 +29,6 @@
#include <QtCore/QMap>
class QKeyEvent;
class QStandardItemModel;
class QStandardItem;
......@@ -37,7 +36,6 @@ class QLineEdit;
class QCheckBox;
class ImapAccount;
class QTreeView;
class QListView;
class QPushButton;
class SubscriptionFilterProxyModel : public KRecursiveFilterProxyModel
......
......@@ -711,7 +711,7 @@ void OpenXchangeResource::onObjectsRequestDeltaJobFinished(KJob *job)
Item::List changedItems;
const OXA::Object::List modifiedObjects = requestJob->modifiedObjects();
foreach (const OXA::Object &object, modifiedObjects) {
for (const OXA::Object &object : modifiedObjects) {
Item item;
switch (object.module()) {
case OXA::Folder::Contacts:
......@@ -1022,9 +1022,9 @@ void OpenXchangeResource::onFoldersRequestDeltaJobFinished(KJob *job)
Collection::List removedCollections;
// add the deleted folders from the server
OXA::Folder::List deletedFolders = requestJob->deletedFolders();
const OXA::Folder::List deletedFolders = requestJob->deletedFolders();
removedCollections.reserve(deletedFolders.count());
foreach (const OXA::Folder &folder, deletedFolders) {
for (const OXA::Folder &folder : deletedFolders) {
Collection collection;
collection.setRemoteId(QString::number(folder.objectId()));
......
......@@ -257,7 +257,7 @@ static void parseRecurrence(const QDomElement &element,
} else if ((tagName == QLatin1String("deleteexceptions")) || (tagName == QLatin1String("changeexceptions"))) {
const QStringList exceptionDates = text.split(QLatin1Char(','));
deleteExceptions.reserve(exceptionDates.count());
foreach (const QString &date, exceptionDates) {
for (const QString &date : exceptionDates) {
deleteExceptions.append(OXUtils::readDate(date));
}
} else if (tagName == QLatin1String("until")) {
......@@ -323,7 +323,7 @@ static void createIncidenceAttributes(QDomDocument &document, QDomElement &paren
if (incidence->attendeeCount() > 0) {
QDomElement members = DAVUtils::addOxElement(document, parent, QStringLiteral("participants"));
const KCalCore::Attendee::List attendees = incidence->attendees();
foreach (const KCalCore::Attendee::Ptr &attendee, attendees) {
for (const KCalCore::Attendee::Ptr &attendee : attendees) {
const User user = Users::self()->lookupEmail(attendee->email());
if (!user.isValid()) {
......@@ -500,7 +500,7 @@ static void createRecurrenceAttributes(QDomDocument &document, QDomElement &pare
QStringList dates;
dates.reserve(exceptionList.count());
foreach (const QDate &date, exceptionList) {
for (const QDate &date : exceptionList) {
dates.append(OXUtils::writeDate(date));
}
......
......@@ -59,7 +59,7 @@ void UserIdRequestJob::davJobFinished(KJob *job)
Q_ASSERT(requestJob);
const Folder::List folders = requestJob->folders();
foreach (const Folder &folder, folders) {
for (const Folder &folder : folders) {
if (folder.folderId() == 1) {
// Found folder with 'Private Folders' as parent, so the owner must
// be the user that is currently logged in.
......
......@@ -204,8 +204,8 @@ void FakeServer::setAllowedDeletions(const QString &deleteIds)
{
QMutexLocker locker(&mMutex);
mAllowedDeletions.clear();
QStringList ids = deleteIds.split(QLatin1Char(','), QString::SkipEmptyParts);
foreach (const QString &id, ids) {
const QStringList ids = deleteIds.split(QLatin1Char(','), QString::SkipEmptyParts);
for (const QString &id : ids) {
mAllowedDeletions.append(id.toUtf8());
}
}
......@@ -214,8 +214,8 @@ void FakeServer::setAllowedRetrieves(const QString &retrieveIds)
{
QMutexLocker locker(&mMutex);
mAllowedRetrieves.clear();
QStringList ids = retrieveIds.split(QLatin1Char(','), QString::SkipEmptyParts);
foreach (const QString &id, ids) {
const QStringList ids = retrieveIds.split(QLatin1Char(','), QString::SkipEmptyParts);
for (const QString &id : ids) {
mAllowedRetrieves.append(id.toUtf8());
}
}
......
......@@ -181,7 +181,7 @@ QByteArray O1::buildAuthorizationHeader(const QList<O0RequestParameter> &oauthPa
QByteArray ret("OAuth ");
QList<O0RequestParameter> headers(oauthParams);
qSort(headers);
foreach (O0RequestParameter h, headers) {
foreach (const O0RequestParameter &h, headers) {
if (first) {
first = false;
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment