From: Marco Gittler Date: Sat, 14 Nov 2009 10:49:42 +0000 (+0000) Subject: make nepomuk optional X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=bc7ddabf7f161edf3136c8cc2204f000d85d06a4;p=kdenlive make nepomuk optional svn path=/trunk/kdenlive/; revision=4124 --- diff --git a/renderer/CMakeLists.txt b/renderer/CMakeLists.txt index c7e4a738..c6513b28 100644 --- a/renderer/CMakeLists.txt +++ b/renderer/CMakeLists.txt @@ -10,7 +10,7 @@ include_directories ( LINK_LIBRARIES( ${LIBMLT_LIBRARY} ${LIBMLTPLUS_LIBRARY} -${NEPOMUK_LIBRARIES} +${optional_libs} ) set(kdenlive_render_SRCS diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 24376e7e..5de3d67d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,14 @@ 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} ) diff --git a/src/projectlist.cpp b/src/projectlist.cpp index 2382119d..9a2d514b 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -46,10 +46,11 @@ #include #include #include - +#ifdef NEPOMUK #include #include //#include +#endif #include #include @@ -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 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 cuts = clip->cutZones(); if (!cuts.isEmpty()) { diff --git a/src/projectlist.h b/src/projectlist.h index 356aa5dd..f24ab481 100644 --- a/src/projectlist.h +++ b/src/projectlist.h @@ -33,9 +33,10 @@ #include #include +#ifdef NEPOMUK #include #include - +#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); }