]> git.sesse.net Git - kdenlive/commitdiff
A few documentation comments, and removed weird chars that somehow is present in...
authorMads Bondo Dydensborg <mads@dydensborg.dk>
Sun, 2 Nov 2008 14:17:47 +0000 (14:17 +0000)
committerMads Bondo Dydensborg <mads@dydensborg.dk>
Sun, 2 Nov 2008 14:17:47 +0000 (14:17 +0000)
svn path=/branches/KDE4/; revision=2617

src/clipitem.cpp
src/projectitem.cpp
src/projectitem.h
src/projectlist.cpp

index 7d99ec031e25f61fcb2264221894b7cee0665529..188ded2f58f7c484c88748f6c0657e9e63de422f 100644 (file)
@@ -489,7 +489,7 @@ void ClipItem::paint(QPainter *painter,
     //QPainterPath roundRectPathUpper = upperRectPart(br), roundRectPathLower = lowerRectPart(br);
     painter->setClipRect(exposed);
 
-    // build path around clip
+    //build path around clip
     //QPainterPath resultClipPath = roundRectPathUpper.united(roundRectPathLower);
     //painter->fillPath(resultClipPath, paintColor);
     painter->fillRect(br, paintColor);
@@ -1075,7 +1075,7 @@ QDomElement ClipItem::effectAt(int ix) {
 }
 
 void ClipItem::setEffectAt(int ix, QDomElement effect) {
-    kDebug() << "CHange EFFECT AT: " << ix << ", CURR: " << m_effectList.at(ix).attribute("tag") << ", NEW: " << effect.attribute("tag");
+    kDebug() << "CHange EFFECT AT: " << ix << ", CURR: " << m_effectList.at(ix).attribute("tag") << ", NEW: " << effect.attribute("tag");
     effect.setAttribute("kdenlive_ix", ix + 1);
     m_effectList.insert(ix, effect);
     m_effectList.removeAt(ix + 1);
index 99a692ca6fa46214c5578c884891287b9e32c047..89ffd9cf1c21819f0743ee3ff150d4fead380f2c 100644 (file)
@@ -45,6 +45,7 @@ ProjectItem::ProjectItem(QTreeWidget * parent, const QStringList & strings, cons
     setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
     setIcon(0, KIcon("folder"));
     setToolTip(1, "<qt><b>" + i18n("Folder"));
+    //kDebug() << "Constructed as folder, with clipId: " << m_clipId << ", and groupname: " << m_groupname;
 }
 
 ProjectItem::ProjectItem(QTreeWidget * parent, DocClipBase *clip)
@@ -60,7 +61,7 @@ ProjectItem::ProjectItem(QTreeWidget * parent, DocClipBase *clip)
     setText(2, m_clip->description());
     if ((m_clip->clipType() == AV || m_clip->clipType() == AUDIO) && KdenliveSettings::audiothumbnails()) m_clip->askForAudioThumbs();
     //setFlags(Qt::NoItemFlags);
-    //kDebug() << "PROJECT ITE;. ADDING LCIP: " << m_clipId;
+    //kDebug() << "Constructed with clipId: " << m_clipId;
 }
 
 ProjectItem::ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip)
@@ -76,7 +77,7 @@ ProjectItem::ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip)
     setText(2, m_clip->description());
     if ((m_clip->clipType() == AV || m_clip->clipType() == AUDIO) && KdenliveSettings::audiothumbnails()) m_clip->askForAudioThumbs();
     //setFlags(Qt::NoItemFlags);
-    //kDebug() << "PROJECT ITE;. ADDING LCIP: " << m_clipId;
+    //kDebug() << "Constructed with clipId: " << m_clipId;
 }
 
 
@@ -202,7 +203,7 @@ void ProjectItem::setProperties(const QMap < QString, QString > &attributes, con
         GenTime duration = GenTime(attributes["duration"].toInt(), KdenliveSettings::project_fps());
         setData(1, DurationRole, Timecode::getEasyTimecode(duration, KdenliveSettings::project_fps()));
         m_clip->setDuration(duration);
-        //kDebug() << "//// LOADED CLIP, DURATION SET TO: " << duration.frames(KdenliveSettings::project_fps());
+        //kDebug() << "//// LOADED CLIP, DURATION SET TO: " << duration.frames(KdenliveSettings::project_fps());
     } else  {
         // No duration known, use an arbitrary one until it is.
     }
index c5c92a62741d76ee59c73b6ae504137379cc354e..d71500b1ea01a2f570df9267387f771488e5ac0f 100644 (file)
 #include "definitions.h"
 
 class DocClipBase;
