#include <KMessageBox>
#include <nepomuk/global.h>
-#include <nepomuk/resource.h>
-#include <nepomuk/tag.h>
+#include <nepomuk/resourcemanager.h>
+//#include <nepomuk/tag.h>
#include "projectlist.h"
#include "projectitem.h"
listView = new ProjectListView(this);;
QVBoxLayout *layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
- m_clipIdCounter = 0;
+ // mbd: I think this has died at some point: m_clipIdCounter = 0;
// setup toolbar
searchView = new KTreeWidgetSearchLine(this);
m_toolbar = new QToolBar("projectToolBar", this);
ItemDelegate *listViewDelegate = new ItemDelegate(listView);
listView->setItemDelegate(listViewDelegate);
+
+ if (KdenliveSettings::activate_nepomuk()) {
+ Nepomuk::ResourceManager::instance()->init();
+ if (!Nepomuk::ResourceManager::instance()->initialized()) {
+ kDebug() << "Cannot communicate with Nepomuk, DISABLING it";
+ KdenliveSettings::setActivate_nepomuk(false);
+ }
+ }
}
ProjectList::~ProjectList() {
void ProjectList::setRenderer(Render *projectRender) {
m_render = projectRender;
+ listView->setIconSize(QSize(40 * m_render->dar(), 40));
}
void ProjectList::slotClipSelected() {
if (KdenliveSettings::activate_nepomuk() && (type == AUDIO || type == VIDEO || type == AV || type == IMAGE || type == PLAYLIST)) {
// Use Nepomuk system to store clip description
Nepomuk::Resource f(clip->clipUrl().path());
- if (f.isValid()) {
- f.setDescription(properties.value("description"));
- } else {
- KMessageBox::sorry(this, i18n("Cannot access Desktop Search info for %1.\nDisabling Desktop Search integration.", clip->clipUrl().path()));
- KdenliveSettings::setActivate_nepomuk(false);
- }
+ f.setDescription(properties.value("description"));
}
emit projectModified();
}
if (getProperties) listView->setEnabled(false);
listView->blockSignals(true);
const QString parent = clip->getProperty("groupid");
- //kDebug() << "Adding clip with groupid: " << parent;
+ kDebug() << "Adding clip with groupid: " << parent;
ProjectItem *item = NULL;
if (!parent.isEmpty()) {
ProjectItem *parentitem = getFolderItemById(parent);
if (!url.isEmpty() && KdenliveSettings::activate_nepomuk()) {
// if file has Nepomuk comment, use it
Nepomuk::Resource f(url.path());
- QString annotation;
- if (f.isValid()) {
- annotation = f.description();
- /*
- Nepomuk::Tag tag("test");
- f.addTag(tag);*/
- } else {
- KMessageBox::sorry(this, i18n("Cannot access Desktop Search info for %1.\nDisabling Desktop Search integration.", url.path()));
- KdenliveSettings::setActivate_nepomuk(false);
- }
+ QString annotation = f.description();
if (!annotation.isEmpty()) item->setText(2, annotation);
}
listView->blockSignals(false);
}
+void ProjectList::slotResetProjectList() {
+ listView->clear();
+ emit clipSelected(NULL);
+ m_thumbnailQueue.clear();
+ m_infoQueue.clear();
+ m_refreshed = false;
+}
+
void ProjectList::requestClipInfo(const QDomElement xml, const QString id) {
kDebug() << " PRG LISTÂ REQUEST CLP INFO: " << id;
m_infoQueue.insert(id, xml);
m_doc->deleteProjectClip(ids);
}
if (!m_infoQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));
+ else listView->setEnabled(true);
}
void ProjectList::slotAddColorClip() {
void ProjectList::setDocument(KdenliveDoc *doc) {
listView->blockSignals(true);
listView->clear();
+ emit clipSelected(NULL);
m_thumbnailQueue.clear();
m_infoQueue.clear();
m_refreshed = false;
if (item && producer) {
listView->blockSignals(true);
item->setProperties(properties, metadata);
+ Q_ASSERT_X(item->referencedClip(), "void ProjectList::slotReplyGetFileProperties", QString("Item with groupName %1 does not have a clip associated").arg(item->groupName()).toLatin1());
item->referencedClip()->setProducer(producer);
emit receivedClipDuration(clipId, item->clipMaxDuration());
listView->blockSignals(false);
else listView->setEnabled(true);
}
-void ProjectList::slotReplyGetImage(const QString &clipId, int pos, const QPixmap &pix, int w, int h) {
+void ProjectList::slotReplyGetImage(const QString &clipId, const QPixmap &pix) {
ProjectItem *item = getItemById(clipId);
if (item) {
listView->blockSignals(true);