+ if (ix == 0 || e.tagName() == "effectgroup") {
+ if (e.tagName() == "effectgroup") {
+ // dropped a group on another group
+ QDomNodeList pastedEffects = e.elementsByTagName("effect");
+ if (pastedEffects.isEmpty() || m_subWidgets.isEmpty()) {
+ // Buggy groups, should not happen
+ event->ignore();
+ return;
+ }
+ QList <int> pastedEffectIndexes;
+ QList <int> currentEffectIndexes;
+ EffectInfo pasteInfo;
+ pasteInfo.fromString(pastedEffects.at(0).toElement().attribute("kdenlive_info"));
+ if (pasteInfo.groupIndex == -1) {
+ // Group dropped from effects list, add effect
+ e.setAttribute("kdenlive_ix", m_subWidgets.last()->effectIndex());
+ emit addEffect(e);
+ event->setDropAction(Qt::CopyAction);
+ event->accept();
+ return;
+ }
+ // Moving group
+ for (int i = 0; i < pastedEffects.count(); ++i) {
+ pastedEffectIndexes << pastedEffects.at(i).toElement().attribute("kdenlive_ix").toInt();
+ }
+ for (int i = 0; i < m_subWidgets.count(); ++i) {
+ currentEffectIndexes << m_subWidgets.at(i)->effectIndex();
+ }
+ kDebug()<<"PASTING: "<<pastedEffectIndexes<<" TO "<<currentEffectIndexes;
+ if (pastedEffectIndexes.at(0) < currentEffectIndexes.at(0)) {
+ // Pasting group after current one:
+ emit moveEffect(pastedEffectIndexes, currentEffectIndexes.last(), pasteInfo.groupIndex, pasteInfo.groupName);
+ }
+ else {
+ // Group moved before current one
+ emit moveEffect(pastedEffectIndexes, currentEffectIndexes.first(), pasteInfo.groupIndex, pasteInfo.groupName);
+ }
+ event->setDropAction(Qt::MoveAction);
+ event->accept();
+ return;
+ }