Commit 142c5edb authored by Laurent Montel's avatar Laurent Montel 😁

Start to remove Q_FOREACH macro

parent 176e7970
......@@ -41,7 +41,7 @@ BalsaAddressBook::BalsaAddressBook(const QString &filename, ImportWizard *parent
if (addressBookList.isEmpty()) {
addAddressBookImportInfo(i18n("No addressbook found"));
} else {
Q_FOREACH (const QString &addressbook, addressBookList) {
for (const QString &addressbook : addressBookList) {
KConfigGroup grp = config.group(addressbook);
readAddressBook(grp);
}
......
......@@ -45,13 +45,13 @@ BalsaSettings::BalsaSettings(const QString &filename, ImportWizard *parent)
}
const QStringList mailBoxList = config.groupList().filter(QRegularExpression("mailbox-"));
Q_FOREACH (const QString &mailBox, mailBoxList) {
for (const QString &mailBox : mailBoxList) {
KConfigGroup grp = config.group(mailBox);
readAccount(grp, autoCheck, autoCheckDelay);
}
const QStringList smtpList = config.groupList().filter(QRegularExpression("smtp-server-"));
Q_FOREACH (const QString &smtp, smtpList) {
for (const QString &smtp : smtpList) {
KConfigGroup grp = config.group(smtp);
readTransport(grp);
}
......
......@@ -69,7 +69,7 @@ void EvolutionAddressBook::exportEvolutionAddressBook()
int i = 0;
QString name;
QString displayname;
Q_FOREACH (const QString &arg, listAddressBook) {
for (const QString &arg : listAddressBook) {
switch (i) {
case 0:
name = arg;
......
......@@ -545,7 +545,7 @@ QString EvolutionSettings::getSecurityMethod(const QStringList &listArgument, bo
if (listArgument.isEmpty()) {
return QString();
}
Q_FOREACH (const QString &str, listArgument) {
for (const QString &str : listArgument) {
if (str.contains(QStringLiteral("security-method="))) {
const int index = str.indexOf(QLatin1String("security-method="));
if (index != -1) {
......
......@@ -114,12 +114,12 @@ bool IcedoveImportData::importFilters()
return true;
}
Q_FOREACH (const QString &mailPath, subDir) {
for (const QString &mailPath : subDir) {
const QString subMailPath(path + QLatin1Char('/') + mailPath);
QDir dirMail(subMailPath);
const QStringList subDirMail = dirMail.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
bool foundFilterFile = false;
Q_FOREACH (const QString &file, subDirMail) {
for (const QString &file : subDirMail) {
const QString filterFile(subMailPath + QLatin1Char('/') + file + QLatin1String("/msgFilterRules.dat"));
if (QFile(filterFile).exists()) {
foundFilterFile = true;
......
......@@ -35,7 +35,7 @@ SylpheedAddressBook::SylpheedAddressBook(const QDir &dir, ImportWizard *parent)
addAddressBookImportInfo(i18n("No addressbook found"));
}
Q_FOREACH (const QString &file, files) {
for (const QString &file : files) {
readAddressBook(dir.path() + QLatin1Char('/') + file);
}
cleanUp();
......
......@@ -30,13 +30,13 @@ ThunderBirdAddressBook::ThunderBirdAddressBook(const QDir &dir, ImportWizard *pa
{
readAddressBook(dir.path() + QLatin1String("/impab.mab"));
const QStringList filesimportab = dir.entryList(QStringList(QStringLiteral("impab-[0-9]*.map")), QDir::Files, QDir::Name);
Q_FOREACH (const QString &file, filesimportab) {
for (const QString &file : filesimportab) {
readAddressBook(dir.path() + QLatin1Char('/') + file);
}
readAddressBook(dir.path() + QLatin1String("/abook.mab"));
const QStringList files = dir.entryList(QStringList(QStringLiteral("abook-[0-9]*.map")), QDir::Files, QDir::Name);
Q_FOREACH (const QString &file, files) {
for (const QString &file : files) {
readAddressBook(dir.path() + QLatin1Char('/') + file);
}
readAddressBook(dir.path() + QLatin1String("/history.mab"));
......
......@@ -113,12 +113,12 @@ bool ThunderbirdImportData::importFilters()
return true;
}
Q_FOREACH (const QString &mailPath, subDir) {
for (const QString &mailPath : subDir) {
const QString subMailPath(path + QLatin1Char('/') + mailPath);
QDir dirMail(subMailPath);
const QStringList subDirMail = dirMail.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name);
bool foundFilterFile = false;
Q_FOREACH (const QString &file, subDirMail) {
for (const QString &file : subDirMail) {
const QString filterFile(subMailPath + QLatin1Char('/') + file + QLatin1String("/msgFilterRules.dat"));
if (QFile(filterFile).exists()) {
foundFilterFile = true;
......
......@@ -652,7 +652,7 @@ void ThunderbirdSettings::readAccount()
const QString identityConfig = QStringLiteral("mail.account.%1").arg(account) + QStringLiteral(".identities");
if (mHashConfig.contains(identityConfig)) {
const QStringList idList = mHashConfig.value(identityConfig).toString().split(QLatin1Char(','));
Q_FOREACH (const QString &id, idList) {
for (const QString &id : idList) {
readIdentity(id);
}
}
......@@ -665,14 +665,14 @@ void ThunderbirdSettings::readTransport()
if (mailSmtpServer.isEmpty()) {
return;
}
QStringList smtpList = mailSmtpServer.split(QLatin1Char(','));
const QStringList smtpList = mailSmtpServer.split(QLatin1Char(','));
QString defaultSmtp = mHashConfig.value(QStringLiteral("mail.smtp.defaultserver")).toString();
if (smtpList.count() == 1 && defaultSmtp.isEmpty()) {
//Be sure to define default smtp
defaultSmtp = smtpList.at(0);
}
Q_FOREACH (const QString &smtp, smtpList) {
for (const QString &smtp : smtpList) {
const QString smtpName = QStringLiteral("mail.smtpserver.%1").arg(smtp);
MailTransport::Transport *mt = createTransport();
const QString name = mHashConfig.value(smtpName + QStringLiteral(".description")).toString();
......
......@@ -40,7 +40,7 @@ TrojitaAddressBook::~TrojitaAddressBook()
void TrojitaAddressBook::readAddressBook()
{
const QStringList contacts = settings->childGroups();
Q_FOREACH (const QString &contact, contacts) {
for (const QString &contact : contacts) {
KContacts::Addressee contactABC;
settings->beginGroup(contact);
contactABC.setEmails(QStringList() << settings->value(QStringLiteral("email")).toStringList());
......
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