macro_optional_find_package(OpenGL)
macro_log_feature(OPENGL_FOUND "OpenGL" "API for developing portable, interactive 2D and 3D graphics applications" "http://mesa3d.sourceforge.net" FALSE "" "STRONGLY RECOMMENDED: The 3D hardware acceleration available through the OpenGL API is used in applications ranging from graphics and modellers to screensavers and video players.")
-macro_optional_find_package(Nepomuk)
-macro_log_feature(NEPOMUK_FOUND "Nepomuk" "Handles all kinds of metadata on the KDE desktop to provide a semantic desktop" "http://nepomuk.kde.org/" FALSE "" "STRONGLY_RECOMMENDED: Nepomuk is used to provide metadata on objects like files, emails etc. to provide a semantic desktop.")
-macro_bool_to_01(NEPOMUK_FOUND HAVE_NEPOMUK)
-
-
macro_optional_find_package(QJSON)
macro_log_feature(QJSON_FOUND "QJSon" "Used for various Internet runners, for parsing API responses, and the microblog dataengine" "" FALSE "" "")
macro_optional_find_package(DBusMenuQt)
macro_log_feature(DBUSMENUQT_FOUND "DBusMenuQt" "DBusMenu Qt" "https://launchpad.net/libdbusmenu-qt/" FALSE "" "Needed for Unity support in IconTasks.")
-if (NEPOMUK_FOUND)
- include_directories( ${SOPRANO_INCLUDE_DIR} ${NEPOMUK_INCLUDE_DIR} )
-endif (NEPOMUK_FOUND)
-
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
include_directories (${KDE4_INCLUDES}
project(plasma-comic)
-if(HAVE_NEPOMUK)
- add_definitions(-DHAVE_NEPOMUK)
- add_definitions(-DDISABLE_NEPOMUK_LEGACY)
-endif(HAVE_NEPOMUK)
-
set(comic_SRCS
comic.cpp
comicmodel.cpp
kde4_add_plugin(plasma_applet_comic ${comic_SRCS})
target_link_libraries(plasma_applet_comic ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${KDE4_SOLID_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KNEWSTUFF3_LIBS} ${QT_QTDECLARATIVE_LIBRARY})
-if(HAVE_NEPOMUK)
- target_link_libraries(plasma_applet_comic ${NEPOMUK_LIBRARIES} ${NEPOMUK_UTILS_LIBRARIES} ${SOPRANO_LIBRARIES})
-endif(HAVE_NEPOMUK)
-
install(TARGETS plasma_applet_comic DESTINATION ${PLUGIN_INSTALL_DIR})
install(FILES plasma-comic-default.desktop DESTINATION ${SERVICES_INSTALL_DIR})
#include <KTemporaryFile>
#include <KZip>
-#ifdef HAVE_NEPOMUK
-#include <Nepomuk/Resource>
-#include <Nepomuk/Tag>
-#include <Nepomuk/Variant>
-#include <Nepomuk/Vocabulary/NCO>
-#include <Nepomuk/Vocabulary/NFO>
-#include <Nepomuk/Vocabulary/PIMO>
-
-using namespace Nepomuk::Vocabulary;
-#endif
-
ComicArchiveJob::ComicArchiveJob( const KUrl &dest, Plasma::DataEngine *engine, ComicArchiveJob::ArchiveType archiveType, IdentifierType identifierType, const QString &pluginName, QObject *parent )
: KJob( parent ),
mType( archiveType ),
return;
}
-#ifdef HAVE_NEPOMUK
- //store additional data using Nepomuk
- Nepomuk::Resource res( mDest, NFO::FileDataObject() );
-
- Nepomuk::Resource comicTopic( "Comic", PIMO::Topic() );
- comicTopic.setLabel( i18n( "Comic" ) );
-
- if ( !mComicTitle.isEmpty() ) {
- Nepomuk::Resource topic( mComicTitle, PIMO::Topic() );
- topic.setLabel( mComicTitle );
- topic.setProperty( PIMO::superTopic(), comicTopic );
- res.addTag( topic );
- } else {
-// res.addTag( comicTopic );//TODO activate this, see below
- ;
- }
-
- //FIXME also set the comic topic as tag, this is redundant, as topic has this as super topic
- //though at this point the gui (Dolphin) does not manage to show the correct tags
- res.addTag( comicTopic );
-
- foreach ( QString author, mAuthors ) {
- author = author.trimmed();
- Nepomuk::Resource authorRes( author, NCO::PersonContact() );
- authorRes.setProperty( NCO::fullname(), author );
- res.addProperty( NCO::creator(), authorRes );
- }
-#endif
-
emitResultIfNeeded();
}
#include <KIO/NetAccess>
#include <KTemporaryFile>
-#ifdef HAVE_NEPOMUK
-#include <Nepomuk/Resource>
-#include <Nepomuk/ResourceManager>
-#include <Nepomuk/Tag>
-#include <Nepomuk/Variant>
-#include <Nepomuk/Vocabulary/NCO>
-#include <Nepomuk/Vocabulary/NIE>
-#include <Nepomuk/Vocabulary/NFO>
-#include <Nepomuk/Vocabulary/PIMO>
-#include <nepomuk/utils.h>
-
-using namespace Nepomuk::Vocabulary;
-#endif
-
ComicSaver::ComicSaver(SavingDir *savingDir)
: mSavingDir(savingDir)
{
-#ifdef HAVE_NEPOMUK
- static bool isInit = false;
- if (!isInit) {
- isInit = true;
- // for manually saving the comics
- Nepomuk::ResourceManager::instance()->init();
- }
-#endif
}
bool ComicSaver::save(const ComicData &comic)
mSavingDir->setDir(destUrl.directory());
-#ifdef HAVE_NEPOMUK
- bool worked = KIO::NetAccess::file_copy(srcUrl, destUrl);
- //store additional data using Nepomuk
- if (worked) {
- Nepomuk::Resource res(destUrl, NFO::FileDataObject());
-
- Nepomuk::Resource comicTopic("Comic", PIMO::Topic());
- comicTopic.setLabel(i18n("Comic"));
-
- if (!comic.additionalText().isEmpty()) {
- res.setProperty(NIE::description(), comic.additionalText());
- }
- if ((comic.type() == Date) && !comic.current().isEmpty()) {
- res.setProperty(NIE::contentCreated(), QDateTime::fromString(comic.current(), Qt::ISODate));
- }
- if (!title.isEmpty()) {
- Nepomuk::Resource topic(title, PIMO::Topic());
- topic.setLabel(title);
- topic.setProperty(PIMO::superTopic(), comicTopic);
- res.addTag(topic);
- } else {
-// res.addTag(comicTopic);//TODO activate this, see below
- ;
- }
-
- //FIXME also set the comic topic as tag, this is redundant, as topic has this as super topic
- //though at this point the gui does not manage to show the correct tags
- res.addTag(comicTopic);
-
- if (!comic.stripTitle().isEmpty()) {
- res.setProperty(NIE::title(), comic.stripTitle());
- }
- if (!comic.websiteUrl().isEmpty()) {
- Nepomuk::Resource copyEvent = Nepomuk::Utils::createCopyEvent(comic.imageUrl(), destUrl, QDateTime(), comic.websiteUrl());
- }
-
- const QStringList authors = comic.author().split(',', QString::SkipEmptyParts);
- foreach (const QString &author, authors) {
- Nepomuk::Resource authorRes(author, NCO::PersonContact());
- authorRes.setProperty(NCO::fullname(), author.trimmed());
- res.addProperty(NCO::creator(), authorRes);
- }
- return true;
- }
-
- return false;
-#else
KIO::NetAccess::file_copy( srcUrl, destUrl );
return true;
-#endif
}
+++ /dev/null
-#cmakedefine HAVE_NEPOMUK