Commit f426ee9d authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Expand parent folder when creating a subfolder

parent 538142fe
Pipeline #16299 failed with stage
in 2 minutes and 23 seconds
......@@ -1687,12 +1687,20 @@ void Bin::createClip(const QDomElement &xml)
void Bin::slotAddFolder()
{
auto parentFolder = m_itemModel->getFolderByBinId(getCurrentFolder());
qDebug() << "pranteforder id" << parentFolder->clipId();
qDebug() << "parent folder id" << parentFolder->clipId();
QString newId;
Fun undo = []() { return true; };
Fun redo = []() { return true; };
m_itemModel->requestAddFolder(newId, i18n("Folder"), parentFolder->clipId(), undo, redo);
pCore->pushUndo(undo, redo, i18n("Create bin folder"));
if (m_listType == BinTreeView) {
// Make sure parent folder is expanded
if (parentFolder->clipId().toInt() > -1) {
auto ix = m_itemModel->getIndexFromItem(parentFolder);
auto *view = static_cast<QTreeView *>(m_itemView);
view->expand(m_proxyModel->mapFromSource(ix));
}
}
// Edit folder name
auto folder = m_itemModel->getFolderByBinId(newId);
......
  • Nice. It's more clear now when the user create a subfolder.

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