diff --git a/browsingbackends/localfiles/CMakeLists.txt b/browsingbackends/localfiles/CMakeLists.txt index 81c3438c..ee01acdb 100644 --- a/browsingbackends/localfiles/CMakeLists.txt +++ b/browsingbackends/localfiles/CMakeLists.txt @@ -1,11 +1,10 @@ find_package(SharedDesktopOntologies REQUIRED) find_package(Soprano REQUIRED) -find_package(Nepomuk REQUIRED) include(SopranoAddOntology) add_subdirectory(localvideos) add_subdirectory(localpictures) add_subdirectory(localmusic) install(DIRECTORY localfilescomponents DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/mediacentercomponents) diff --git a/browsingbackends/localfiles/localmusic/CMakeLists.txt b/browsingbackends/localfiles/localmusic/CMakeLists.txt index c4bd5523..da532f7e 100644 --- a/browsingbackends/localfiles/localmusic/CMakeLists.txt +++ b/browsingbackends/localfiles/localmusic/CMakeLists.txt @@ -1,25 +1,24 @@ set(localmusicbackend_SRCS localmusicmodel.cpp ../localfilesabstractbackend.cpp ../localfilesabstractmodel.cpp localmusicbackend.cpp ) soprano_add_ontology(localmusicbackend_SRCS ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nfo.trig "NFO" "Vocabulary" "trig") soprano_add_ontology(localmusicbackend_SRCS ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nie.trig "NIE" "Vocabulary" "trig") kde4_add_plugin(pmc_localmusic ${localmusicbackend_SRCS}) -target_link_libraries(pmc_localmusic +target_link_libraries(pmc_localmusic plasmamediacenter ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS} - ${NEPOMUK_LIBRARIES} - ${NEPOMUK_QUERY_LIBRARIES} + ${NEPOMUK_CORE_LIBRARY} ${SOPRANO_LIBRARIES} ${TAGLIB_LIBRARIES} ) install(TARGETS pmc_localmusic DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES localmusic.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/browsingbackends/localfiles/localpictures/CMakeLists.txt b/browsingbackends/localfiles/localpictures/CMakeLists.txt index a84e2176..60076ec2 100644 --- a/browsingbackends/localfiles/localpictures/CMakeLists.txt +++ b/browsingbackends/localfiles/localpictures/CMakeLists.txt @@ -1,22 +1,22 @@ set(localpicturesbackend_SRCS localpicturesmodel.cpp ../localfilesabstractbackend.cpp ../localfilesabstractmodel.cpp localpicturesbackend.cpp ) soprano_add_ontology(localpicturesbackend_SRCS ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nfo.trig "NFO" "Vocabulary" "trig") soprano_add_ontology(localpicturesbackend_SRCS ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nie.trig "NIE" "Vocabulary" "trig") kde4_add_plugin(pmc_localpictures ${localpicturesbackend_SRCS}) target_link_libraries(pmc_localpictures plasmamediacenter ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS} -${NEPOMUK_LIBRARIES} -${NEPOMUK_QUERY_LIBRARIES} +${NEPOMUK_CORE_LIBRARY} + ${SOPRANO_LIBRARIES} ) install(TARGETS pmc_localpictures DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES localpictures.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/browsingbackends/localfiles/localvideos/CMakeLists.txt b/browsingbackends/localfiles/localvideos/CMakeLists.txt index 615f7b6b..d3171503 100644 --- a/browsingbackends/localfiles/localvideos/CMakeLists.txt +++ b/browsingbackends/localfiles/localvideos/CMakeLists.txt @@ -1,25 +1,25 @@ set(localvideosbackend_SRCS localvideosmodel.cpp ../localfilesabstractbackend.cpp ../localfilesabstractmodel.cpp localvideosbackend.cpp localvideothumbnailprovider.cpp ) soprano_add_ontology(localvideosbackend_SRCS ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nfo.trig "NFO" "Vocabulary" "trig") soprano_add_ontology(localvideosbackend_SRCS ${SHAREDDESKTOPONTOLOGIES_ROOT_DIR}/nie/nie.trig "NIE" "Vocabulary" "trig") kde4_add_plugin(pmc_localvideos ${localvideosbackend_SRCS}) target_link_libraries(pmc_localvideos plasmamediacenter ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS} -${NEPOMUK_LIBRARIES} -${NEPOMUK_QUERY_LIBRARIES} +${NEPOMUK_CORE_LIBRARY} + ${SOPRANO_LIBRARIES} ${QT_QTDECLARATIVE_LIBRARIES} ) install(TARGETS pmc_localvideos DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES localvideos.desktop DESTINATION ${SERVICES_INSTALL_DIR}) diff --git a/browsingbackends/metadatabackends/metadatamusicbackend/CMakeLists.txt b/browsingbackends/metadatabackends/metadatamusicbackend/CMakeLists.txt index d9756539..c92e68c4 100644 --- a/browsingbackends/metadatabackends/metadatamusicbackend/CMakeLists.txt +++ b/browsingbackends/metadatabackends/metadatamusicbackend/CMakeLists.txt @@ -1,27 +1,28 @@ +find_package(NepomukCore) + set(metadatamusicbackend_SRCS nepomukmusicmodel.cpp - categoriesmodel.cpp + categoriesmodel.cpp metadatamusicmodel.cpp ../abstractmetadatabackend.cpp ../abstractmetadatamodel.cpp metadatamusicbackend.cpp ) qt4_automoc(${metadatamusicbackend_SRCS}) kde4_add_plugin(pmc_metadatamusicbackend ${metadatamusicbackend_SRCS}) target_link_libraries(pmc_metadatamusicbackend plasmamediacenter ${KDE4_KDECORE_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KFILE_LIBS} ${QT_QTDECLARATIVE_LIBRARIES} - ${NEPOMUK_LIBRARIES} - ${NEPOMUK_QUERY_LIBRARIES} + ${NEPOMUK_CORE_LIBRARY} ) install(TARGETS pmc_metadatamusicbackend DESTINATION ${PLUGIN_INSTALL_DIR}) install(FILES metadatamusicbackend.desktop DESTINATION ${SERVICES_INSTALL_DIR}) install(DIRECTORY metadatamusiccomponents DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/plasma/mediacentercomponents) diff --git a/browsingbackends/metadatabackends/metadatamusicbackend/metadatamusicbackend.cpp b/browsingbackends/metadatabackends/metadatamusicbackend/metadatamusicbackend.cpp index 4c5212a5..286d9e08 100644 --- a/browsingbackends/metadatabackends/metadatamusicbackend/metadatamusicbackend.cpp +++ b/browsingbackends/metadatabackends/metadatamusicbackend/metadatamusicbackend.cpp @@ -1,138 +1,138 @@ /*************************************************************************** * Copyright 2009 by Alessandro Diaferia * * Copyright 2011 Sinny Kumari * * Copyright 2007 Aaron Seigo * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #include "metadatamusicbackend.h" #include "metadatamusicmodel.h" #include "nepomukmusicmodel.h" #include "nepomukmusicmodel.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include MEDIACENTER_EXPORT_BROWSINGBACKEND(MetadataMusicBackend) MetadataMusicBackend::MetadataMusicBackend(QObject* parent, const QVariantList& args) : AbstractMetadataBackend(parent, args), m_nepomukModel(new NepomukMusicModel(this)), m_metadataMusicModel(0), m_albumsModel(new NepomukMusicModel(this)), m_artistsModel(new NepomukMusicModel(this)), m_musicModel(new NepomukMusicModel(this)) { - m_albumsModel->setResourceType(Nepomuk::Vocabulary::NMM::musicAlbum(), "tools-media-optical-copy"); - m_artistsModel->setResourceType(Nepomuk::Vocabulary::NMM::performer(), "user-identity"); - m_musicModel->setResourceType(Nepomuk::Vocabulary::NFO::Audio(), "amarok"); + m_albumsModel->setResourceType(Nepomuk2::Vocabulary::NMM::musicAlbum(), "tools-media-optical-copy"); + m_artistsModel->setResourceType(Nepomuk2::Vocabulary::NMM::performer(), "user-identity"); + m_musicModel->setResourceType(Nepomuk2::Vocabulary::NFO::Audio(), "amarok"); emit musicModelChanged(); } MetadataMusicBackend::~MetadataMusicBackend() { } void MetadataMusicBackend::init() { AbstractMetadataBackend::init(); if (metadataModel()) { m_metadataMusicModel = new MetadataMusicModel(this); } updateModelAccordingToFilters(); } QString MetadataMusicBackend::mediaBrowserOverride() const { return constructQmlSource("metadatamusiccomponents", "0.1", "MediaBrowser"); } bool MetadataMusicBackend::supportsSearch() const { return false; } QObject* MetadataMusicBackend::albumsModel() const { return m_albumsModel; } QObject* MetadataMusicBackend::artistsModel() const { return m_artistsModel; } QString MetadataMusicBackend::albumFilter() const { return m_albumFilter; } QString MetadataMusicBackend::artistFilter() const { return m_artistFilter; } void MetadataMusicBackend::setAlbumFilter(const QString& filter) { m_albumFilter = filter; emit albumFilterChanged(); m_artistFilter.clear(); emit artistFilterChanged(); updateModelAccordingToFilters(); } void MetadataMusicBackend::setArtistFilter(const QString& filter) { m_artistFilter = filter; emit artistFilterChanged(); m_albumFilter.clear(); emit albumFilterChanged(); updateModelAccordingToFilters(); } void MetadataMusicBackend::updateModelAccordingToFilters() { - QList termsList; - termsList.append(Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::NFO::Audio())); + QList termsList; + termsList.append(Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::NFO::Audio())); if (!m_albumFilter.isEmpty()) { - termsList.append(Nepomuk::Query::ComparisonTerm(Nepomuk::Vocabulary::NMM::musicAlbum(), Nepomuk::Query::ResourceTerm(m_albumFilter))); + termsList.append(Nepomuk2::Query::ComparisonTerm(Nepomuk2::Vocabulary::NMM::musicAlbum(), Nepomuk2::Query::ResourceTerm(m_albumFilter))); } if (!m_artistFilter.isEmpty()) { - termsList.append(Nepomuk::Query::ComparisonTerm(Nepomuk::Vocabulary::NMM::performer(), Nepomuk::Query::ResourceTerm(m_artistFilter))); + termsList.append(Nepomuk2::Query::ComparisonTerm(Nepomuk2::Vocabulary::NMM::performer(), Nepomuk2::Query::ResourceTerm(m_artistFilter))); } - m_musicModel->setTerm(Nepomuk::Query::AndTerm(termsList), "amarok"); + m_musicModel->setTerm(Nepomuk2::Query::AndTerm(termsList), "amarok"); } QObject* MetadataMusicBackend::musicModel() const { return m_musicModel; } QString MetadataMusicBackend::backendCategory() const { return "audio"; } #include "metadatamusicbackend.moc" diff --git a/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmodel.cpp b/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmodel.cpp index 02fe1544..cb9f3c1e 100644 --- a/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmodel.cpp +++ b/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmodel.cpp @@ -1,126 +1,126 @@ /*************************************************************************** * Copyright 2011 Sinny Kumari * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #include "nepomukmusicmodel.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include NepomukMusicModel::NepomukMusicModel(QObject* parent): QAbstractListModel(parent) { setRoleNames(MediaCenter::appendAdditionalMediaRoles(roleNames())); } -void NepomukMusicModel::setTerm(Nepomuk::Query::Term term, const QString &iconName) +void NepomukMusicModel::setTerm(Nepomuk2::Query::Term term, const QString &iconName) { m_icon = iconName; m_term = term; updateModel(); } void NepomukMusicModel::updateModel() { - Nepomuk::Query::Query myQuery; - Nepomuk::Query::QueryServiceClient *queryClient = new Nepomuk::Query::QueryServiceClient(this); + Nepomuk2::Query::Query myQuery; + Nepomuk2::Query::QueryServiceClient *queryClient = new Nepomuk2::Query::QueryServiceClient(this); - connect(queryClient, SIGNAL(newEntries(QList)), - this, SLOT(newEntries(QList))); + connect(queryClient, SIGNAL(newEntries(QList)), + this, SLOT(newEntries(QList))); connect(queryClient, SIGNAL(entriesRemoved(QList)),SLOT(entriesRemoved(QList))); connect(queryClient, SIGNAL(error(QString)), SLOT(error(QString))); connect(queryClient, SIGNAL(finishedListing()), this, SLOT(finishedListing())); myQuery.setTerm(m_term); kDebug()<< "Sparql query:"<< myQuery.toSparqlQuery(); m_queryResults.clear(); reset(); queryClient->query(myQuery); } -void NepomukMusicModel::setResourceType(Nepomuk::Types::Property property, const QString &iconName) +void NepomukMusicModel::setResourceType(Nepomuk2::Types::Property property, const QString &iconName) { - Nepomuk::Query::ComparisonTerm ct(property, Nepomuk::Query::Term()); + Nepomuk2::Query::ComparisonTerm ct(property, Nepomuk2::Query::Term()); ct.setInverted(true); m_term = ct; m_icon = iconName; updateModel(); } QVariant NepomukMusicModel::data(const QModelIndex& index, int role) const { switch(role) { case Qt::DecorationRole: return m_icon; case Qt::DisplayRole: return m_queryResults.at(index.row()).resource().genericLabel(); case MediaCenter::IsExpandableRole: return true; case MediaCenter::ResourceIdRole: - return m_queryResults.at(index.row()).resource().resourceUri(); + return m_queryResults.at(index.row()).resource().uri(); case MediaCenter::MediaTypeRole: return "audio"; case MediaCenter::MediaUrlRole: - return m_queryResults.at(index.row()).resource().property(Nepomuk::Vocabulary::NIE::url()).toString(); + return m_queryResults.at(index.row()).resource().property(Nepomuk2::Vocabulary::NIE::url()).toString(); } return QVariant(); } int NepomukMusicModel::rowCount(const QModelIndex& parent) const { return m_queryResults.size(); } -void NepomukMusicModel::newEntries(const QList< Nepomuk::Query::Result >& entries) +void NepomukMusicModel::newEntries(const QList< Nepomuk2::Query::Result >& entries) { - Q_FOREACH (const Nepomuk::Query::Result &res, entries) { + Q_FOREACH (const Nepomuk2::Query::Result &res, entries) { m_queryResults.append(res); } } void NepomukMusicModel::entriesRemoved(QList< QUrl > entries) { } void NepomukMusicModel::finishedListing() { reset(); } void NepomukMusicModel::error(const QString &message) { kDebug() << message; } \ No newline at end of file diff --git a/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmodel.h b/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmodel.h index a20858b5..33e08402 100644 --- a/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmodel.h +++ b/browsingbackends/metadatabackends/metadatamusicbackend/nepomukmusicmodel.h @@ -1,52 +1,52 @@ /*************************************************************************** * Copyright 2011 Sinny Kumari * * Copyright 2012 Shantanu Tushar * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * ***************************************************************************/ #ifndef NEPOMUKMUSICMODEL_H #define NEPOMUKMUSICMODEL_H #include -#include -#include -#include +#include +#include +#include class NepomukMusicModel : public QAbstractListModel { Q_OBJECT public: explicit NepomukMusicModel(QObject* parent = 0); virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; virtual int rowCount(const QModelIndex& parent = QModelIndex()) const; - void setTerm(Nepomuk::Query::Term term, const QString& iconName); - void setResourceType(Nepomuk::Types::Property property, const QString& iconName); + void setTerm(Nepomuk2::Query::Term term, const QString& iconName); + void setResourceType(Nepomuk2::Types::Property property, const QString& iconName); protected Q_SLOTS: - void newEntries(const QList< Nepomuk::Query::Result > &entries); + void newEntries(const QList< Nepomuk2::Query::Result > &entries); void entriesRemoved(QList< QUrl > entries); void finishedListing(); void updateModel(); void error(const QString &message); private: QString m_icon; - QList< Nepomuk::Query::Result > m_queryResults; - Nepomuk::Query::Term m_term; + QList< Nepomuk2::Query::Result > m_queryResults; + Nepomuk2::Query::Term m_term; }; #endif // NEPOMUKMUSICMODEL_H