+
+/** \brief Represents a clip or a folder in the projecttree
+ *
+ * This class represents a clip or folder in the projecttree and in the document(?) */
 class ProjectItem : public QTreeWidgetItem {
 public:
     /** Create folder item */
@@ -42,6 +46,10 @@ public:
     int numReferences() const;
 
     void setProperties(const QMap < QString, QString > &attributes, const QMap < QString, QString > &metadata);
+
+    /** \brief The id of the clip or folder.
+     *
+     * The clipId is used both to identify clips and folders (groups) */
     const QString &clipId() const;
     QStringList names() const;
     bool isGroup() const;
index d2e7f215d06e9d0be9913d4513661e1052b9b91c..2530c2ee83ce2c877e7c775bd2d9e6b88d5902f3 100644 (file)
@@ -259,7 +259,7 @@ void ProjectList::slotDeleteClip(const QString &clipId) {
     ProjectItem *item = getItemById(clipId);
     QTreeWidgetItem *p = item->parent();
     if (p) {
-        kDebug() << "///////  DELETEED CLIP HAS A PARENT... " << p->indexOfChild(item);
+        kDebug() << "///////  DELETED CLIP HAS A PARENT... " << p->indexOfChild(item);
         QTreeWidgetItem *clone = p->takeChild(p->indexOfChild(item));
     } else if (item) {
         delete item;
@@ -314,17 +314,21 @@ void ProjectList::slotAddFolder(const QString foldername, const QString &clipId,
 
 void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties) {
     const QString parent = clip->getProperty("groupid");
+    //kDebug() << "Adding clip with groupid: " << parent;
     ProjectItem *item = NULL;
     if (!parent.isEmpty()) {
         ProjectItem *parentitem = getItemById(parent);
         if (!parentitem) {
             QStringList text;
             QString groupName = clip->getProperty("groupname");
+            //kDebug() << "Adding clip to new group: " << groupName;
             if (groupName.isEmpty()) groupName = i18n("Folder");
             text << QString() << groupName;
             listView->blockSignals(true);
             parentitem = new ProjectItem(listView, text, parent);
             listView->blockSignals(false);
+        } else {
+            //kDebug() << "Adding clip to existing group: " << parentitem->groupName();
         }
         if (parentitem) item = new ProjectItem(parentitem, clip);
     }
@@ -406,7 +410,7 @@ void ProjectList::updateAllClips() {
 }
 
 void ProjectList::slotAddClip(QUrl givenUrl, QString group) {
-    if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!!  NO CMD STK";
+    if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
     KUrl::List list;
     if (givenUrl.isEmpty()) {
         list = KFileDialog::getOpenUrls(KUrl("kfiledialog:///clipfolder"), "application/x-kdenlive application/x-flash-video application/vnd.rn-realmedia video/x-dv video/dv video/x-msvideo video/mpeg video/x-ms-wmv audio/mpeg audio/x-mp3 audio/x-wav application/ogg video/mp4 video/quicktime image/gif image/jpeg image/png image/x-bmp image/svg+xml image/tiff image/x-xcf-gimp image/x-vnd.adobe.photoshop image/x-pcx image/x-exr video/mlt-playlist audio/x-flac audio/mp4", this);
@@ -444,7 +448,7 @@ void ProjectList::slotRemoveInvalidClip(const QString &id) {
 }
 
 void ProjectList::slotAddColorClip() {
-    if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!!  NO CMD STK";
+    if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
     QDialog *dia = new QDialog(this);
     Ui::ColorClip_UI *dia_ui = new Ui::ColorClip_UI();
     dia_ui->setupUi(dia);
@@ -476,7 +480,7 @@ void ProjectList::slotAddColorClip() {
 
 
 void ProjectList::slotAddSlideshowClip() {
-    if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!!  NO CMD STK";
+    if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
     SlideshowClip *dia = new SlideshowClip(this);
 
     if (dia->exec() == QDialog::Accepted) {
@@ -607,6 +611,13 @@ void ProjectList::slotReplyGetImage(const QString &clipId, int pos, const QPixma
 
 ProjectItem *ProjectList::getItemById(const QString &id) {
     QTreeWidgetItemIterator it(listView);
+    while (*it) {
+        if (((ProjectItem *)(*it))->clipId() == id)
+            return static_cast<ProjectItem *>(*it);
+        ++it;
+    }
+    return NULL;
+#ifdef USED_TO_BE_THIS
     while (*it) {
         if (((ProjectItem *)(*it))->clipId() == id)
             break;
@@ -614,6 +625,7 @@ ProjectItem *ProjectList::getItemById(const QString &id) {
     }
     if (*it) return ((ProjectItem *)(*it));
     return NULL;
+#endif
 }
 
 void ProjectList::slotSelectClip(const QString &ix) {