aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Grulich <[email protected]>2018-11-27 09:44:53 +0100
committerJan Grulich <[email protected]>2018-11-27 09:44:53 +0100
commit9e15ba699597140287396a4b0628ef3f95a2475f (patch)
treef5bb81ae5a5678cc376e6b21ba1b4a927e47ab95
parent7835604c8053eaf6b6537dc89461a73d23d1f988 (diff)
Get rid of Q_FOREACH
-rw-r--r--src/email.cpp2
-rw-r--r--src/filechooser.cpp12
-rw-r--r--src/notification.cpp2
-rw-r--r--src/remotedesktopdialog.cpp2
-rw-r--r--src/screencastwidget.cpp2
-rw-r--r--src/screenchooserdialog.cpp2
6 files changed, 11 insertions, 11 deletions
diff --git a/src/email.cpp b/src/email.cpp
index e597b4a..9493a2c 100644
--- a/src/email.cpp
+++ b/src/email.cpp
@@ -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);
}
diff --git a/src/filechooser.cpp b/src/filechooser.cpp
index a2167ea..37e7744 100644
--- a/src/filechooser.cpp
+++ b/src/filechooser.cpp
@@ -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();
}
diff --git a/src/notification.cpp b/src/notification.cpp
index 08c88fb..b9baf4a 100644
--- a/src/notification.cpp
+++ b/src/notification.cpp
@@ -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();
}
diff --git a/src/remotedesktopdialog.cpp b/src/remotedesktopdialog.cpp
index 63f51db..9c00c1b 100644
--- a/src/remotedesktopdialog.cpp
+++ b/src/remotedesktopdialog.cpp
@@ -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"))) {
diff --git a/src/screencastwidget.cpp b/src/screencastwidget.cpp
index 2dd121a..4bbe8c3 100644
--- a/src/screencastwidget.cpp
+++ b/src/screencastwidget.cpp
@@ -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();
}
diff --git a/src/screenchooserdialog.cpp b/src/screenchooserdialog.cpp
index 09d2f23..625deff 100644
--- a/src/screenchooserdialog.cpp
+++ b/src/screenchooserdialog.cpp
@@ -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"))) {