]> git.sesse.net Git - kdenlive/blobdiff - src/projectitem.cpp
Fix various speed related issues
[kdenlive] / src / projectitem.cpp
index 7c3688c14cc3c7158fc36b721e0e35b0525c7128..7efcef3da411f362bd81a8fa5aec803709384325 100644 (file)
 #include <KLocale>
 #include <KIcon>
 
-
-const int NameRole = Qt::UserRole;
-const int DurationRole = NameRole + 1;
-const int UsageRole = NameRole + 2;
-
+const int DurationRole = Qt::UserRole + 1;
 
 // folder
-ProjectItem::ProjectItem(QTreeWidget * parent, const QStringList & strings, const QString &clipId)
-        : QTreeWidgetItem(parent, strings), m_clipType(FOLDER), m_clipId(clipId), m_clip(NULL), m_groupname(strings.at(1))
+ProjectItem::ProjectItem(QTreeWidget * parent, const QStringList & strings, const QString &clipId) :
+        QTreeWidgetItem(parent, strings),
+        m_groupname(strings.at(1)),
+        m_clipType(FOLDER),
+        m_clipId(clipId),
+        m_clip(NULL)
 {
     setSizeHint(0, QSize(65, 45));
     setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -44,8 +44,8 @@ ProjectItem::ProjectItem(QTreeWidget * parent, const QStringList & strings, cons
     //kDebug() << "Constructed as folder, with clipId: " << m_clipId << ", and groupname: " << m_groupname;
 }
 
-ProjectItem::ProjectItem(QTreeWidget * parent, DocClipBase *clip)
-        QTreeWidgetItem(parent)
+ProjectItem::ProjectItem(QTreeWidget * parent, DocClipBase *clip) :
+        QTreeWidgetItem(parent)
 {
     setSizeHint(0, QSize(65, 45));
     setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -64,8 +64,8 @@ ProjectItem::ProjectItem(QTreeWidget * parent, DocClipBase *clip)
     //kDebug() << "Constructed with clipId: " << m_clipId;
 }
 
-ProjectItem::ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip)
-        QTreeWidgetItem(parent)
+ProjectItem::ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip) :
+        QTreeWidgetItem(parent)
 {
     setSizeHint(0, QSize(65, 45));
     setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
@@ -200,10 +200,11 @@ void ProjectItem::slotSetToolTip()
         tip.append(i18n("Image clip") + "</b><br />" + clipUrl().path());
         break;
     case TEXT:
-        tip.append(i18n("Text clip") + "</b><br />" + clipUrl().path());
+        if (!clipUrl().isEmpty() && m_clip->getProperty("xmldata").isEmpty()) tip.append(i18n("Template text clip") + "</b><br />" + clipUrl().path());
+        else tip.append(i18n("Text clip") + "</b><br />" + clipUrl().path());
         break;
     case SLIDESHOW:
-        tip.append(i18n("Slideshow clip"));
+        tip.append(i18n("Slideshow clip") + "</b><br />" + clipUrl().directory());
         break;
     case VIRTUAL:
         tip.append(i18n("Virtual clip"));
@@ -228,7 +229,6 @@ void ProjectItem::setProperties(const QMap < QString, QString > &attributes, con
         GenTime duration = GenTime(attributes.value("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());
     } else  {
         // No duration known, use an arbitrary one until it is.
     }