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
Multimedia
Kdenlive
Commits
b331578c
Commit
b331578c
authored
Jan 25, 2021
by
Jean-Baptiste Mardelle
Browse files
Ensure clips have an "unnamed" label if name is empty
parent
3316f377
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/bin/abstractprojectitem.cpp
View file @
b331578c
...
...
@@ -34,7 +34,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QPainter>
#include <QPainterPath>
#include <QVariant>
#include <KLocalizedString>
#include <utility>
AbstractProjectItem
::
AbstractProjectItem
(
PROJECTITEMTYPE
type
,
QString
id
,
const
std
::
shared_ptr
<
ProjectItemModel
>
&
model
,
bool
isRoot
)
:
TreeItem
(
QList
<
QVariant
>
(),
std
::
static_pointer_cast
<
AbstractTreeModel
>
(
model
),
isRoot
)
,
m_name
()
...
...
@@ -123,7 +126,7 @@ QVariant AbstractProjectItem::getData(DataType type) const
QVariant
data
;
switch
(
type
)
{
case
DataName
:
data
=
QVariant
(
m_name
);
data
=
m_name
.
isEmpty
()
?
i18n
(
"Unnamed"
)
:
QVariant
(
m_name
);
break
;
case
DataDescription
:
data
=
QVariant
(
m_description
);
...
...
src/bin/bin.cpp
View file @
b331578c
...
...
@@ -3448,7 +3448,7 @@ void Bin::renameSubClip(const QString &id, const QString &newName, int in, int o
if
(
!
sub
)
{
return
;
}
sub
->
setName
(
newName
);
sub
->
setName
(
newName
.
isEmpty
()
?
i18n
(
"Unnamed"
)
:
newName
);
clip
->
updateZones
();
emit
itemUpdated
(
sub
);
}
...
...
src/mltcontroller/clipcontroller.cpp
View file @
b331578c
...
...
@@ -560,7 +560,7 @@ QString ClipController::clipName() const
if
(
!
name
.
isEmpty
())
{
return
name
;
}
return
QFileInfo
(
m_path
).
fileName
();
return
m_path
.
isEmpty
()
?
i18n
(
"Unnamed"
)
:
QFileInfo
(
m_path
).
fileName
();
}
QString
ClipController
::
description
()
const
...
...
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