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
78c241b0
Commit
78c241b0
authored
Feb 18, 2021
by
Waqar Ahmed
Browse files
Show untracked files in project plugin
parent
b6667059
Changes
1
Hide whitespace changes
Inline
Side-by-side
addons/project/kateprojectworker.cpp
View file @
78c241b0
...
...
@@ -435,6 +435,26 @@ QStringList KateProjectWorker::gitLsFiles(const QDir &dir)
}
}
// untracked files
{
args
.
clear
();
args
<<
QStringLiteral
(
"ls-files"
)
<<
QStringLiteral
(
"-z"
)
<<
QStringLiteral
(
"--others"
)
<<
QStringLiteral
(
"--exclude-standard"
)
<<
QStringLiteral
(
"."
);
git
.
setArguments
(
args
);
git
.
start
();
if
(
!
git
.
waitForStarted
()
||
!
git
.
waitForFinished
(
-
1
))
{
return
files
;
}
const
QList
<
QByteArray
>
byteArrayList
=
git
.
readAllStandardOutput
().
split
(
'\0'
);
for
(
const
QByteArray
&
byteArray
:
byteArrayList
)
{
const
QString
fileName
=
QString
::
fromUtf8
(
byteArray
);
if
(
!
fileName
.
isEmpty
())
{
files
<<
fileName
;
}
}
}
return
files
;
}
...
...
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