Start to port Q_FOREACH to for(... : ...)

wilder-work
Montel Laurent 9 years ago
parent d569741156
commit ac2bcfef36
  1. 2
      agents/followupreminderagent/followupreminderinfowidget.cpp
  2. 2
      agents/sendlateragent/sendlateragent.cpp
  3. 2
      agents/sendlateragent/sendlaterconfigurewidget.cpp
  4. 4
      src/editor/attachment/attachmentview.cpp
  5. 2
      src/editor/plugininterface/kmailplugineditorcheckbeforesendmanagerinterface.cpp
  6. 2
      src/editor/potentialphishingemail/potentialphishingdetailwidget.cpp
  7. 2
      src/folderarchive/folderarchivemanager.cpp
  8. 2
      src/identity/xfaceconfigurator.cpp
  9. 4
      src/job/removeduplicatemailjob.cpp
  10. 2
      src/kmreaderwin.cpp
  11. 2
      src/searchdialog/searchwindow.cpp
  12. 2
      src/widgets/kactionmenuaccount.cpp
  13. 2
      src/widgets/kactionmenutransport.cpp

@ -227,7 +227,7 @@ void FollowUpReminderInfoWidget::removeItem(const QList<QTreeWidgetItem *> &mail
qCDebug(FOLLOWUPREMINDERAGENT_LOG) << "Not item selected"; qCDebug(FOLLOWUPREMINDERAGENT_LOG) << "Not item selected";
} else { } else {
if (KMessageBox::Yes == KMessageBox::warningYesNo(this, i18n("Do you want to remove selected item?"))) { if (KMessageBox::Yes == KMessageBox::warningYesNo(this, i18n("Do you want to remove selected item?"))) {
Q_FOREACH (QTreeWidgetItem *item, mailItemLst) { for (QTreeWidgetItem *item : mailItemLst) {
FollowUpReminderInfoItem *mailItem = static_cast<FollowUpReminderInfoItem *>(item); FollowUpReminderInfoItem *mailItem = static_cast<FollowUpReminderInfoItem *>(item);
mListRemoveId << mailItem->info()->uniqueIdentifier(); mListRemoveId << mailItem->info()->uniqueIdentifier();
delete mailItem; delete mailItem;

@ -166,7 +166,7 @@ void SendLaterAgent::showConfigureDialog(qlonglong windowId)
void SendLaterAgent::itemsRemoved(const Akonadi::Item::List &items) void SendLaterAgent::itemsRemoved(const Akonadi::Item::List &items)
{ {
Q_FOREACH (const Akonadi::Item &item, items) { for (const Akonadi::Item &item : items) {
mManager->itemRemoved(item.id()); mManager->itemRemoved(item.id());
} }
} }

@ -225,7 +225,7 @@ void SendLaterWidget::slotRemoveItem()
removeMessage = true; removeMessage = true;
} }
Q_FOREACH (QTreeWidgetItem *item, listItems) { for (QTreeWidgetItem *item : listItems) {
if (removeMessage) { if (removeMessage) {
SendLaterItem *mailItem = static_cast<SendLaterItem *>(item); SendLaterItem *mailItem = static_cast<SendLaterItem *>(item);
if (mailItem->info()) { if (mailItem->info()) {

@ -185,9 +185,9 @@ void AttachmentView::hideIfEmpty()
void AttachmentView::updateAttachmentLabel() void AttachmentView::updateAttachmentLabel()
{ {
MessageCore::AttachmentPart::List list = d->model->attachments(); const MessageCore::AttachmentPart::List list = d->model->attachments();
qint64 size = 0; qint64 size = 0;
Q_FOREACH (const MessageCore::AttachmentPart::Ptr &part, list) { for (const MessageCore::AttachmentPart::Ptr &part : list) {
size += part->size(); size += part->size();
} }
d->infoAttachment->setText(i18np("1 attachment (%2)", "%1 attachments (%2)", model()->rowCount(), KFormat().formatByteSize(qMax(0LL, size)))); d->infoAttachment->setText(i18np("1 attachment (%2)", "%1 attachments (%2)", model()->rowCount(), KFormat().formatByteSize(qMax(0LL, size))));

@ -52,7 +52,7 @@ void KMailPluginEditorCheckBeforeSendManagerInterface::initializePlugins()
return; return;
} }
const QVector<MessageComposer::PluginEditorCheckBeforeSend *> lstPlugin = MessageComposer::PluginEditorCheckBeforeSendManager::self()->pluginsList(); const QVector<MessageComposer::PluginEditorCheckBeforeSend *> lstPlugin = MessageComposer::PluginEditorCheckBeforeSendManager::self()->pluginsList();
Q_FOREACH (MessageComposer::PluginEditorCheckBeforeSend *plugin, lstPlugin) { for (MessageComposer::PluginEditorCheckBeforeSend *plugin : lstPlugin) {
if (plugin->isEnabled()) { if (plugin->isEnabled()) {
MessageComposer::PluginEditorCheckBeforeSendInterface *interface = plugin->createInterface(this); MessageComposer::PluginEditorCheckBeforeSendInterface *interface = plugin->createInterface(this);
interface->setParentWidget(mParentWidget); interface->setParentWidget(mParentWidget);

@ -49,7 +49,7 @@ void PotentialPhishingDetailWidget::fillList(const QStringList &lst)
{ {
mListWidget->clear(); mListWidget->clear();
QStringList emailsAdded; QStringList emailsAdded;
Q_FOREACH (const QString &mail, lst) { for (const QString &mail : lst) {
if (!emailsAdded.contains(mail)) { if (!emailsAdded.contains(mail)) {
QListWidgetItem *item = new QListWidgetItem(mListWidget); QListWidgetItem *item = new QListWidgetItem(mListWidget);
item->setCheckState(Qt::Unchecked); item->setCheckState(Qt::Unchecked);

@ -165,7 +165,7 @@ void FolderArchiveManager::load()
KConfig config(FolderArchive::FolderArchiveUtil::configFileName()); KConfig config(FolderArchive::FolderArchiveUtil::configFileName());
const QStringList accountList = config.groupList().filter(QRegularExpression(FolderArchive::FolderArchiveUtil::groupConfigPattern())); const QStringList accountList = config.groupList().filter(QRegularExpression(FolderArchive::FolderArchiveUtil::groupConfigPattern()));
Q_FOREACH (const QString &account, accountList) { for (const QString &account : accountList) {
KConfigGroup group = config.group(account); KConfigGroup group = config.group(account);
FolderArchiveAccountInfo *info = new FolderArchiveAccountInfo(group); FolderArchiveAccountInfo *info = new FolderArchiveAccountInfo(group);
if (info->enabled()) { if (info->enabled()) {

@ -220,7 +220,7 @@ void XFaceConfigurator::slotSelectFile()
{ {
const QList<QByteArray> mimeTypes = QImageReader::supportedImageFormats(); const QList<QByteArray> mimeTypes = QImageReader::supportedImageFormats();
QString filter; QString filter;
Q_FOREACH (const QByteArray &mime, mimeTypes) { for (const QByteArray &mime : mimeTypes) {
filter += QString::fromLatin1(mime); filter += QString::fromLatin1(mime);
} }
const QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), i18n("Image (%1)", filter)); const QUrl url = QFileDialog::getOpenFileUrl(this, QString(), QUrl(), i18n("Image (%1)", filter));

@ -50,10 +50,10 @@ void RemoveDuplicateMailJob::start()
item->setUsesBusyIndicator(true); item->setUsesBusyIndicator(true);
item->setCryptoStatus(KPIM::ProgressItem::Unknown); item->setCryptoStatus(KPIM::ProgressItem::Unknown);
QModelIndexList indexes = mSelectionModel->selectedIndexes(); const QModelIndexList indexes = mSelectionModel->selectedIndexes();
Akonadi::Collection::List collections; Akonadi::Collection::List collections;
Q_FOREACH (const QModelIndex &index, indexes) { for (const QModelIndex &index : indexes) {
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()) { if (collection.isValid()) {
collections << collection; collections << collection;

@ -805,7 +805,7 @@ void KMReaderWin::updateHtmlActions()
mViewAsHtml->setChecked(false); mViewAsHtml->setChecked(false);
} else { } else {
const QStringList customs = mSearchedAddress.customs(); const QStringList customs = mSearchedAddress.customs();
Q_FOREACH (const QString &custom, customs) { for (const QString &custom : customs) {
if (custom.contains(QStringLiteral("MailPreferedFormatting"))) { if (custom.contains(QStringLiteral("MailPreferedFormatting"))) {
const QString value = mSearchedAddress.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("MailPreferedFormatting")); const QString value = mSearchedAddress.custom(QStringLiteral("KADDRESSBOOK"), QStringLiteral("MailPreferedFormatting"));
mViewAsHtml->setChecked(value == QLatin1String("HTML")); mViewAsHtml->setChecked(value == QLatin1String("HTML"));

@ -347,7 +347,7 @@ void SearchWindow::activateFolder(const Akonadi::Collection &collection)
if (!lst.isEmpty()) { if (!lst.isEmpty()) {
mUi.mChkMultiFolders->setChecked(true); mUi.mChkMultiFolders->setChecked(true);
mCollectionId.clear(); mCollectionId.clear();
Q_FOREACH (Akonadi::Collection::Id col, lst) { for (Akonadi::Collection::Id col : lst) {
mCollectionId.append(Akonadi::Collection(col)); mCollectionId.append(Akonadi::Collection(col));
} }
} else { } else {

@ -94,7 +94,7 @@ void KActionMenuAccount::updateAccountMenu()
QVector<AgentIdentifier> agentIdentifierList; QVector<AgentIdentifier> agentIdentifierList;
agentIdentifierList.reserve(lst.count()); agentIdentifierList.reserve(lst.count());
Q_FOREACH (const Akonadi::AgentInstance &type, lst) { for (const Akonadi::AgentInstance &type : lst) {
// Explicitly make a copy, as we're not changing values of the list but only // Explicitly make a copy, as we're not changing values of the list but only
// the local copy which is passed to action. // the local copy which is passed to action.
const QString identifierName = type.identifier(); const QString identifierName = type.identifier();

@ -51,7 +51,7 @@ void KActionMenuTransport::updateTransportMenu()
const QList<MailTransport::Transport *> transports = MailTransport::TransportManager::self()->transports(); const QList<MailTransport::Transport *> transports = MailTransport::TransportManager::self()->transports();
QMap<QString, int> menuTransportLst; QMap<QString, int> menuTransportLst;
Q_FOREACH (MailTransport::Transport *transport, transports) { for (MailTransport::Transport *transport : transports) {
const QString name = transport->name().replace(QLatin1Char('&'), QStringLiteral("&&")); const QString name = transport->name().replace(QLatin1Char('&'), QStringLiteral("&&"));
menuTransportLst.insert(name, transport->id()); menuTransportLst.insert(name, transport->id());
} }

Loading…
Cancel
Save