Commit bc7ddabf authored by Marco Gittler's avatar Marco Gittler

make nepomuk optional

svn path=/trunk/kdenlive/; revision=4124
parent 0f77771d
......@@ -10,7 +10,7 @@ include_directories (
LINK_LIBRARIES(
${LIBMLT_LIBRARY}
${LIBMLTPLUS_LIBRARY}
${NEPOMUK_LIBRARIES}
${optional_libs}
)
set(kdenlive_render_SRCS
......
add_subdirectory( widgets )
add_subdirectory( mimetypes )
find_package(Nepomuk REQUIRED)
find_package(Nepomuk)
if (Nepomuk_FOUND)
INCLUDE_DIRECTORIES(NEPOMUK_INCLUDES )
set( optional_libs NEPOMUK_LIBRARIES )
add_definitions(-DNEPOMUK)
endif (Nepomuk_FOUND)
if (APPLE)
find_package(OpenGL)
......@@ -19,16 +26,16 @@ include_directories (
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}/src/widgets
${NEPOMUK_INCLUDES}
)
LINK_LIBRARIES(
${LIBMLT_LIBRARY}
${LIBMLTPLUS_LIBRARY}
${NEPOMUK_LIBRARIES}
${optional_libs}
)
kde4_add_ui_files(kdenlive_UI
widgets/timeline_ui.ui
widgets/monitor_ui.ui
......@@ -201,7 +208,7 @@ target_link_libraries(kdenlive
${KDE4_KNEWSTUFF2_LIBS}
${LIBMLTPLUS_LIBRARY}
${LIBMLT_LIBRARY}
${NEPOMUK_LIBRARIES}
${optional_libs}
${KDE4_KNOTIFYCONFIG_LIBRARY}
${KDE4_KROSSUI_LIBS}
)
......
......@@ -46,10 +46,11 @@
#include <KMessageBox>
#include <KIO/NetAccess>
#include <KFileItem>
#ifdef NEPOMUK
#include <nepomuk/global.h>
#include <nepomuk/resourcemanager.h>
//#include <nepomuk/tag.h>
#endif
#include <QMouseEvent>
#include <QStylePainter>
......@@ -113,7 +114,7 @@ ProjectList::ProjectList(QWidget *parent) :
m_listViewDelegate = new ItemDelegate(m_listView);
m_listView->setItemDelegate(m_listViewDelegate);
#ifdef NEPOMUK
if (KdenliveSettings::activate_nepomuk()) {
Nepomuk::ResourceManager::instance()->init();
if (!Nepomuk::ResourceManager::instance()->initialized()) {
......@@ -121,6 +122,7 @@ ProjectList::ProjectList(QWidget *parent) :
KdenliveSettings::setActivate_nepomuk(false);
}
}
#endif
}
ProjectList::~ProjectList()
......@@ -397,11 +399,13 @@ void ProjectList::slotUpdateClipProperties(ProjectItem *clip, QMap <QString, QSt
m_listView->blockSignals(true);
clip->setText(1, properties.value("description"));
m_listView->blockSignals(false);
#ifdef NEPOMUK
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());
f.setDescription(properties.value("description"));
}
#endif
emit projectModified();
}
}
......@@ -657,7 +661,7 @@ void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
item->setIcon(0, QPixmap(cachedPixmap));
}
}
#ifdef NEPOMUK
if (!url.isEmpty() && KdenliveSettings::activate_nepomuk()) {
// if file has Nepomuk comment, use it
Nepomuk::Resource f(url.path());
......@@ -665,7 +669,7 @@ void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties)
if (!annotation.isEmpty()) item->setText(1, annotation);
item->setText(2, QString::number(f.rating()));
}
#endif
// Add cut zones
QList <QPoint> cuts = clip->cutZones();
if (!cuts.isEmpty()) {
......
......@@ -33,9 +33,10 @@
#include <KTreeWidgetSearchLine>
#include <KUrl>
#ifdef NEPOMUK
#include <nepomuk/kratingpainter.h>
#include <nepomuk/resource.h>
#endif
#include "definitions.h"
#include "timecode.h"
#include "kdenlivesettings.h"
......@@ -107,7 +108,9 @@ public:
if (option.state & (QStyle::State_Selected)) {
painter->fillRect(r1, option.palette.highlight());
}
#ifdef NEPOMUK
KRatingPainter::paintRating(painter, r1, Qt::AlignCenter, index.data().toInt());
#endif
} else {
QItemDelegate::paint(painter, option, index);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment