1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
21 #include <QMouseEvent>
22 #include <QStylePainter>
31 #include <KFileDialog>
32 #include <KInputDialog>
33 #include <KMessageBox>
35 #include <nepomuk/global.h>
36 #include <nepomuk/resource.h>
37 #include <nepomuk/tag.h>
39 #include "projectlist.h"
40 #include "projectitem.h"
41 #include "kdenlivesettings.h"
42 #include "slideshowclip.h"
43 #include "ui_colorclip_ui.h"
44 #include "titlewidget.h"
47 #include "definitions.h"
48 #include "clipmanager.h"
49 #include "docclipbase.h"
50 #include "kdenlivedoc.h"
53 #include "projectlistview.h"
55 ProjectList::ProjectList(QWidget *parent)
56 : QWidget(parent), m_render(NULL), m_fps(-1), m_commandStack(NULL), m_selectedItem(NULL), m_infoQueue(QMap <QString, QDomElement> ()), m_thumbnailQueue(QList <QString> ()), m_refreshed(false) {
58 QWidget *vbox = new QWidget;
59 listView = new ProjectListView(this);;
60 QVBoxLayout *layout = new QVBoxLayout;
61 layout->setContentsMargins(0, 0, 0, 0);
64 searchView = new KTreeWidgetSearchLine(this);
65 m_toolbar = new QToolBar("projectToolBar", this);
66 m_toolbar->addWidget(searchView);
68 QToolButton *addButton = new QToolButton(m_toolbar);
69 QMenu *addMenu = new QMenu(this);
70 addButton->setMenu(addMenu);
71 addButton->setPopupMode(QToolButton::MenuButtonPopup);
72 m_toolbar->addWidget(addButton);
74 QAction *addClipButton = addMenu->addAction(KIcon("kdenlive-add-clip"), i18n("Add Clip"));
75 connect(addClipButton, SIGNAL(triggered()), this, SLOT(slotAddClip()));
77 QAction *addColorClip = addMenu->addAction(KIcon("kdenlive-add-color-clip"), i18n("Add Color Clip"));
78 connect(addColorClip, SIGNAL(triggered()), this, SLOT(slotAddColorClip()));
80 QAction *addSlideClip = addMenu->addAction(KIcon("kdenlive-add-slide-clip"), i18n("Add Slideshow Clip"));
81 connect(addSlideClip, SIGNAL(triggered()), this, SLOT(slotAddSlideshowClip()));
83 QAction *addTitleClip = addMenu->addAction(KIcon("kdenlive-add-text-clip"), i18n("Add Title Clip"));
84 connect(addTitleClip, SIGNAL(triggered()), this, SLOT(slotAddTitleClip()));
86 m_deleteAction = m_toolbar->addAction(KIcon("edit-delete"), i18n("Delete Clip"));
87 connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(slotRemoveClip()));
89 m_editAction = m_toolbar->addAction(KIcon("document-properties"), i18n("Edit Clip"));
90 connect(m_editAction, SIGNAL(triggered()), this, SLOT(slotEditClip()));
92 QAction *addFolderButton = addMenu->addAction(KIcon("folder-new"), i18n("Create Folder"));
93 connect(addFolderButton, SIGNAL(triggered()), this, SLOT(slotAddFolder()));
95 addButton->setDefaultAction(addClipButton);
97 layout->addWidget(m_toolbar);
98 layout->addWidget(listView);
100 //m_toolbar->setEnabled(false);
102 searchView->setTreeWidget(listView);
104 m_menu = new QMenu();
105 m_menu->addAction(addClipButton);
106 m_menu->addAction(addColorClip);
107 m_menu->addAction(addSlideClip);
108 m_menu->addAction(addTitleClip);
109 m_menu->addAction(m_editAction);
110 m_menu->addAction(m_deleteAction);
111 m_menu->addAction(addFolderButton);
112 m_menu->insertSeparator(m_deleteAction);
114 connect(listView, SIGNAL(itemSelectionChanged()), this, SLOT(slotClipSelected()));
115 connect(listView, SIGNAL(focusMonitor()), this, SLOT(slotClipSelected()));
116 connect(listView, SIGNAL(pauseMonitor()), this, SLOT(slotPauseMonitor()));
117 connect(listView, SIGNAL(requestMenu(const QPoint &, QTreeWidgetItem *)), this, SLOT(slotContextMenu(const QPoint &, QTreeWidgetItem *)));
118 connect(listView, SIGNAL(addClip()), this, SLOT(slotAddClip()));
119 connect(listView, SIGNAL(addClip(QUrl, const QString &)), this, SLOT(slotAddClip(QUrl, const QString &)));
120 connect(listView, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotItemEdited(QTreeWidgetItem *, int)));
121 connect(listView, SIGNAL(showProperties(DocClipBase *)), this, SIGNAL(showClipProperties(DocClipBase *)));
123 ItemDelegate *listViewDelegate = new ItemDelegate(listView);
124 listView->setItemDelegate(listViewDelegate);
127 ProjectList::~ProjectList() {
132 QByteArray ProjectList::headerInfo() {
133 return listView->header()->saveState();
136 void ProjectList::setHeaderInfo(const QByteArray &state) {
137 listView->header()->restoreState(state);
140 void ProjectList::slotEditClip() {
141 ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
142 if (item && !item->isGroup()) {
143 emit clipSelected(item->referencedClip());
144 emit showClipProperties(item->referencedClip());
150 void ProjectList::setRenderer(Render *projectRender) {
151 m_render = projectRender;
154 void ProjectList::slotClipSelected() {
155 if (listView->currentItem()) {
156 ProjectItem *clip = static_cast <ProjectItem*>(listView->currentItem());
157 if (!clip->isGroup()) {
158 m_selectedItem = clip;
159 emit clipSelected(clip->referencedClip());
161 m_editAction->setEnabled(true);
162 m_deleteAction->setEnabled(true);
164 m_editAction->setEnabled(false);
165 m_deleteAction->setEnabled(false);
169 void ProjectList::slotPauseMonitor() {
170 if (m_render) m_render->pause();
173 void ProjectList::slotUpdateClipProperties(const QString &id, QMap <QString, QString> properties) {
174 ProjectItem *item = getItemById(id);
176 slotUpdateClipProperties(item, properties);
177 if (properties.contains("colour") || properties.contains("resource") || properties.contains("xmldata")) slotRefreshClipThumbnail(item);
178 if (properties.contains("out")) item->changeDuration(properties.value("out").toInt());
182 void ProjectList::slotUpdateClipProperties(ProjectItem *clip, QMap <QString, QString> properties) {
184 if (!clip->isGroup()) clip->setProperties(properties);
185 if (properties.contains("description")) {
186 CLIPTYPE type = clip->clipType();
187 clip->setText(2, properties.value("description"));
188 if (KdenliveSettings::activate_nepomuk() && (type == AUDIO || type == VIDEO || type == AV || type == IMAGE || type == PLAYLIST)) {
189 // Use Nepomuk system to store clip description
190 Nepomuk::Resource f(clip->clipUrl().path());
192 f.setDescription(properties.value("description"));
194 KMessageBox::sorry(this, i18n("Cannot access Desktop Search info for %1.\nDisabling Desktop Search integration.", clip->clipUrl().path()));
195 KdenliveSettings::setActivate_nepomuk(false);
198 emit projectModified();
202 void ProjectList::slotItemEdited(QTreeWidgetItem *item, int column) {
203 ProjectItem *clip = static_cast <ProjectItem*>(item);
205 QMap <QString, QString> props;
206 props["description"] = item->text(2);
207 slotUpdateClipProperties(clip, props);
208 } else if (column == 1 && clip->isGroup()) {
209 m_doc->slotEditFolder(item->text(1), clip->groupName(), clip->clipId());
210 clip->setGroupName(item->text(1));
211 const int children = item->childCount();
212 for (int i = 0; i < children; i++) {
213 ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
214 child->setProperty("groupname", item->text(1));
219 void ProjectList::slotContextMenu(const QPoint &pos, QTreeWidgetItem *item) {
224 m_editAction->setEnabled(enable);
225 m_deleteAction->setEnabled(enable);
229 void ProjectList::slotRemoveClip() {
230 if (!listView->currentItem()) return;
232 QMap <QString, QString> folderids;
233 QList<QTreeWidgetItem *> selected = listView->selectedItems();
235 for (int i = 0; i < selected.count(); i++) {
236 item = static_cast <ProjectItem *>(selected.at(i));
237 if (item->isGroup()) folderids[item->groupName()] = item->clipId();
238 else ids << item->clipId();
239 if (item->numReferences() > 0) {
240 if (KMessageBox::questionYesNo(this, i18np("Delete clip <b>%2</b> ?<br>This will also remove the clip in timeline", "Delete clip <b>%2</b> ?<br>This will also remove its %1 clips in timeline", item->numReferences(), item->names().at(1)), i18n("Delete Clip")) != KMessageBox::Yes) return;
241 } else if (item->isGroup() && item->childCount() > 0) {
242 int children = item->childCount();
243 if (KMessageBox::questionYesNo(this, i18n("Delete folder <b>%2</b> ?<br>This will also remove the %1 clips in that folder", children, item->names().at(1)), i18n("Delete Folder")) != KMessageBox::Yes) return;
244 for (int i = 0; i < children; ++i) {
245 ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
246 ids << child->clipId();
250 if (!ids.isEmpty()) m_doc->deleteProjectClip(ids);
251 if (!folderids.isEmpty()) m_doc->deleteProjectFolder(folderids);
252 if (listView->topLevelItemCount() == 0) {
253 m_editAction->setEnabled(false);
254 m_deleteAction->setEnabled(false);
258 void ProjectList::selectItemById(const QString &clipId) {
259 ProjectItem *item = getItemById(clipId);
260 if (item) listView->setCurrentItem(item);
264 void ProjectList::slotDeleteClip(const QString &clipId) {
265 ProjectItem *item = getItemById(clipId);
266 QTreeWidgetItem *p = item->parent();
268 kDebug() << "/////// DELETED CLIP HAS A PARENT... " << p->indexOfChild(item);
269 QTreeWidgetItem *clone = p->takeChild(p->indexOfChild(item));
275 void ProjectList::slotAddFolder() {
277 // QString folderName = KInputDialog::getText(i18n("New Folder"), i18n("Enter new folder name: "));
278 // if (folderName.isEmpty()) return;
279 m_doc->slotAddFolder(i18n("Folder")); //folderName);
282 void ProjectList::slotAddFolder(const QString foldername, const QString &clipId, bool remove, bool edit) {
285 QTreeWidgetItemIterator it(listView);
287 item = static_cast <ProjectItem *>(*it);
288 if (item->isGroup() && item->clipId() == clipId) {
296 listView->blockSignals(true);
298 QTreeWidgetItemIterator it(listView);
300 item = static_cast <ProjectItem *>(*it);
301 if (item->isGroup() && item->clipId() == clipId) {
302 item->setGroupName(foldername);
303 const int children = item->childCount();
304 for (int i = 0; i < children; i++) {
305 ProjectItem *child = static_cast <ProjectItem *>(item->child(i));
306 child->setProperty("groupname", foldername);
312 listView->blockSignals(false);
315 text << QString() << foldername;
316 (void) new ProjectItem(listView, text, clipId);
321 void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties) {
322 const QString parent = clip->getProperty("groupid");
323 //kDebug() << "Adding clip with groupid: " << parent;
324 ProjectItem *item = NULL;
325 if (!parent.isEmpty()) {
326 ProjectItem *parentitem = getItemById(parent);
329 QString groupName = clip->getProperty("groupname");
330 //kDebug() << "Adding clip to new group: " << groupName;
331 if (groupName.isEmpty()) groupName = i18n("Folder");
332 text << QString() << groupName;
333 listView->blockSignals(true);
334 parentitem = new ProjectItem(listView, text, parent);
335 listView->blockSignals(false);
337 //kDebug() << "Adding clip to existing group: " << parentitem->groupName();
339 if (parentitem) item = new ProjectItem(parentitem, clip);
341 if (item == NULL) item = new ProjectItem(listView, clip);
343 KUrl url = clip->fileURL();
344 if (!url.isEmpty() && KdenliveSettings::activate_nepomuk()) {
345 // if file has Nepomuk comment, use it
346 Nepomuk::Resource f(url.path());
349 annotation = f.description();
351 Nepomuk::Tag tag("test");
354 KMessageBox::sorry(this, i18n("Cannot access Desktop Search info for %1.\nDisabling Desktop Search integration.", url.path()));
355 KdenliveSettings::setActivate_nepomuk(false);
357 if (!annotation.isEmpty()) item->setText(2, annotation);
359 if (getProperties) requestClipInfo(clip->toXML(), clip->getId());
362 void ProjectList::requestClipInfo(const QDomElement xml, const QString id) {
363 kDebug() << " PRG LISTĀ REQUEST CLP INFO: " << id;
364 m_infoQueue.insert(id, xml);
365 listView->setEnabled(false);
366 if (m_infoQueue.count() == 1) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
369 void ProjectList::slotProcessNextClipInQueue() {
370 if (m_infoQueue.isEmpty()) {
371 listView->setEnabled(true);
374 QMap<QString, QDomElement>::const_iterator i = m_infoQueue.constBegin();
375 if (i != m_infoQueue.constEnd()) {
376 const QDomElement dom = i.value();
377 const QString id = i.key();
378 m_infoQueue.remove(i.key());
379 emit getFileProperties(dom, id);
381 if (m_infoQueue.isEmpty()) listView->setEnabled(true);
384 void ProjectList::slotUpdateClip(const QString &id) {
385 ProjectItem *item = getItemById(id);
386 item->setData(1, UsageRole, QString::number(item->numReferences()));
389 void ProjectList::updateAllClips() {
390 QTreeWidgetItemIterator it(listView);
392 ProjectItem *item = static_cast <ProjectItem *>(*it);
393 if (!item->isGroup()) {
394 if (item->referencedClip()->producer() == NULL) {
395 DocClipBase *clip = item->referencedClip();
396 if (clip->clipType() == TEXT && !QFile::exists(clip->fileURL().path())) {
397 // regenerate text clip image if required
398 TitleWidget *dia_ui = new TitleWidget(KUrl(), QString(), m_render, this);
400 doc.setContent(clip->getProperty("xmldata"));
402 QPixmap pix = dia_ui->renderedPixmap();
403 pix.save(clip->fileURL().path());
406 requestClipInfo(clip->toXML(), clip->getId());
408 QString cachedPixmap = m_doc->projectFolder().path() + "/thumbs/" + item->getClipHash() + ".png";
409 if (QFile::exists(cachedPixmap)) {
410 //kDebug()<<"// USING CACHED PIX: "<<cachedPixmap;
411 item->setIcon(0, QPixmap(cachedPixmap));
412 } else requestClipThumbnail(item->clipId());
413 item->changeDuration(item->referencedClip()->producer()->get_playtime());
415 item->setData(1, UsageRole, QString::number(item->numReferences()));
416 qApp->processEvents();
420 QTimer::singleShot(500, this, SLOT(slotCheckForEmptyQueue()));
423 void ProjectList::slotAddClip(QUrl givenUrl, QString group) {
424 if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
426 if (givenUrl.isEmpty()) {
427 list = KFileDialog::getOpenUrls(KUrl("kfiledialog:///clipfolder"), "application/x-kdenlive video/x-flv 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);
428 } else list.append(givenUrl);
429 if (list.isEmpty()) return;
431 QString groupId = QString();
432 if (group.isEmpty()) {
433 ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
434 if (item && !item->isGroup()) {
435 while (item->parent()) {
436 item = static_cast <ProjectItem*>(item->parent());
437 if (item->isGroup()) break;
440 if (item && item->isGroup()) {
441 group = item->groupName();
442 groupId = item->clipId();
445 m_doc->slotAddClipList(list, group, groupId);
448 void ProjectList::slotRemoveInvalidClip(const QString &id) {
449 ProjectItem *item = getItemById(id);
451 const QString path = item->referencedClip()->fileURL().path();
452 if (!path.isEmpty()) KMessageBox::sorry(this, i18n("Clip <b>%1</b><br>is invalid, will be removed from project.", path));
455 m_doc->deleteProjectClip(ids);
457 if (!m_infoQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
460 void ProjectList::slotAddColorClip() {
461 if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
462 QDialog *dia = new QDialog(this);
463 Ui::ColorClip_UI *dia_ui = new Ui::ColorClip_UI();
464 dia_ui->setupUi(dia);
465 dia_ui->clip_name->setText(i18n("Color Clip"));
466 dia_ui->clip_duration->setText(KdenliveSettings::color_duration());
467 if (dia->exec() == QDialog::Accepted) {
468 QString color = dia_ui->clip_color->color().name();
469 color = color.replace(0, 1, "0x") + "ff";
471 QString group = QString();
472 QString groupId = QString();
473 ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
474 if (item && !item->isGroup()) {
475 while (item->parent()) {
476 item = static_cast <ProjectItem*>(item->parent());
477 if (item->isGroup()) break;
480 if (item && item->isGroup()) {
481 group = item->groupName();
482 groupId = item->clipId();
485 m_doc->slotAddColorClipFile(dia_ui->clip_name->text(), color, dia_ui->clip_duration->text(), group, groupId);
492 void ProjectList::slotAddSlideshowClip() {
493 if (!m_commandStack) kDebug() << "!!!!!!!!!!!!!!!! NO CMD STK";
494 SlideshowClip *dia = new SlideshowClip(this);
496 if (dia->exec() == QDialog::Accepted) {
498 QString group = QString();
499 QString groupId = QString();
500 ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
501 if (item && !item->isGroup()) {
502 while (item->parent()) {
503 item = static_cast <ProjectItem*>(item->parent());
504 if (item->isGroup()) break;
507 if (item && item->isGroup()) {
508 group = item->groupName();
509 groupId = item->clipId();
512 m_doc->slotAddSlideshowClipFile(dia->clipName(), dia->selectedPath(), dia->imageCount(), dia->clipDuration(), dia->loop(), dia->fade(), dia->lumaDuration(), dia->lumaFile(), dia->softness(), group, groupId);
517 void ProjectList::slotAddTitleClip() {
518 QString group = QString();
519 QString groupId = QString();
520 ProjectItem *item = static_cast <ProjectItem*>(listView->currentItem());
521 if (item && !item->isGroup()) {
522 while (item->parent()) {
523 item = static_cast <ProjectItem*>(item->parent());
524 if (item->isGroup()) break;
527 if (item && item->isGroup()) {
528 group = item->groupName();
529 groupId = item->clipId();
532 m_doc->slotCreateTextClip(group, groupId);
535 void ProjectList::setDocument(KdenliveDoc *doc) {
536 listView->blockSignals(true);
538 m_thumbnailQueue.clear();
541 QList <DocClipBase*> list = doc->clipManager()->documentClipList();
542 for (int i = 0; i < list.count(); i++) {
543 slotAddClip(list.at(i), false);
547 m_timecode = doc->timecode();
548 m_commandStack = doc->commandStack();
550 QTreeWidgetItem *first = listView->topLevelItem(0);
551 if (first) listView->setCurrentItem(first);
552 listView->blockSignals(false);
553 m_toolbar->setEnabled(true);
556 QDomElement ProjectList::producersList() {
558 QDomElement prods = doc.createElement("producerlist");
559 doc.appendChild(prods);
560 kDebug() << "//////////// PRO LISTĀ BUILD PRDSLIST ";
561 QTreeWidgetItemIterator it(listView);
563 if (!((ProjectItem *)(*it))->isGroup())
564 prods.appendChild(doc.importNode(((ProjectItem *)(*it))->toXml(), true));
570 void ProjectList::slotCheckForEmptyQueue() {
571 if (!m_refreshed && m_thumbnailQueue.isEmpty() && m_infoQueue.isEmpty()) {
573 emit loadingIsOver();
574 } else QTimer::singleShot(500, this, SLOT(slotCheckForEmptyQueue()));
577 void ProjectList::requestClipThumbnail(const QString &id) {
578 m_thumbnailQueue.append(id);
579 if (m_thumbnailQueue.count() == 1) QTimer::singleShot(300, this, SLOT(slotProcessNextThumbnail()));
582 void ProjectList::slotProcessNextThumbnail() {
583 if (m_thumbnailQueue.isEmpty()) {
586 slotRefreshClipThumbnail(m_thumbnailQueue.takeFirst(), false);
589 void ProjectList::slotRefreshClipThumbnail(const QString &clipId, bool update) {
590 ProjectItem *item = getItemById(clipId);
591 if (item) slotRefreshClipThumbnail(item, update);
592 else slotProcessNextThumbnail();
595 void ProjectList::slotRefreshClipThumbnail(ProjectItem *item, bool update) {
597 if (!item->referencedClip()) return;
599 int width = (int)(height * m_render->dar());
600 DocClipBase *clip = item->referencedClip();
601 if (!clip) slotProcessNextThumbnail();
603 if (clip->clipType() == AUDIO) pix = KIcon("audio-x-generic").pixmap(QSize(width, height));
604 else pix = item->referencedClip()->thumbProducer()->extractImage(item->referencedClip()->getClipThumbFrame(), width, height);
605 item->setIcon(0, pix);
606 m_doc->cachePixmap(item->getClipHash(), pix);
607 if (update) emit projectModified();
608 if (!m_thumbnailQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextThumbnail()));
612 void ProjectList::slotReplyGetFileProperties(const QString &clipId, Mlt::Producer *producer, const QMap < QString, QString > &properties, const QMap < QString, QString > &metadata) {
613 ProjectItem *item = getItemById(clipId);
614 if (item && producer) {
615 item->setProperties(properties, metadata);
616 item->referencedClip()->setProducer(producer);
617 emit receivedClipDuration(clipId, item->clipMaxDuration());
618 } else kDebug() << "//////// COULD NOT FIND CLIP TO UPDATE PRPS...";
619 if (!m_infoQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
622 void ProjectList::slotReplyGetImage(const QString &clipId, int pos, const QPixmap &pix, int w, int h) {
623 ProjectItem *item = getItemById(clipId);
625 item->setIcon(0, pix);
626 m_doc->cachePixmap(item->getClipHash(), pix);
630 ProjectItem *ProjectList::getItemById(const QString &id) {
631 QTreeWidgetItemIterator it(listView);
633 if (((ProjectItem *)(*it))->clipId() == id)
634 return static_cast<ProjectItem *>(*it);
638 #ifdef USED_TO_BE_THIS
640 if (((ProjectItem *)(*it))->clipId() == id)
644 if (*it) return ((ProjectItem *)(*it));
649 void ProjectList::slotSelectClip(const QString &ix) {
650 ProjectItem *p = getItemById(ix);
652 listView->setCurrentItem(p);
653 listView->scrollToItem(p);
654 m_editAction->setEnabled(true);
655 m_deleteAction->setEnabled(true);
659 #include "projectlist.moc"