if (refreshProducer) slotRefreshProducer();
}
-void DocClipBase::setProperty(QString key, QString value) {
+void DocClipBase::setProperty(const QString &key, const QString &value) {
m_properties.insert(key, value);
if (key == "resource") m_thumbProd->updateClipUrl(KUrl(value));
else if (key == "out") setDuration(GenTime(value.toInt(), KdenliveSettings::project_fps()));
/** Returns any property of this clip. */
const QString getProperty(const QString prop) const;
- void setProperty(QString key, QString value);
+ void setProperty(const QString &key, const QString &value);
/** Returns the internal unique id of the clip. */
const QString &getId() const;
slotUpdateClipProperties(clip, props);
} else if (column == 1 && clip->isGroup()) {
m_doc->slotEditFolder(item->text(1), clip->groupName(), clip->clipId());
+ const int children = item->childCount();
+ for (int i = 0; i < children; i++) {
+ ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
+ child->setProperty("groupname", item->text(1));
+ }
}
}
else ids << item->clipId();
if (item->numReferences() > 0) {
if (KMessageBox::questionYesNo(this, i18np("Delete clip <b>%2</b> ?<br>This will also remove the clip in timeline", "Delete clip <b>%2</b> ?<br>This will also remove its %1 clips in timeline", item->numReferences(), item->names().at(1)), i18n("Delete Clip")) != KMessageBox::Yes) return;
- } else if (item->clipType() == FOLDER && item->childCount() > 0) {
+ } else if (item->isGroup() && item->childCount() > 0) {
int children = item->childCount();
if (KMessageBox::questionYesNo(this, i18n("Delete folder <b>%2</b> ?<br>This will also remove the %1 clips in that folder", children, item->names().at(1)), i18n("Delete Folder")) != KMessageBox::Yes) return;
for (int i = 0; i < children; ++i) {
QTreeWidgetItemIterator it(listView);
while (*it) {
item = static_cast <ProjectItem *>(*it);
- if (item->clipType() == FOLDER && item->clipId() == clipId) {
+ if (item->isGroup() && item->clipId() == clipId) {
delete item;
break;
}
QTreeWidgetItemIterator it(listView);
while (*it) {
item = static_cast <ProjectItem *>(*it);
- if (item->clipType() == FOLDER && item->clipId() == clipId) {
+ if (item->isGroup() && item->clipId() == clipId) {
item->setText(1, foldername);
+ const int children = item->childCount();
+ for (int i = 0; i < children; i++) {
+ ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
+ child->setProperty("groupname", foldername);
+ }
break;
}
++it;