Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KDE CLI tools
Commits
0ced9a3c
Commit
0ced9a3c
authored
May 13, 2021
by
Laurent Montel
😁
Browse files
Port foreach to for(...:..)
parent
f7c595ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
kdesu/kdesu.cpp
View file @
0ced9a3c
...
...
@@ -267,7 +267,8 @@ static int startApp(QCommandLineParser &p)
p
.
showHelp
(
1
);
}
}
foreach
(
const
QString
&
arg
,
p
.
positionalArguments
())
{
const
auto
positionalArguments
=
p
.
positionalArguments
();
for
(
const
QString
&
arg
:
positionalArguments
)
{
command
+=
' '
;
command
+=
QFile
::
encodeName
(
KShell
::
quoteArg
(
arg
));
}
...
...
keditfiletype/mimetypedata.cpp
View file @
0ced9a3c
...
...
@@ -406,7 +406,8 @@ void MimeTypeData::syncServices()
// Clean out any kde-mimeapps.list which would take precedence any cancel our changes.
const
QString
desktops
=
QString
::
fromLocal8Bit
(
qgetenv
(
"XDG_CURRENT_DESKTOP"
));
foreach
(
const
QString
&
desktop
,
desktops
.
split
(
QLatin1Char
(
':'
),
Qt
::
SkipEmptyParts
))
{
const
auto
desktopsSplit
=
desktops
.
split
(
QLatin1Char
(
':'
),
Qt
::
SkipEmptyParts
);
for
(
const
QString
&
desktop
:
desktopsSplit
)
{
const
QString
file
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericConfigLocation
)
+
QLatin1Char
(
'/'
)
+
desktop
.
toLower
()
+
QLatin1String
(
"-mimeapps.list"
);
if
(
QFileInfo
::
exists
(
file
))
{
...
...
keditfiletype/mimetypewriter.cpp
View file @
0ced9a3c
...
...
@@ -98,7 +98,7 @@ bool MimeTypeWriter::write()
writer
.
writeStartElement
(
nsUri
,
QStringLiteral
(
"glob-deleteall"
));
writer
.
writeEndElement
();
// glob-deleteall
for
each
(
const
QString
&
pattern
,
d
->
m_patterns
)
{
for
(
const
QString
&
pattern
:
qAsConst
(
d
->
m_patterns
)
)
{
writer
.
writeStartElement
(
nsUri
,
QStringLiteral
(
"glob"
));
writer
.
writeAttribute
(
QStringLiteral
(
"pattern"
),
pattern
);
writer
.
writeEndElement
();
// glob
...
...
kioclient/kioclient.cpp
View file @
0ced9a3c
...
...
@@ -41,7 +41,7 @@ static QUrl makeURL(const QString &urlArg)
static
QList
<
QUrl
>
makeUrls
(
const
QStringList
&
urlArgs
)
{
QList
<
QUrl
>
ret
;
for
each
(
const
QString
&
url
,
urlArgs
)
{
for
(
const
QString
&
url
:
urlArgs
)
{
ret
+=
makeURL
(
url
);
}
return
ret
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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