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
Nate Graham
Kid3
Commits
96b710af
Commit
96b710af
authored
Apr 29, 2012
by
Urs Fleisch
Browse files
Check if user command file list is empty.
parent
36f1e341
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/core/model/commandformatreplacer.cpp
View file @
96b710af
...
...
@@ -90,16 +90,20 @@ QString CommandFormatReplacer::getReplacement(const QString& code) const
if
(
!
name
.
isNull
())
{
if
(
name
==
"file"
)
{
result
=
m_files
.
front
();
if
(
!
m_files
.
isEmpty
())
{
result
=
m_files
.
front
();
}
}
else
if
(
name
==
"directory"
)
{
result
=
m_files
.
front
();
if
(
!
m_isDir
)
{
int
sepPos
=
result
.
lastIndexOf
(
'/'
);
if
(
sepPos
<
0
)
{
sepPos
=
result
.
lastIndexOf
(
QDir
::
separator
());
}
if
(
sepPos
>=
0
)
{
result
.
truncate
(
sepPos
);
if
(
!
m_files
.
isEmpty
())
{
result
=
m_files
.
front
();
if
(
!
m_isDir
)
{
int
sepPos
=
result
.
lastIndexOf
(
'/'
);
if
(
sepPos
<
0
)
{
sepPos
=
result
.
lastIndexOf
(
QDir
::
separator
());
}
if
(
sepPos
>=
0
)
{
result
.
truncate
(
sepPos
);
}
}
}
}
else
if
(
name
==
"browser"
)
{
...
...
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