Fix loading of clip zones

parent 395445be
Pipeline #3082 passed with stage
in 20 minutes and 25 seconds
......@@ -111,7 +111,7 @@ std::shared_ptr<ProjectClip> ProjectClip::construct(const QString &id, const QIc
{
std::shared_ptr<ProjectClip> self(new ProjectClip(id, thumb, model, producer));
baseFinishConstruct(self);
model->loadSubClips(id, self->getPropertiesFromPrefix(QStringLiteral("kdenlive:clipzone.")));
QMetaObject::invokeMethod(model.get(), "loadSubClips", Qt::QueuedConnection, Q_ARG(const QString&, id), Q_ARG(const stringMap&, self->getPropertiesFromPrefix(QStringLiteral("kdenlive:clipzone."))));
return self;
}
......
......@@ -457,19 +457,20 @@ std::shared_ptr<ProjectFolder> ProjectItemModel::getRootFolder() const
return std::static_pointer_cast<ProjectFolder>(rootItem);
}
void ProjectItemModel::loadSubClips(const QString &id, const QMap<QString, QString> &dataMap)
void ProjectItemModel::loadSubClips(const QString &id, const stringMap &clipData)
{
QWriteLocker locker(&m_lock);
Fun undo = []() { return true; };
Fun redo = []() { return true; };
loadSubClips(id, dataMap, undo, redo);
loadSubClips(id, clipData, undo, redo);
}
void ProjectItemModel::loadSubClips(const QString &id, const QMap<QString, QString> &dataMap, Fun &undo, Fun &redo)
void ProjectItemModel::loadSubClips(const QString &id, const stringMap &dataMap, Fun &undo, Fun &redo)
{
QWriteLocker locker(&m_lock);
std::shared_ptr<ProjectClip> clip = getClipByBinID(id);
if (!clip) {
qDebug()<<" = = = = = CLIP NOT LOADED";
return;
}
QMapIterator<QString, QString> i(dataMap);
......
......@@ -98,11 +98,7 @@ public:
/** @brief Convenience method to access root folder */
std::shared_ptr<ProjectFolder> getRootFolder() const;
/** @brief Create the subclips defined in the parent clip.
@param id is the id of the parent clip
@param data is a definition of the subclips (keys are subclips' names, value are "in:out")*/
void loadSubClips(const QString &id, const QMap<QString, QString> &data);
void loadSubClips(const QString &id, const QMap<QString, QString> &dataMap, Fun &undo, Fun &redo);
void loadSubClips(const QString &id, const stringMap &dataMap, Fun &undo, Fun &redo);
/* @brief Convenience method to retrieve a pointer to an element given its index */
std::shared_ptr<AbstractProjectItem> getBinItemByIndex(const QModelIndex &index) const;
......@@ -231,6 +227,10 @@ public slots:
/** @brief Check whether a given id is currently used or not*/
bool isIdFree(const QString &id) const;
void setDragType(PlaylistState::ClipState type);
/** @brief Create the subclips defined in the parent clip.
@param id is the id of the parent clip
@param data is a definition of the subclips (keys are subclips' names, value are "in:out")*/
void loadSubClips(const QString &id, const stringMap &clipData);
private:
/** @brief Return reference to column specific data */
......
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