Commit 84910e03 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Merge branch '1912'

parents cdddc4b8 0f874a1f
Pipeline #13554 passed with stage
in 23 minutes
......@@ -658,7 +658,7 @@ bool ProjectItemModel::requestAddFolder(QString &id, const QString &name, const
{
QWriteLocker locker(&m_lock);
if (!id.isEmpty() && !isIdFree(id)) {
id = QString();
id.clear();
}
if (id.isEmpty()) {
id = QString::number(getFreeFolderId());
......@@ -679,7 +679,7 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const QDomElement &descrip
id = QString::number(getFreeClipId());
}
}
Q_ASSERT(!id.isEmpty() && isIdFree(id));
Q_ASSERT(isIdFree(id));
qDebug() << "/////////// found id" << id;
std::shared_ptr<ProjectClip> new_clip =
ProjectClip::construct(id, description, m_blankThumb, std::static_pointer_cast<ProjectItemModel>(shared_from_this()));
......@@ -721,7 +721,7 @@ bool ProjectItemModel::requestAddBinClip(QString &id, const std::shared_ptr<Mlt:
id = QString::number(getFreeClipId());
}
}
Q_ASSERT(!id.isEmpty() && isIdFree(id));
Q_ASSERT(isIdFree(id));
std::shared_ptr<ProjectClip> new_clip = ProjectClip::construct(id, m_blankThumb, std::static_pointer_cast<ProjectItemModel>(shared_from_this()), producer);
bool res = addItem(new_clip, parentId, undo, redo);
if (res) {
......@@ -741,7 +741,7 @@ bool ProjectItemModel::requestAddBinSubClip(QString &id, int in, int out, const
if (id.isEmpty()) {
id = QString::number(getFreeClipId());
}
Q_ASSERT(!id.isEmpty() && isIdFree(id));
Q_ASSERT(isIdFree(id));
QString subId = parentId;
if (subId.startsWith(QLatin1Char('A')) || subId.startsWith(QLatin1Char('V'))) {
subId.remove(0, 1);
......@@ -947,6 +947,9 @@ bool ProjectItemModel::loadFolders(Mlt::Properties &folders)
bool ProjectItemModel::isIdFree(const QString &id) const
{
READ_LOCK();
if (id.isEmpty()) {
return false;
}
for (const auto &clip : m_allItems) {
auto c = std::static_pointer_cast<AbstractProjectItem>(clip.second.lock());
if (c->clipId() == id) {
......
......@@ -1477,14 +1477,7 @@ void RenderWidget::generateRenderFiles(QDomDocument doc, const QString &playlist
for (int i = 0; i < prods.count(); ++i) {
auto prod = prods.at(i).toElement();
if (prod.attribute(QStringLiteral("id")) == QStringLiteral("black_track")) {
auto props = prod.elementsByTagName(QStringLiteral("property"));
for (int j = 0; j < props.count(); ++j) {
auto prop = props.at(j).toElement();
if (prop.attribute(QStringLiteral("name")) == QStringLiteral("resource")) {
prop.firstChild().setNodeValue(QStringLiteral("transparent"));
break;
}
}
Xml::setXmlProperty(prod, QStringLiteral("resource"), QStringLiteral("transparent"));
break;
}
}
......
......@@ -48,6 +48,7 @@
#include <KDualAction>
#include <KMessageBox>
#include <KRecentDirs>
#include <KSqueezedTextLabel>
#include <klocalizedstring.h>
CollapsibleEffectView::CollapsibleEffectView(const std::shared_ptr<EffectItemModel> &effectModel, QSize frameSize, const QImage &icon, QWidget *parent)
......@@ -107,7 +108,7 @@ CollapsibleEffectView::CollapsibleEffectView(const std::shared_ptr<EffectItemMod
m_colorIcon = new QLabel(this);
l->insertWidget(0, m_colorIcon);
m_colorIcon->setFixedSize(collapseButton->sizeHint());
title = new QLabel(this);
title = new KSqueezedTextLabel(this);
l->insertWidget(2, title);
m_keyframesButton = new QToolButton(this);
......
......@@ -31,6 +31,7 @@
class QLabel;
class KDualAction;
class KSqueezedTextLabel;
class EffectItemModel;
class AssetParameterView;
......@@ -47,7 +48,7 @@ class CollapsibleEffectView : public AbstractCollapsibleWidget
public:
explicit CollapsibleEffectView(const std::shared_ptr<EffectItemModel> &effectModel, QSize frameSize, const QImage &icon, QWidget *parent = nullptr);
~CollapsibleEffectView() override;
QLabel *title;
KSqueezedTextLabel *title;
void setupWidget(const ItemInfo &info);
void updateTimecodeFormat();
......
......@@ -134,6 +134,7 @@ void ClipController::addMasterProducer(const std::shared_ptr<Mlt::Producer> &pro
qCDebug(KDENLIVE_LOG) << "// WARNING, USING INVALID PRODUCER";
} else {
checkAudioVideo();
setProducerProperty(QStringLiteral("kdenlive:id"), m_controllerBinId);
QString proxy = m_properties->get("kdenlive:proxy");
m_service = m_properties->get("mlt_service");
QString path = m_properties->get("resource");
......@@ -151,7 +152,6 @@ void ClipController::addMasterProducer(const std::shared_ptr<Mlt::Producer> &pro
m_path = path.isEmpty() ? QString() : QFileInfo(path).absoluteFilePath();
getInfoForProducer();
emitProducerChanged(m_controllerBinId, producer);
setProducerProperty(QStringLiteral("kdenlive:id"), m_controllerBinId);
}
connectEffectStack();
}
......@@ -355,6 +355,7 @@ void ClipController::updateProducer(const std::shared_ptr<Mlt::Producer> &produc
*m_masterProducer = producer.get();
m_properties = new Mlt::Properties(m_masterProducer->get_properties());
m_producerLock.unlock();
setProducerProperty(QStringLiteral("kdenlive:id"), m_controllerBinId);
checkAudioVideo();
// Pass properties from previous producer
m_properties->pass_list(passProperties, passList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment