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
DrKonqi
Commits
5aa7f95b
Commit
5aa7f95b
authored
Apr 14, 2021
by
Harald Sitter
🏳️🌈
Browse files
port from qforeach to c++ range based loop
parent
f5b8a1ea
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/backtracewidget.cpp
View file @
5aa7f95b
...
...
@@ -409,7 +409,7 @@ void BacktraceWidget::extraDetailsLinkActivated(QString link)
QString
message
=
QStringLiteral
(
"<html>"
)
+
i18n
(
"The packages containing debug information for the following application and libraries are missing:"
)
+
QStringLiteral
(
"<br /><ul>"
);
Q_FOREACH
(
const
QString
&
string
,
missingDbgForFiles
)
{
for
(
const
QString
&
string
:
std
::
as_const
(
missingDbgForFiles
)
)
{
message
+=
QLatin1String
(
"<li>"
)
+
string
+
QLatin1String
(
"</li>"
);
}
...
...
src/bugzillaintegration/productmapping.cpp
View file @
5aa7f95b
...
...
@@ -96,7 +96,7 @@ void ProductMapping::getRelatedProductsUsingInternalFile(const QString &bugzilla
m_relatedBugzillaProducts
=
QStringList
()
<<
m_bugzillaProduct
;
// Get related products of each related group
Q_FOREACH
(
const
QString
&
group
,
groups
)
{
for
(
const
QString
&
group
:
std
::
as_const
(
groups
)
)
{
const
KConfigGroup
bzGroups
=
mappingsFile
.
group
(
"BZGroups"
);
if
(
bzGroups
.
hasKey
(
group
))
{
QString
bzGroup
=
bzGroups
.
readEntry
(
group
);
...
...
src/bugzillaintegration/reportassistantpages_bugzilla_duplicates.cpp
View file @
5aa7f95b
...
...
@@ -413,7 +413,7 @@ void BugzillaDuplicatesPage::analyzedDuplicates(KJob *j)
if
(
m_foundDuplicate
)
{
const
QList
<
QTreeWidgetItem
*>
items
=
ui
.
m_bugListWidget
->
findItems
(
QString
::
number
(
parentDuplicate
),
Qt
::
MatchExactly
,
0
);
const
QBrush
brush
=
KColorScheme
(
QPalette
::
Active
,
KColorScheme
::
View
).
background
(
KColorScheme
::
NeutralBackground
);
Q_FOREACH
(
QTreeWidgetItem
*
item
,
items
)
{
for
(
QTreeWidgetItem
*
item
:
std
::
as_const
(
items
)
)
{
for
(
int
i
=
0
;
i
<
item
->
columnCount
();
++
i
)
{
item
->
setBackground
(
i
,
brush
);
}
...
...
src/bugzillaintegration/reportinterface.cpp
View file @
5aa7f95b
...
...
@@ -220,7 +220,7 @@ QString ReportInterface::generateReportFullText(DrKonqiStamp stamp, Backtrace in
if
(
!
m_possibleDuplicates
.
isEmpty
())
{
report
.
append
(
QLatin1Char
(
'\n'
));
QString
duplicatesString
;
Q_FOREACH
(
const
QString
&
dupe
,
m_possibleDuplicates
)
{
for
(
const
QString
&
dupe
:
std
::
as_const
(
m_possibleDuplicates
)
)
{
duplicatesString
+=
QLatin1String
(
"bug "
)
+
dupe
+
QLatin1String
(
", "
);
}
duplicatesString
=
duplicatesString
.
left
(
duplicatesString
.
length
()
-
2
)
+
QLatin1Char
(
'.'
);
...
...
src/debuggermanager.cpp
View file @
5aa7f95b
...
...
@@ -28,7 +28,7 @@ DebuggerManager::DebuggerManager(const Debugger &internalDebugger, const QList<D
connect
(
d
->
btGenerator
,
&
BacktraceGenerator
::
someError
,
this
,
&
DebuggerManager
::
onDebuggerFinished
);
connect
(
d
->
btGenerator
,
&
BacktraceGenerator
::
failedToStart
,
this
,
&
DebuggerManager
::
onDebuggerFinished
);
for
each
(
const
Debugger
&
debugger
,
externalDebuggers
)
{
for
(
const
Debugger
&
debugger
:
std
::
as_const
(
externalDebuggers
)
)
{
if
(
debugger
.
isInstalled
())
{
// TODO: use TerminalDebuggerLauncher instead
addDebugger
(
new
DefaultDebuggerLauncher
(
debugger
,
this
));
...
...
src/drkonqibackends.cpp
View file @
5aa7f95b
...
...
@@ -178,7 +178,7 @@ DebuggerManager *KCrashBackend::constructDebuggerManager()
#endif
Debugger
firstKnownGoodDebugger
,
preferredDebugger
;
for
each
(
const
Debugger
&
debugger
,
internalDebuggers
)
{
for
(
const
Debugger
&
debugger
:
std
::
as_const
(
internalDebuggers
)
)
{
qCDebug
(
DRKONQI_LOG
)
<<
"Check debugger if"
<<
debugger
.
displayName
()
<<
"["
<<
debugger
.
codeName
()
<<
"]"
<<
"is installed:"
<<
debugger
.
isInstalled
();
if
(
!
firstKnownGoodDebugger
.
isValid
()
&&
debugger
.
isInstalled
())
{
...
...
src/drkonqidialog.cpp
View file @
5aa7f95b
...
...
@@ -192,7 +192,7 @@ void DrKonqiDialog::buildDialogButtons()
// Only add the debugger if requested by the config or if a KDevelop session is running.
const
bool
showExternal
=
debuggerManager
->
showExternalDebuggers
();
QList
<
AbstractDebuggerLauncher
*>
debuggers
=
debuggerManager
->
availableExternalDebuggers
();
for
each
(
AbstractDebuggerLauncher
*
launcher
,
debuggers
)
{
for
(
AbstractDebuggerLauncher
*
launcher
:
std
::
as_const
(
debuggers
)
)
{
if
(
showExternal
||
qobject_cast
<
DBusInterfaceLauncher
*>
(
launcher
))
{
addDebugger
(
launcher
);
}
...
...
src/tests/backtraceparsertest/backtraceparsertest.cpp
View file @
5aa7f95b
...
...
@@ -25,10 +25,10 @@ void BacktraceParserTest::fetchData(const QString &group)
QTest
::
addColumn
<
bool
>
(
"compositorCrash"
);
m_settings
.
beginGroup
(
group
);
QStringList
keys
=
m_settings
.
allKeys
();
const
QStringList
keys
=
m_settings
.
allKeys
();
m_settings
.
endGroup
();
for
each
(
const
QString
&
key
,
keys
)
{
for
(
const
QString
&
key
:
keys
)
{
QTest
::
newRow
(
qPrintable
(
key
))
<<
QString
(
DATA_DIR
+
QLatin1Char
(
'/'
)
+
key
)
<<
m_settings
.
value
(
group
+
QLatin1Char
(
'/'
)
+
key
).
toString
()
<<
m_settings
.
value
(
QStringLiteral
(
"debugger/"
)
+
key
).
toString
()
<<
m_settings
.
value
(
QStringLiteral
(
"compositorCrash/"
)
+
key
).
toBool
();
...
...
@@ -87,8 +87,8 @@ void BacktraceParserTest::btParserBenchmark_data()
QTest
::
addColumn
<
QString
>
(
"debugger"
);
m_settings
.
beginGroup
(
QStringLiteral
(
"debugger"
));
QStringList
keys
=
m_settings
.
allKeys
();
for
each
(
const
QString
&
key
,
keys
)
{
const
QStringList
keys
=
m_settings
.
allKeys
();
for
(
const
QString
&
key
:
keys
)
{
QTest
::
newRow
(
qPrintable
(
key
))
<<
QString
(
DATA_DIR
+
QLatin1Char
(
'/'
)
+
key
)
<<
m_settings
.
value
(
key
).
toString
();
}
m_settings
.
endGroup
();
...
...
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