Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
kdevelop
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Schöps
kdevelop
Commits
dd4f0394
Commit
dd4f0394
authored
Aug 18, 2019
by
Friedrich W. H. Kossebau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use std::array over QVector/QList for static const arrays
parent
6e893f6c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
kdevplatform/project/projectchangesmodel.cpp
kdevplatform/project/projectchangesmodel.cpp
+2
-2
plugins/cmake/cmakecommandscontents.cpp
plugins/cmake/cmakecommandscontents.cpp
+15
-4
plugins/git/gitplugin.cpp
plugins/git/gitplugin.cpp
+2
-2
No files found.
kdevplatform/project/projectchangesmodel.cpp
View file @
dd4f0394
...
...
@@ -247,7 +247,7 @@ void ProjectChangesModel::reloadAll()
void
ProjectChangesModel
::
jobUnregistered
(
KJob
*
job
)
{
static
const
QList
<
VcsJob
::
JobType
>
readOnly
=
QList
<
VcsJob
::
JobType
>
{
static
const
std
::
array
<
VcsJob
::
JobType
,
7
>
readOnly
=
{
KDevelop
::
VcsJob
::
Add
,
KDevelop
::
VcsJob
::
Remove
,
KDevelop
::
VcsJob
::
Pull
,
...
...
@@ -258,7 +258,7 @@ void ProjectChangesModel::jobUnregistered(KJob* job)
};
auto
*
vcsjob
=
qobject_cast
<
VcsJob
*>
(
job
);
if
(
vcsjob
&&
readOnly
.
contains
(
vcsjob
->
type
()
))
{
if
(
vcsjob
&&
std
::
find
(
readOnly
.
begin
(),
readOnly
.
end
(),
vcsjob
->
type
())
!=
readOnly
.
end
(
))
{
reloadAll
();
}
}
...
...
plugins/cmake/cmakecommandscontents.cpp
View file @
dd4f0394
...
...
@@ -29,11 +29,22 @@
#include <QProcess>
#include <KLocalizedString>
static
const
QVector
<
QString
>
args
=
{
QLatin1String
(
"--help-command"
),
QLatin1String
(
"--help-variable"
),
QLatin1String
(
"--help-module"
),
QLatin1String
(
"--help-property"
),
QLatin1String
(
"--help-policy"
),
QString
()
#include <array>
static
const
std
::
array
<
QString
,
6
>
args
=
{
QStringLiteral
(
"--help-command"
),
QStringLiteral
(
"--help-variable"
),
QStringLiteral
(
"--help-module"
),
QStringLiteral
(
"--help-property"
),
QStringLiteral
(
"--help-policy"
),
QString
(),
};
static
QString
modules
[]
=
{
i18n
(
"Commands"
),
i18n
(
"Variables"
),
i18n
(
"Modules"
),
i18n
(
"Properties"
),
i18n
(
"Policies"
)
static
const
std
::
array
<
QString
,
5
>
modules
=
{
i18n
(
"Commands"
),
i18n
(
"Variables"
),
i18n
(
"Modules"
),
i18n
(
"Properties"
),
i18n
(
"Policies"
),
};
CMakeCommandsContents
::
CMakeCommandsContents
(
QObject
*
parent
)
...
...
plugins/git/gitplugin.cpp
View file @
dd4f0394
...
...
@@ -1271,8 +1271,8 @@ void GitPlugin::parseGitVersionOutput(DVcsJob* job)
{
const
auto
output
=
job
->
output
().
trimmed
();
auto
versionString
=
output
.
midRef
(
output
.
lastIndexOf
(
QLatin1Char
(
' '
))).
split
(
QLatin1Char
(
'.'
));
static
const
QList
<
int
>
minimumVersion
=
QList
<
int
>
{
1
,
7
};
qCDebug
(
PLUGIN_GIT
)
<<
"checking git version"
<<
versionString
<<
"against"
<<
minimumVersion
;
static
const
std
::
array
<
int
,
2
>
minimumVersion
=
{
1
,
7
};
qCDebug
(
PLUGIN_GIT
)
<<
"checking git version"
<<
versionString
<<
"against"
<<
minimumVersion
[
0
]
<<
minimumVersion
[
1
]
;
m_oldVersion
=
false
;
if
(
versionString
.
size
()
<
minimumVersion
.
size
())
{
m_oldVersion
=
true
;
...
...
Write
Preview
Markdown
is supported
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