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
5cb2e98c
Commit
5cb2e98c
authored
Nov 11, 2019
by
Jean-Baptiste Mardelle
Browse files
Fix composition description not appearing in info box
parent
3ab5c48d
Pipeline
#10232
passed with stage
in 24 minutes and 11 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/assets/abstractassetsrepository.ipp
View file @
5cb2e98c
...
...
@@ -21,11 +21,13 @@
#include "xml/xml.hpp"
#include "kdenlivesettings.h"
#include <QDir>
#include <QFile>
#include <QStandardPaths>
#include <QString>
#include <QTextStream>
#include <KLocalizedString>
#include <locale>
#ifdef Q_OS_MAC
...
...
@@ -137,8 +139,7 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
QString id = metadata->get("identifier");
res.name = metadata->get("title");
res.name[0] = res.name[0].toUpper();
res.description = metadata->get("description");
res.description.append(QString(" (%1)").arg(id));
res.description = i18n(metadata->get("description")) + QString(" (%1)").arg(id);
res.author = metadata->get("creator");
res.version_str = metadata->get("version");
res.version = ceil(100 * metadata->get_double("version"));
...
...
@@ -331,7 +332,7 @@ template <typename AssetType> bool AbstractAssetsRepository<AssetType>::parseInf
// Update description if the xml provide one
QString description = Xml::getSubTagContent(currentAsset, QStringLiteral("description"));
if (!description.isEmpty()) {
res.description = description;
res.description =
i18n(
description
.toUtf8().constData()) + QString(" (%1)").arg(res.id)
;
}
// Update name if the xml provide one
...
...
src/assets/assetlist/model/assettreemodel.cpp
View file @
5cb2e98c
...
...
@@ -68,20 +68,20 @@ bool AssetTreeModel::isFavorite(const QModelIndex &index) const
return
item
->
dataColumn
(
AssetTreeModel
::
favCol
).
toBool
();
}
QString
AssetTreeModel
::
getDescription
(
const
QModelIndex
&
index
)
const
QString
AssetTreeModel
::
getDescription
(
bool
isEffect
,
const
QModelIndex
&
index
)
const
{
if
(
!
index
.
isValid
())
{
return
QString
();
}
std
::
shared_ptr
<
TreeItem
>
item
=
getItemById
((
int
)
index
.
internalId
());
if
(
item
->
depth
()
==
1
)
{
if
(
isEffect
&&
item
->
depth
()
==
1
)
{
return
QString
();
}
auto
id
=
item
->
dataColumn
(
AssetTreeModel
::
idCol
).
toString
();
if
(
EffectsRepository
::
get
()
->
exists
(
id
))
{
if
(
isEffect
&&
EffectsRepository
::
get
()
->
exists
(
id
))
{
return
EffectsRepository
::
get
()
->
getDescription
(
id
);
}
if
(
TransitionsRepository
::
get
()
->
exists
(
id
))
{
if
(
!
isEffect
&&
TransitionsRepository
::
get
()
->
exists
(
id
))
{
return
TransitionsRepository
::
get
()
->
getDescription
(
id
);
}
return
QString
();
...
...
src/assets/assetlist/model/assettreemodel.hpp
View file @
5cb2e98c
...
...
@@ -41,7 +41,7 @@ public:
// Helper function to retrieve name
QString
getName
(
const
QModelIndex
&
index
)
const
;
// Helper function to retrieve description
QString
getDescription
(
const
QModelIndex
&
index
)
const
;
QString
getDescription
(
bool
isEffect
,
const
QModelIndex
&
index
)
const
;
// Helper function to retrieve if an effect is categorized as favorite
bool
isFavorite
(
const
QModelIndex
&
index
)
const
;
QHash
<
int
,
QByteArray
>
roleNames
()
const
override
;
...
...
src/assets/assetlist/view/assetlistwidget.cpp
View file @
5cb2e98c
...
...
@@ -78,9 +78,9 @@ void AssetListWidget::setFavorite(const QModelIndex &index, bool favorite, bool
m_model
->
setFavorite
(
m_proxyModel
->
mapToSource
(
index
),
favorite
,
isEffect
);
}
QString
AssetListWidget
::
getDescription
(
const
QModelIndex
&
index
)
const
QString
AssetListWidget
::
getDescription
(
bool
isEffect
,
const
QModelIndex
&
index
)
const
{
return
m_model
->
getDescription
(
m_proxyModel
->
mapToSource
(
index
));
return
m_model
->
getDescription
(
isEffect
,
m_proxyModel
->
mapToSource
(
index
));
}
void
AssetListWidget
::
setFilterName
(
const
QString
&
pattern
)
...
...
src/assets/assetlist/view/assetlistwidget.hpp
View file @
5cb2e98c
...
...
@@ -53,7 +53,7 @@ public:
void
setFavorite
(
const
QModelIndex
&
index
,
bool
favorite
=
true
,
bool
isEffect
=
true
);
/* @brief Returns the description of the asset given its model index */
QString
getDescription
(
const
QModelIndex
&
index
)
const
;
QString
getDescription
(
bool
isEffect
,
const
QModelIndex
&
index
)
const
;
/* @brief Sets the pattern against which the assets' names are filtered */
void
setFilterName
(
const
QString
&
pattern
);
...
...
src/assets/assetlist/view/qml/assetList.qml
View file @
5cb2e98c
...
...
@@ -212,7 +212,7 @@ Rectangle {
id
:
sel
model
:
assetListModel
onSelectionChanged
:
{
assetDescription
.
text
=
i18n
(
assetlist
.
getDescription
(
sel
.
currentIndex
)
)
assetDescription
.
text
=
assetlist
.
getDescription
(
sel
.
currentIndex
)
}
}
SplitView
{
...
...
src/effects/effectlist/view/effectlistwidget.hpp
View file @
5cb2e98c
...
...
@@ -77,7 +77,7 @@ public:
q
->
setFavorite
(
index
,
favorite
,
true
);
q
->
updateFavorite
(
index
);
}
Q_INVOKABLE
QString
getDescription
(
const
QModelIndex
&
index
)
const
{
return
q
->
getDescription
(
index
);
}
Q_INVOKABLE
QString
getDescription
(
const
QModelIndex
&
index
)
const
{
return
q
->
getDescription
(
true
,
index
);
}
Q_INVOKABLE
QVariantMap
getMimeData
(
const
QString
&
assetId
)
const
{
return
q
->
getMimeData
(
assetId
);
}
Q_INVOKABLE
void
activate
(
const
QModelIndex
&
ix
)
{
q
->
activate
(
ix
);
}
...
...
src/transitions/transitionlist/view/transitionlistwidget.hpp
View file @
5cb2e98c
...
...
@@ -71,7 +71,7 @@ public:
q
->
updateFavorite
(
index
);
}
Q_INVOKABLE
void
setFilterType
(
const
QString
&
type
)
{
q
->
setFilterType
(
type
);
}
Q_INVOKABLE
QString
getDescription
(
const
QModelIndex
&
index
)
const
{
return
q
->
getDescription
(
index
);
}
Q_INVOKABLE
QString
getDescription
(
const
QModelIndex
&
index
)
const
{
return
q
->
getDescription
(
false
,
index
);
}
Q_INVOKABLE
QVariantMap
getMimeData
(
const
QString
&
assetId
)
const
{
return
q
->
getMimeData
(
assetId
);
}
Q_INVOKABLE
void
activate
(
const
QModelIndex
&
ix
)
{
q
->
activate
(
ix
);
}
...
...
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