From: Mads Bondo Dydensborg Date: Sun, 2 Nov 2008 14:17:47 +0000 (+0000) Subject: A few documentation comments, and removed weird chars that somehow is present in... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=0f6fbc12404b671fdc2a4d257f17e63163858326;p=kdenlive A few documentation comments, and removed weird chars that somehow is present in my source? svn path=/branches/KDE4/; revision=2617 --- diff --git a/src/clipitem.cpp b/src/clipitem.cpp index 7d99ec03..188ded2f 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -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); diff --git a/src/projectitem.cpp b/src/projectitem.cpp index 99a692ca..89ffd9cf 100644 --- a/src/projectitem.cpp +++ b/src/projectitem.cpp @@ -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, "" + 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. } diff --git a/src/projectitem.h b/src/projectitem.h index c5c92a62..d71500b1 100644 --- a/src/projectitem.h +++ b/src/projectitem.h @@ -31,6 +31,10 @@ #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; diff --git a/src/projectlist.cpp b/src/projectlist.cpp index d2e7f215..2530c2ee 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -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(*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) {