Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KDE Portal for XDG Desktop
Commits
9e15ba69
Commit
9e15ba69
authored
Nov 27, 2018
by
Jan Grulich
Browse files
Get rid of Q_FOREACH
parent
7835604c
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/email.cpp
View file @
9e15ba69
...
...
@@ -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
);
}
...
...
src/filechooser.cpp
View file @
9e15ba69
...
...
@@ -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
();
}
...
...
src/notification.cpp
View file @
9e15ba69
...
...
@@ -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
();
}
...
...
src/remotedesktopdialog.cpp
View file @
9e15ba69
...
...
@@ -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
);
for
each
(
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"
)))
{
...
...
src/screencastwidget.cpp
View file @
9e15ba69
...
...
@@ -54,7 +54,7 @@ QList<quint32> ScreenCastWidget::selectedScreens() const
{
QList
<
quint32
>
selectedScreens
;
for
each
(
QListWidgetItem
*
item
,
selectedItems
())
{
for
(
QListWidgetItem
*
item
:
selectedItems
())
{
selectedScreens
<<
item
->
data
(
Qt
::
UserRole
).
toUInt
();
}
...
...
src/screenchooserdialog.cpp
View file @
9e15ba69
...
...
@@ -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
);
for
each
(
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"
)))
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment