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
Utilities
Kate
Commits
c5fa87d9
Commit
c5fa87d9
authored
Feb 17, 2021
by
Waqar Ahmed
Committed by
Christoph Cullmann
Feb 16, 2021
Browse files
Use localized string in model
parent
0cee605a
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/project/gitstatusmodel.cpp
View file @
c5fa87d9
...
...
@@ -10,6 +10,8 @@
#include <QIcon>
#include <QMimeDatabase>
#include <KLocalizedString>
static
constexpr
int
Staged
=
0
;
static
constexpr
int
Changed
=
1
;
static
constexpr
int
Conflict
=
2
;
...
...
@@ -76,13 +78,13 @@ QVariant GitStatusModel::data(const QModelIndex &index, int role) const
if
(
index
.
internalId
()
==
Root
)
{
if
(
role
==
Qt
::
DisplayRole
)
{
if
(
row
==
Staged
)
{
return
QStringLiteral
(
"Staged (%1)"
).
arg
(
m_nodes
[
Staged
].
count
());
return
i18n
(
"Staged (%1)"
).
arg
(
m_nodes
[
Staged
].
count
());
}
else
if
(
row
==
Untrack
)
{
return
QStringLiteral
(
"Untracked (%1)"
).
arg
(
m_nodes
[
Untrack
].
count
());
return
i18n
(
"Untracked (%1)"
).
arg
(
m_nodes
[
Untrack
].
count
());
}
else
if
(
row
==
Conflict
)
{
return
QStringLiteral
(
"Conflict (%1)"
).
arg
(
m_nodes
[
Conflict
].
count
());
return
i18n
(
"Conflict (%1)"
).
arg
(
m_nodes
[
Conflict
].
count
());
}
else
if
(
row
==
Changed
)
{
return
QStringLiteral
(
"Modified (%1)"
).
arg
(
m_nodes
[
Changed
].
count
());
return
i18n
(
"Modified (%1)"
).
arg
(
m_nodes
[
Changed
].
count
());
}
else
{
Q_UNREACHABLE
();
}
...
...
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