]> git.sesse.net Git - kdenlive/commitdiff
small cleanup
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 14 Jan 2013 10:35:58 +0000 (11:35 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 14 Jan 2013 10:35:58 +0000 (11:35 +0100)
CMakeLists.txt
src/abstractgroupitem.cpp
src/customtrackview.cpp
src/encodingprofilesdialog.cpp
src/kdenlivesettingsdialog.cpp
src/mainwindow.cpp
src/projectlist.cpp
src/projectlist.h
src/projectsettings.cpp

index 516c3d1a142c029a5f24441cf850d6eff455158e..fd29ad4bc8f53f441281f7207a36cc020ebb629a 100644 (file)
@@ -5,7 +5,7 @@ project(kdenlive)
 set(KDENLIVE_VERSION 0.9.3)
 
 # Minimum versions of main dependencies.
-set(LIBMLT_MIN_VERSION 0.7.8)
+set(LIBMLT_MIN_VERSION 0.8.6)
 set(QT_MIN_VERSION 4.5.0)
 set(KDE_MIN_VERSION 4.3.0)
 
index a2e04b60ad94ab036ccb78c4e2616292aa903d5d..abf061c7a4382a80655c755721dc7dc088af2352 100644 (file)
@@ -201,7 +201,7 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
            }
            else if (children.at(i)->type() == GROUPWIDGET) {
                currentTrack = static_cast <AbstractGroupItem*> (children.at(i))->track();
-       }
+           }
            else continue;
             if (children.at(i)->type() == AVWIDGET) {
                 if (topTrack == -1 || currentTrack <= topTrack) {
index dc0a76a10fb0644723a11cfcde7f53ad3a45f97a..15abfdebaa962de09f0eb814b0e2e68ddef4871b 100644 (file)
@@ -847,7 +847,11 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
                m_selectionGroup->setProperty("locked_tracks", lockedTracks);
            }
            if (m_dragItem->parentItem() && m_dragItem->parentItem()->type() == GROUPWIDGET && m_dragItem->parentItem() != m_selectionGroup) {
-                dragGroup = static_cast <AbstractGroupItem *>(m_dragItem->parentItem());
+               QGraphicsItem *topGroup = m_dragItem->parentItem();
+               while (topGroup->parentItem() && topGroup->parentItem()->type() == GROUPWIDGET && topGroup->parentItem() != m_selectionGroup) {
+                   topGroup = topGroup->parentItem();
+               }
+                dragGroup = static_cast <AbstractGroupItem *>(topGroup);
                dragGroup->setProperty("y_absolute", yOffset);
                dragGroup->setProperty("locked_tracks", lockedTracks);
             }
@@ -1040,10 +1044,12 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
         } else {
            resetSelectionGroup();
        }
-        dragGroup = NULL;
-        if (m_dragItem->parentItem() && m_dragItem->parentItem()->type() == GROUPWIDGET) {
-            dragGroup = static_cast <AbstractGroupItem *>(m_dragItem->parentItem());
-        }
+        /*if () {
+           dragGroup = NULL;
+           if (m_dragItem->parentItem() && m_dragItem->parentItem()->type() == GROUPWIDGET) {
+               dragGroup = static_cast <AbstractGroupItem *>(m_dragItem->parentItem());
+           }
+       }*/
 
         bool selected = !m_dragItem->isSelected();
        QGraphicsView::mousePressEvent(event);
@@ -1085,8 +1091,9 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
             m_selectionGroup->setSelected(itemSelected);
            
        }
-       if (dragGroup)
+       if (dragGroup) {
             dragGroup->setSelected(itemSelected);
+       }
        m_dragItem->setSelected(itemSelected);
     }
 
