- QMap <QString, QString> props;
- props["description"] = item->text(2);
- slotUpdateClipProperties(clip, props);
- } else if (column == 1 && clip->isGroup()) {
- m_doc->slotEditFolder(item->text(1), clip->groupName(), clip->clipId());
+ if (clip->referencedClip()) {
+ QMap <QString, QString> oldprops;
+ QMap <QString, QString> newprops;
+ oldprops["description"] = clip->referencedClip()->getProperty("description");
+ newprops["description"] = item->text(2);
+ slotUpdateClipProperties(clip, newprops);
+ EditClipCommand *command = new EditClipCommand(this, clip->clipId(), oldprops, newprops, false);
+ m_commandStack->push(command);
+ }
+ } else if (column == 1) {
+ if (clip->isGroup()) {
+ editFolder(item->text(1), clip->groupName(), clip->clipId());
+ clip->setGroupName(item->text(1));
+ m_doc->clipManager()->addFolder(clip->clipId(), item->text(1));
+ 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 {
+ if (clip->referencedClip()) {
+ QMap <QString, QString> oldprops;
+ QMap <QString, QString> newprops;
+ oldprops["name"] = clip->referencedClip()->getProperty("name");
+ newprops["name"] = item->text(1);
+ slotUpdateClipProperties(clip, newprops);
+ emit projectModified();
+ EditClipCommand *command = new EditClipCommand(this, clip->clipId(), oldprops, newprops, false);
+ m_commandStack->push(command);
+ }
+ }