Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix folder rename

parent 192c726a
......@@ -190,3 +190,16 @@ int BinPlaylist::count() const
{
return m_binPlaylist->count();
}
void BinPlaylist::manageBinFolderRename(const std::shared_ptr<AbstractProjectItem> &binElem)
{
QString id = binElem->clipId();
if (binElem->itemType() != AbstractProjectItem::FolderItem) {
qDebug()<<"// ITEM IS NOT A FOLDER; ABORT RENAME";
}
// When a folder is inserted, we have to store its path into the properties
if (binElem->parent()) {
QString propertyName = "kdenlive:folder." + binElem->parent()->clipId() + QLatin1Char('.') + id;
m_binPlaylist->set(propertyName.toUtf8().constData(), binElem->name().toUtf8().constData());
}
}
......@@ -58,6 +58,10 @@ public:
*/
void manageBinItemInsertion(const std::shared_ptr<AbstractProjectItem> &binElem);
/* @brief This function stores a renamed folder in bin playlise
*/
void manageBinFolderRename(const std::shared_ptr<AbstractProjectItem> &binElem);
/* @brief Make sure bin playlist is saved in given tractor.
This has a side effect on the tractor
*/
......
......@@ -644,6 +644,7 @@ Fun ProjectItemModel::requestRenameFolder_lambda(std::shared_ptr<AbstractProject
return false;
}
currentFolder->setName(newName);
m_binPlaylist->manageBinFolderRename(currentFolder);
auto index = getIndexFromItem(currentFolder);
emit dataChanged(index, index, {AbstractProjectItem::DataName});
return true;
......
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