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
Thomas Schöps
kdevelop
Commits
16d54aa7
Commit
16d54aa7
authored
Jun 27, 2019
by
Friedrich W. H. Kossebau
Browse files
custom-definesandincludes: port foreach -> range-based for
parent
123b2024
Changes
4
Hide whitespace changes
Inline
Side-by-side
plugins/custom-definesandincludes/compilerprovider/gcclikecompiler.cpp
View file @
16d54aa7
...
...
@@ -188,7 +188,8 @@ Path::List GccLikeCompiler::includes(Utils::LanguageType type, const QString& ar
Status
mode
=
Initial
;
const
auto
output
=
QString
::
fromLocal8Bit
(
proc
.
readAllStandardOutput
()
);
foreach
(
const
auto
&
line
,
output
.
splitRef
(
QLatin1Char
(
'\n'
)))
{
const
auto
lines
=
output
.
splitRef
(
QLatin1Char
(
'\n'
));
for
(
const
auto
&
line
:
lines
)
{
switch
(
mode
)
{
case
Initial
:
if
(
line
.
indexOf
(
QLatin1String
(
"#include
\"
...
\"
"
)
)
!=
-
1
)
{
...
...
plugins/custom-definesandincludes/compilerprovider/settingsmanager.cpp
View file @
16d54aa7
...
...
@@ -272,7 +272,8 @@ QVector<ConfigEntry> convertedPaths( KConfig* cfg )
return
{};
QVector
<
ConfigEntry
>
paths
;
foreach
(
const
QString
&
grpName
,
sorted
(
group
.
groupList
())
)
{
const
auto
sortedGroupNames
=
sorted
(
group
.
groupList
());
for
(
const
QString
&
grpName
:
sortedGroupNames
)
{
KConfigGroup
subgroup
=
group
.
group
(
grpName
);
if
(
!
subgroup
.
isValid
()
)
continue
;
...
...
plugins/custom-definesandincludes/compilerprovider/widget/compilerswidget.cpp
View file @
16d54aa7
...
...
@@ -52,7 +52,8 @@ CompilersWidget::CompilersWidget(QWidget* parent)
auto
settings
=
SettingsManager
::
globalInstance
();
auto
provider
=
settings
->
provider
();
foreach
(
const
auto
&
factory
,
provider
->
compilerFactories
())
{
const
auto
compilerFactories
=
provider
->
compilerFactories
();
for
(
const
auto
&
factory
:
compilerFactories
)
{
auto
*
action
=
new
QAction
(
m_addMenu
);
const
QString
fname
=
factory
->
name
();
action
->
setText
(
fname
);
...
...
@@ -99,7 +100,8 @@ void CompilersWidget::deleteCompiler()
{
qCDebug
(
DEFINESANDINCLUDES
)
<<
"Deleting compiler"
;
auto
selectionModel
=
m_ui
->
compilers
->
selectionModel
();
foreach
(
const
QModelIndex
&
row
,
selectionModel
->
selectedIndexes
())
{
const
auto
selectedRowsBefore
=
selectionModel
->
selectedIndexes
();
for
(
const
QModelIndex
&
row
:
selectedRowsBefore
)
{
if
(
row
.
column
()
==
1
)
{
//Don't remove the same compiler twice
continue
;
...
...
@@ -118,7 +120,8 @@ void CompilersWidget::addCompiler(const QString& factoryName)
{
auto
settings
=
SettingsManager
::
globalInstance
();
auto
provider
=
settings
->
provider
();
foreach
(
const
auto
&
factory
,
provider
->
compilerFactories
())
{
const
auto
compilerFactories
=
provider
->
compilerFactories
();
for
(
const
auto
&
factory
:
compilerFactories
)
{
if
(
factoryName
==
factory
->
name
())
{
//add compiler without any information, the user will fill the data in later
auto
compilerIndex
=
m_compilersModel
->
addCompiler
(
factory
->
createCompiler
(
QString
(),
QString
()));
...
...
plugins/custom-definesandincludes/kcm_widget/projectpathsmodel.cpp
View file @
16d54aa7
...
...
@@ -84,7 +84,7 @@ bool ProjectPathsModel::setData( const QModelIndex& index, const QVariant& value
QString
addedPath
=
sanitizePath
(
value
.
toString
(),
false
);
// Do not allow duplicates
for
each
(
const
ConfigEntry
&
existingConfig
,
projectPaths
)
{
for
(
const
ConfigEntry
&
existingConfig
:
qAsConst
(
projectPaths
)
)
{
if
(
addedPath
==
existingConfig
.
path
)
{
return
false
;
}
...
...
@@ -191,7 +191,7 @@ void ProjectPathsModel::addPathInternal( const ConfigEntry& config, bool prepend
Q_ASSERT
(
!
config
.
parserArguments
.
isAnyEmpty
());
// Do not allow duplicates
for
each
(
const
ConfigEntry
&
existingConfig
,
projectPaths
)
{
for
(
const
ConfigEntry
&
existingConfig
:
qAsConst
(
projectPaths
)
)
{
if
(
config
.
path
==
existingConfig
.
path
)
{
return
;
}
...
...
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