OSDN Git Service

kdeplasma-addons: remove Nepomuk support of comic applet
authorIvailo Monev <xakepa10@gmail.com>
Tue, 7 Apr 2015 15:38:41 +0000 (15:38 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Tue, 7 Apr 2015 15:38:41 +0000 (15:38 +0000)
kdeplasma-addons/CMakeLists.txt
kdeplasma-addons/applets/comic/CMakeLists.txt
kdeplasma-addons/applets/comic/comicarchivejob.cpp
kdeplasma-addons/applets/comic/comicsaver.cpp
kdeplasma-addons/applets/comic/config-nepomuk.h.cmake [deleted file]

index a9fc5af..0bda71c 100644 (file)
@@ -24,11 +24,6 @@ macro_log_feature(LIBATTICA_FOUND "libattica" "Attica Library" "http://websvn.kd
 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 "" "")
 
@@ -46,10 +41,6 @@ macro_log_feature(MARBLE_FOUND "Marble" "Desktop Globe" "http://marble.kde.org"
 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}
index 55735b3..f45128b 100644 (file)
@@ -1,10 +1,5 @@
 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
@@ -29,10 +24,6 @@ kde4_add_ui_files(comic_SRCS
 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})
 
index 68b42d2..2d28ff4 100644 (file)
 #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 ),
@@ -394,35 +383,6 @@ void ComicArchiveJob::copyZipFileToDestination()
         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();
 }
 
index cf92c76..7445187 100644 (file)
 #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)
@@ -78,55 +56,7 @@ 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
 }
diff --git a/kdeplasma-addons/applets/comic/config-nepomuk.h.cmake b/kdeplasma-addons/applets/comic/config-nepomuk.h.cmake
deleted file mode 100644 (file)
index fe7364f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-#cmakedefine HAVE_NEPOMUK