- m_clipType = (CLIPTYPE) m_clip->getProperty("type").toInt();
- setText(1, name);
- setText(2, m_clip->description());
- //kDebug() << "PROJECT ITE;. ADDING LCIP: " << m_clipId;
-}
-
-ProjectItem::ProjectItem(QTreeWidgetItem * parent, DocClipBase *clip)
- : QTreeWidgetItem(parent) {
- setSizeHint(0, QSize(65, 45));
- setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable);
- m_clip = clip;
- m_clipId = clip->getId();
- QString name = m_clip->getProperty("name");
- if (name.isEmpty()) name = KUrl(m_clip->getProperty("resource")).fileName();
- m_clipType = (CLIPTYPE) m_clip->getProperty("type").toInt();
- setText(1, name);
- setText(2, m_clip->description());
- //kDebug() << "PROJECT ITE;. ADDING LCIP: " << m_clipId;
+ m_clipType = (ClipType) m_clip->getProperty("type").toInt();
+ switch(m_clipType) {
+ case Audio:
+ setData(0, Qt::DecorationRole, KIcon("audio-x-generic").pixmap(pixmapSize));
+ m_pixmapSet = true;
+ break;
+ case Image:
+ case SlideShow:
+ setData(0, Qt::DecorationRole, KIcon("image-x-generic").pixmap(pixmapSize));
+ break;
+ default:
+ setData(0, Qt::DecorationRole, KIcon("video-x-generic").pixmap(pixmapSize));
+ }
+ if (m_clipType != Unknown) slotSetToolTip();
+
+ setText(0, name);
+ setText(1, m_clip->description());
+ GenTime duration = m_clip->duration();
+ QString durationText;
+ if (duration != GenTime()) {
+ durationText = Timecode::getEasyTimecode(duration, KdenliveSettings::project_fps());
+ }
+ if (m_clipType == Playlist) {
+ // Check if the playlist xml contains a proxy inside, and inform user
+ if (playlistHasProxies(m_clip->fileURL().path())) {
+ durationText.prepend(i18n("Contains proxies") + " / ");
+ }
+ }
+ if (!durationText.isEmpty()) setData(0, DurationRole, durationText);