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
7896f4e4
Commit
7896f4e4
authored
Jun 26, 2019
by
Friedrich W. H. Kossebau
Browse files
custom-buildsystem: port foreach -> range-based for
parent
3e2ce73f
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugins/custom-buildsystem/custombuildsystemconfigwidget.cpp
View file @
7896f4e4
...
...
@@ -88,7 +88,8 @@ void CustomBuildSystemConfigWidget::loadFrom( KConfig* cfg )
config
.
title
=
subgrp
.
readEntry
(
ConfigConstants
::
configTitleKey
(),
QString
());
config
.
buildDir
=
subgrp
.
readEntry
(
ConfigConstants
::
buildDirKey
(),
QUrl
());
foreach
(
const
QString
&
subgrpName
,
subgrp
.
groupList
()
)
{
const
auto
subgrpNames
=
subgrp
.
groupList
();
for
(
const
QString
&
subgrpName
:
subgrpNames
)
{
if
(
subgrpName
.
startsWith
(
ConfigConstants
::
toolGroupPrefix
()))
{
KConfigGroup
toolgrp
=
subgrp
.
group
(
subgrpName
);
CustomBuildSystemTool
tool
;
...
...
@@ -112,7 +113,7 @@ void CustomBuildSystemConfigWidget::loadFrom( KConfig* cfg )
changeCurrentConfig
(
idx
);
}
void
CustomBuildSystemConfigWidget
::
saveConfig
(
KConfigGroup
&
grp
,
CustomBuildSystemConfig
&
c
,
int
index
)
void
CustomBuildSystemConfigWidget
::
saveConfig
(
KConfigGroup
&
grp
,
const
CustomBuildSystemConfig
&
c
,
int
index
)
{
// Generate group name, access and clear it
KConfigGroup
subgrp
=
grp
.
group
(
ConfigConstants
::
buildConfigPrefix
()
+
QString
::
number
(
index
));
...
...
@@ -124,7 +125,7 @@ void CustomBuildSystemConfigWidget::saveConfig( KConfigGroup& grp, CustomBuildSy
subgrp
.
writeEntry
(
ConfigConstants
::
configTitleKey
(),
c
.
title
);
subgrp
.
writeEntry
<
QUrl
>
(
ConfigConstants
::
buildDirKey
(),
c
.
buildDir
);
for
each
(
const
CustomBuildSystemTool
&
tool
,
c
.
tools
)
{
for
(
const
CustomBuildSystemTool
&
tool
:
c
.
tools
)
{
KConfigGroup
toolgrp
=
subgrp
.
group
(
generateToolGroupName
(
tool
.
type
)
);
toolgrp
.
writeEntry
(
ConfigConstants
::
toolType
(),
int
(
tool
.
type
));
toolgrp
.
writeEntry
(
ConfigConstants
::
toolEnvironment
(),
tool
.
envGrp
);
...
...
plugins/custom-buildsystem/custombuildsystemconfigwidget.h
View file @
7896f4e4
...
...
@@ -55,7 +55,7 @@ private Q_SLOTS:
void
removeConfig
();
void
verify
();
private:
void
saveConfig
(
KConfigGroup
&
grp
,
CustomBuildSystemConfig
&
c
,
int
index
);
void
saveConfig
(
KConfigGroup
&
grp
,
const
CustomBuildSystemConfig
&
c
,
int
index
);
Ui
::
CustomBuildSystemConfigWidget
*
ui
;
QVector
<
CustomBuildSystemConfig
>
configs
;
};
...
...
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