Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9e15ba69 authored by Jan Grulich's avatar Jan Grulich

Get rid of Q_FOREACH

parent 7835604c
......@@ -47,7 +47,7 @@ uint EmailPortal::ComposeEmail(const QDBusObjectPath &handle, const QString &app
QString attachmentString;
const QStringList attachments = options.value(QLatin1String("attachments")).toStringList();
Q_FOREACH (const QString &attachment, attachments) {
for (const QString &attachment : attachments) {
attachmentString += QStringLiteral("&attachment=%1").arg(attachment);
}
......
......@@ -136,9 +136,9 @@ uint FileChooserPortal::OpenFile(const QDBusObjectPath &handle,
if (options.contains(QLatin1String("filters"))) {
FilterListList filterListList = qdbus_cast<FilterListList>(options.value(QLatin1String("filters")));
Q_FOREACH (const FilterList &filterList, filterListList) {
for (const FilterList &filterList : filterListList) {
QStringList filterStrings;
Q_FOREACH (const Filter &filterStruct, filterList.filters) {
for (const Filter &filterStruct : filterList.filters) {
if (filterStruct.type == 0) {
filterStrings << filterStruct.filterString;
} else {
......@@ -168,7 +168,7 @@ uint FileChooserPortal::OpenFile(const QDBusObjectPath &handle,
if (fileDialog->exec() == QDialog::Accepted) {
QStringList files;
Q_FOREACH (const QString &filename, fileDialog->selectedFiles()) {
for (const QString &filename : fileDialog->selectedFiles()) {
QUrl url = QUrl::fromLocalFile(filename);
files << url.toDisplayString();
}
......@@ -228,9 +228,9 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle,
if (options.contains(QLatin1String("filters"))) {
FilterListList filterListList = qdbus_cast<FilterListList>(options.value(QLatin1String("filters")));
Q_FOREACH (const FilterList &filterList, filterListList) {
for (const FilterList &filterList : filterListList) {
QStringList filterStrings;
Q_FOREACH (const Filter &filterStruct, filterList.filters) {
for (const Filter &filterStruct : filterList.filters) {
if (filterStruct.type == 0) {
filterStrings << filterStruct.filterString;
} else {
......@@ -276,7 +276,7 @@ uint FileChooserPortal::SaveFile(const QDBusObjectPath &handle,
if (fileDialog->exec() == QDialog::Accepted) {
QStringList files;
Q_FOREACH (const QString &filename, fileDialog->selectedFiles()) {
for (const QString &filename : fileDialog->selectedFiles()) {
QUrl url = QUrl::fromLocalFile(filename);
files << url.toDisplayString();
}
......
......@@ -73,7 +73,7 @@ void NotificationPortal::AddNotification(const QString &app_id,
}
QStringList actions;
Q_FOREACH (const QVariantMap &button, buttons) {
for (const QVariantMap &button : buttons) {
actions << button.value(QLatin1String("label")).toString();
}
......
......@@ -54,7 +54,7 @@ RemoteDesktopDialog::RemoteDesktopDialog(const QString &appName, RemoteDesktopPo
QString applicationName;
const QString desktopFile = appName + QLatin1String(".desktop");
const QStringList desktopFileLocations = QStandardPaths::locateAll(QStandardPaths::ApplicationsLocation, desktopFile, QStandardPaths::LocateFile);
foreach (const QString &location, desktopFileLocations) {
for (const QString &location : desktopFileLocations) {
QSettings settings(location, QSettings::IniFormat);
settings.beginGroup(QLatin1String("Desktop Entry"));
if (settings.contains(QLatin1String("X-GNOME-FullName"))) {
......
......@@ -54,7 +54,7 @@ QList<quint32> ScreenCastWidget::selectedScreens() const
{
QList<quint32> selectedScreens;
foreach (QListWidgetItem *item, selectedItems()) {
for (QListWidgetItem *item : selectedItems()) {
selectedScreens << item->data(Qt::UserRole).toUInt();
}
......
......@@ -45,7 +45,7 @@ ScreenChooserDialog::ScreenChooserDialog(const QString &appName, bool multiple,
QString applicationName;
const QString desktopFile = appName + QLatin1String(".desktop");
const QStringList desktopFileLocations = QStandardPaths::locateAll(QStandardPaths::ApplicationsLocation, desktopFile, QStandardPaths::LocateFile);
foreach (const QString &location, desktopFileLocations) {
for (const QString &location : desktopFileLocations) {
QSettings settings(location, QSettings::IniFormat);
settings.beginGroup(QLatin1String("Desktop Entry"));
if (settings.contains(QLatin1String("X-GNOME-FullName"))) {
......
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