@@ -1247,11 +1254,11 @@ void CustomTrackView::rebuildGroup(AbstractGroupItem *group)
     if (group) {
         QList <QGraphicsItem *> children = group->childItems();
         m_document->clipManager()->removeGroup(group);
-       /*for (int i = 0; i < children.count(); i++) {
+       for (int i = 0; i < children.count(); i++) {
            group->removeFromGroup(children.at(i));
-       }*/
+       }
        scene()->destroyItemGroup(group);
-        groupSelectedItems(children, true, true);
+        groupSelectedItems(children, group != m_selectionGroup, true);
     }
 }
 
@@ -1266,14 +1273,16 @@ void CustomTrackView::resetSelectionGroup(bool selectItems)
         scene()->destroyItemGroup(m_selectionGroup);
        m_selectionGroup = NULL;
         for (int i = 0; i < children.count(); i++) {
-            if (children.at(i)->parentItem() == 0 && (children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET)) {
-                if (!static_cast <AbstractClipItem *>(children.at(i))->isItemLocked()) {
-                    children.at(i)->setFlag(QGraphicsItem::ItemIsMovable, true);
-                    children.at(i)->setSelected(selectItems);
-                }
-            } else if (children.at(i)->type() == GROUPWIDGET) {
-                children.at(i)->setFlag(QGraphicsItem::ItemIsMovable, true);
-                children.at(i)->setSelected(selectItems);
+            if (children.at(i)->parentItem() == 0) {
+               if ((children.at(i)->type() == AVWIDGET || children.at(i)->type() == TRANSITIONWIDGET)) {
+                   if (!static_cast <AbstractClipItem *>(children.at(i))->isItemLocked()) {
+                       children.at(i)->setFlag(QGraphicsItem::ItemIsMovable, true);
+                       children.at(i)->setSelected(selectItems);
+                   }
+               } else if (children.at(i)->type() == GROUPWIDGET) {
+                   children.at(i)->setFlag(QGraphicsItem::ItemIsMovable, true);
+                   children.at(i)->setSelected(selectItems);
+               }
             }
         }
         KdenliveSettings::setSnaptopoints(snap);
@@ -1295,6 +1304,9 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool
        if (selectNewGroup) selection.at(i)->setSelected(true);
        if (selection.at(i)->type() == GROUPWIDGET) {
            AbstractGroupItem *it = static_cast <AbstractGroupItem *> (selection.at(i));
+           while (it->parentItem() && it->parentItem()->type() == GROUPWIDGET) {
+               it = static_cast <AbstractGroupItem *>(it->parentItem());
+           }
            if (!it || it->isItemLocked()) continue;
            groupsList.insert(it);
        }
@@ -1303,6 +1315,9 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool
        if (selection.at(i)->type() == AVWIDGET || selection.at(i)->type() == TRANSITIONWIDGET) {
            if (selection.at(i)->parentItem() && selection.at(i)->parentItem()->type() == GROUPWIDGET) {
                AbstractGroupItem *it = static_cast <AbstractGroupItem *> (selection.at(i)->parentItem());
+               while (it->parentItem() && it->parentItem()->type() == GROUPWIDGET) {
+                   it = static_cast <AbstractGroupItem *>(it->parentItem());
+               }
                if (!it || it->isItemLocked()) continue;
                groupsList.insert(it);
            }
@@ -1339,8 +1354,11 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool
         newGroup->translate(-diff.x(), -diff.y());
         //newGroup->translate((int) -rectUnion.left(), (int) -rectUnion.top() + 1);
 
-        scene()->addItem(newGroup);
         // Check if we are trying to include a group in a group
+       foreach (QGraphicsItemGroup *value, groupsList) {
+           newGroup->addItem(value);
+        }
+       
        foreach (QGraphicsItemGroup *value, groupsList) {
            QList<QGraphicsItem *> children = value->childItems();
            for (int i = 0; i < children.count(); i++) {
@@ -1355,6 +1373,7 @@ void CustomTrackView::groupSelectedItems(QList <QGraphicsItem *> selection, bool
        foreach (QGraphicsItem *value, itemsList) {
            newGroup->addItem(value);
         }
+        scene()->addItem(newGroup);
         KdenliveSettings::setSnaptopoints(snap);
        if (selectNewGroup) newGroup->setSelected(true);
     } else {
@@ -4254,7 +4273,7 @@ void CustomTrackView::deleteSelectedClips()
     int groupCount = 0;
     int clipCount = 0;
     int transitionCount = 0;
-    // expand & destroy groups
+    // expand & destroy groups    
     for (int i = 0; i < itemList.count(); i++) {
         if (itemList.at(i)->type() == GROUPWIDGET) {
             groupCount++;
@@ -4281,20 +4300,19 @@ void CustomTrackView::deleteSelectedClips()
         } else if (itemList.at(i)->parentItem() && itemList.at(i)->parentItem()->type() == GROUPWIDGET)
             itemList.insert(i + 1, itemList.at(i)->parentItem());
     }
-
+    emit clipItemSelected(NULL);
+    emit transitionItemSelected(NULL);
     for (int i = 0; i < itemList.count(); i++) {
         if (itemList.at(i)->type() == AVWIDGET) {
             clipCount++;
             ClipItem *item = static_cast <ClipItem *>(itemList.at(i));
             //kDebug()<<"// DELETE CLP AT: "<<item->info().startPos.frames(25);
             new AddTimelineClipCommand(this, item->xml(), item->clipProducer(), item->info(), item->effectList(), false, false, true, true, deleteSelected);
-            emit clipItemSelected(NULL);
         } else if (itemList.at(i)->type() == TRANSITIONWIDGET) {
             transitionCount++;
             Transition *item = static_cast <Transition *>(itemList.at(i));
             //kDebug()<<"// DELETE TRANS AT: "<<item->info().startPos.frames(25);
             new AddTransitionCommand(this, item->info(), item->transitionEndTrack(), item->toXML(), true, true, deleteSelected);
-            emit transitionItemSelected(NULL);
         }
     }
     if (groupCount > 0 && clipCount == 0 && transitionCount == 0)
@@ -4475,7 +4493,8 @@ void CustomTrackView::doGroupClips(QList <ItemInfo> clipInfos, QList <ItemInfo>
     resetSelectionGroup();
     m_scene->clearSelection();
     if (!group) {
-        for (int i = 0; i < clipInfos.count(); i++) {
+       // ungroup, find main group to destroy it...
+       for (int i = 0; i < clipInfos.count(); i++) {
             ClipItem *clip = getClipItemAt(clipInfos.at(i).startPos, clipInfos.at(i).track);
             if (clip == NULL) continue;
             if (clip->parentItem() && clip->parentItem()->type() == GROUPWIDGET) {
index 3b14a176438aa942fc08a543c9021c6bc110bebe..02a029f2366627226dc51f77597c1bf05f237f9e 100644 (file)
@@ -47,7 +47,7 @@ EncodingProfilesDialog::EncodingProfilesDialog(int profileType, QWidget * parent
     button_delete->setIcon(KIcon("list-remove"));
     button_download->setIcon(KIcon("download"));
     
-    m_configFile = new KConfig("encodingprofiles.rc", KConfig::FullConfig, "appdata");
+    m_configFile = new KConfig("encodingprofiles.rc", KConfig::CascadeConfig, "appdata");
     profile_type->setCurrentIndex(profileType);
     connect(profile_type, SIGNAL(currentIndexChanged(int)), this, SLOT(slotLoadProfiles()));
     connect(profile_list, SIGNAL(currentRowChanged(int)), this, SLOT(slotShowParams()));
index 755cbab7ca76eb7ba435adbc917f93bb2b9b2c91..32d8844d573285abfdd3a813d64214479e39e3c1 100644 (file)
@@ -1011,7 +1011,7 @@ void KdenliveSettingsDialog::slotManageEncodingProfile()
 
 void KdenliveSettingsDialog::loadEncodingProfiles()
 {
-    KConfig conf("encodingprofiles.rc", KConfig::FullConfig, "appdata");
+    KConfig conf("encodingprofiles.rc", KConfig::CascadeConfig, "appdata");
 
     // Load v4l profiles
     m_configCapture.kcfg_v4l_profile->blockSignals(true);
index 7258b46f3feb542b0dd76b7c7613d1048c3c39ca..e273a98484cf957dc61980cfdaca187d7ccc8555 100644 (file)
@@ -623,7 +623,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
        viewMenu->addAction(guiActions->addAction(viewActions.at(i).first, viewActions.at(i).second));
     
     // Populate encoding profiles
-    KConfig conf("encodingprofiles.rc", KConfig::FullConfig, "appdata");
+    KConfig conf("encodingprofiles.rc", KConfig::CascadeConfig, "appdata");
     if (KdenliveSettings::proxyparams().isEmpty() || KdenliveSettings::proxyextension().isEmpty()) {
         KConfigGroup group(&conf, "proxy");
         QMap< QString, QString > values = group.entryMap();
index 99c1af2b0b3aff7896b09b32c0c595fcd7263ab8..cb78f0684ae6e337bb05334db4af4e71e058c819 100644 (file)
@@ -2221,6 +2221,7 @@ void ProjectList::extractMetadata(DocClipBase *clip)
        clip->setProperty("exiftool", "1");
        if (!meta.isEmpty()) {
            clip->setMetadata(meta);
+           //checkCamcorderFilters(clip, meta);
        }
     }
 }
@@ -3767,4 +3768,20 @@ void ProjectList::slotGotFilterJobResults(QString id, int , int , stringMap resu
 }
 
 
+/*
+// Work in progress: apply filter based on clip's camcorder
+void ProjectList::checkCamcorderFilters(DocClipBase *clip, QMap <QString, QString> meta)
+{
+    KConfig conf("camcorderfilters.rc", KConfig::CascadeConfig, "appdata");
+    QStringList groups = conf.groupList();
+    foreach(QString grp, groups) {
+       if (!meta.contains(grp)) continue;
+       KConfigGroup group(&conf, grp);
+       QString value = group.readEntry(meta.value(grp));
+       if (value.isEmpty()) continue;
+       clip->setProperty(value.section(' ', 0, 0), value.section(' ', 1));
+       break;
+    }
+}*/
+
 #include "projectlist.moc"
index fe8c03424f8b1ec8c9a71b57d580002a880aab8f..830e40348796b8d538a33d97c790ffd78e9ad2b5 100644 (file)
@@ -426,7 +426,10 @@ private:
     /** @brief Create rounded shape pixmap for project tree thumb. */
     QPixmap roundedPixmap(QImage img);
     QPixmap roundedPixmap(QPixmap source);
+    /** @brief Extract a clip's metadata with the exiftool program. */
     void extractMetadata(DocClipBase *clip);
+    /** @brief Add a special FFmpeg tag if clip matches some properties (for example set full_luma for Sony NEX camcorders. */
+    //void checkCamcorderFilters(DocClipBase *clip, QMap <QString, QString> meta);
 
 private slots:
     void slotClipSelected();
index 9289e18e0875a4099d61f08fae83573a104eb684..6cd0355741a9d01bbb0ac0954d7ebcd41de3ebd6 100644 (file)
@@ -94,7 +94,7 @@ ProjectSettings::ProjectSettings(ProjectList *projectlist, QMap <QString, QStrin
 
 
     // load proxy profiles
-    KConfig conf("encodingprofiles.rc", KConfig::FullConfig, "appdata");
+    KConfig conf("encodingprofiles.rc", KConfig::CascadeConfig, "appdata");
     KConfigGroup group(&conf, "proxy");
     QMap <QString, QString> values = group.entryMap();
     QMapIterator<QString, QString> k(values);