Commit 2e727018 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Change Q_FOREACH to correct for usage

parent 0ff43612
......@@ -202,7 +202,7 @@ void ColorSchemeEditor::selectWallpaper()
// Get supported image formats and convert to QString for getOpenFileName()
const QList<QByteArray> mimeTypes = QImageReader::supportedImageFormats();
QString fileFormats = QStringLiteral("(");
Q_FOREACH (const QByteArray &mime, mimeTypes) {
for (const QByteArray &mime : mimeTypes) {
fileFormats += QStringLiteral("*.%1 ").arg(QLatin1String(mime));
}
fileFormats += QLatin1String(")");
......
......@@ -141,9 +141,9 @@ QStringList ColorSchemeManager::listColorSchemes()
QStandardPaths::LocateDirectory);
colorschemes.reserve(dirs.size());
Q_FOREACH (const QString &dir, dirs) {
for (const QString &dir : dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.colorscheme"));
Q_FOREACH (const QString &file, fileNames) {
for (const QString &file : fileNames) {
colorschemes.append(dir + QLatin1Char('/') + file);
}
}
......
......@@ -102,9 +102,9 @@ void KeyboardTranslatorManager::findTranslators()
QStandardPaths::LocateDirectory);
list.reserve(dirs.size());
Q_FOREACH (const QString &dir, dirs) {
for (const QString &dir : dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.keytab"));
Q_FOREACH (const QString &file, fileNames) {
for (const QString &file : fileNames) {
list.append(dir + QLatin1Char('/') + file);
}
}
......
......@@ -456,7 +456,7 @@ void MainWindow::openUrls(const QList<QUrl> &urls)
{
Profile::Ptr defaultProfile = ProfileManager::instance()->defaultProfile();
Q_FOREACH (const auto &url, urls) {
for (const auto &url : urls) {
if (url.isLocalFile()) {
createSession(_viewManager->activeContainer(), defaultProfile, url.path());
} else if (url.scheme() == QLatin1String("ssh")) {
......
......@@ -50,9 +50,9 @@ QStringList ProfileReader::findProfiles()
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("konsole"), QStandardPaths::LocateDirectory);
profiles.reserve(dirs.size());
Q_FOREACH (const QString& dir, dirs) {
for (const QString& dir : dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.profile"));
Q_FOREACH (const QString& file, fileNames) {
for (const QString& file : fileNames) {
profiles.append(dir + QLatin1Char('/') + file);
}
}
......
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