diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 20 | ||||
-rw-r--r-- | src/bookmarks/bookmarkowner.cpp | 14 | ||||
-rw-r--r-- | src/bookmarks/bookmarkowner.h | 3 | ||||
-rw-r--r-- | src/bookmarks/bookmarkscontextmenu.cpp | 3 | ||||
-rw-r--r-- | src/nepomuk/utils/nepomukutils_export.h | 40 | ||||
-rw-r--r-- | src/nepomuk/utils/resourcemodel.cpp | 230 | ||||
-rw-r--r-- | src/nepomuk/utils/resourcemodel.h | 177 | ||||
-rw-r--r-- | src/nepomuk/utils/simpleresourcemodel.cpp | 170 | ||||
-rw-r--r-- | src/nepomuk/utils/simpleresourcemodel.h | 144 | ||||
-rw-r--r-- | src/urlbar/bookmarkwidget.cpp | 16 | ||||
-rw-r--r-- | src/urlbar/bookmarkwidget.h | 13 | ||||
-rw-r--r-- | src/urlbar/newresourcedialog.cpp | 30 | ||||
-rw-r--r-- | src/urlbar/newresourcedialog.h | 6 | ||||
-rw-r--r-- | src/urlbar/resourcelinkdialog.cpp | 162 | ||||
-rw-r--r-- | src/urlbar/resourcelinkdialog.h | 4 |
15 files changed, 137 insertions, 895 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 69821d81..143f9dc1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -110,15 +110,13 @@ set(rekonq_KDEINIT_SRCS # Nepomuk OPTIONAL src files -IF(NepomukCore_FOUND) +IF(HAVE_NEPOMUK) SET( rekonq_KDEINIT_SRCS ${rekonq_KDEINIT_SRCS} urlbar/resourcelinkdialog.cpp urlbar/newresourcedialog.cpp - nepomuk/utils/simpleresourcemodel.cpp - nepomuk/utils/resourcemodel.cpp ) -ENDIF(NepomukCore_FOUND) +ENDIF(HAVE_NEPOMUK) # Opera sync optional src files @@ -182,14 +180,13 @@ INCLUDE_DIRECTORIES ( ${CMAKE_CURRENT_SOURCE_DIR} ) # Nepomuk optional include directories -IF(NepomukCore_FOUND) +IF(HAVE_NEPOMUK) INCLUDE_DIRECTORIES(${SOPRANO_INCLUDE_DIR} - ${NEPOMUK_CORE_INCLUDE_DIR} + ${NEPOMUK_INCLUDE_DIR} ) - FIND_PACKAGE(Soprano REQUIRED) INCLUDE(SopranoAddOntology) -ENDIF(NepomukCore_FOUND) +ENDIF(HAVE_NEPOMUK) # Opera sync optional include directories IF(HAVE_QCA2 AND HAVE_QTOAUTH) @@ -234,12 +231,13 @@ TARGET_LINK_LIBRARIES ( kdeinit_rekonq ) # Nepomuk optional target link libraries -IF(NepomukCore_FOUND) +IF(HAVE_NEPOMUK) TARGET_LINK_LIBRARIES( kdeinit_rekonq - ${NEPOMUK_CORE_LIBRARY} + ${NEPOMUK_LIBRARIES} + ${NEPOMUK_QUERY_LIBRARIES} ${SOPRANO_LIBRARIES} ) -ENDIF(NepomukCore_FOUND) +ENDIF(HAVE_NEPOMUK) # Opera sync optional link libraries IF(HAVE_QCA2 AND HAVE_QTOAUTH) diff --git a/src/bookmarks/bookmarkowner.cpp b/src/bookmarks/bookmarkowner.cpp index 329fd0bc..ba2d8f63 100644 --- a/src/bookmarks/bookmarkowner.cpp +++ b/src/bookmarks/bookmarkowner.cpp @@ -52,8 +52,8 @@ #include "resourcelinkdialog.h" // Nepomuk Includes -#include <Nepomuk2/Resource> -#include <Nepomuk2/Vocabulary/NFO> +#include <Nepomuk/Resource> +#include <Nepomuk/Vocabulary/NFO> #endif @@ -221,9 +221,9 @@ KBookmark BookmarkOwner::bookmarkCurrentPage(const KBookmark &bookmark) { parent = BookmarkManager::self()->rootGroup(); #ifdef HAVE_NEPOMUK - Nepomuk2::Resource nfoResource; + Nepomuk::Resource nfoResource; nfoResource = ((QUrl)currentUrl()); - nfoResource.addType(Nepomuk2::Vocabulary::NFO::Website()); + nfoResource.addType(Nepomuk::Vocabulary::NFO::Website()); nfoResource.setLabel(currentTitle()); #endif } @@ -327,9 +327,9 @@ void BookmarkOwner::editBookmark(KBookmark bookmark) #ifdef HAVE_NEPOMUK void BookmarkOwner::fancyBookmark(KBookmark bookmark) { - Nepomuk2::Resource nfoResource = (KUrl)bookmark.url(); + Nepomuk::Resource nfoResource = (KUrl)bookmark.url(); - QPointer<Nepomuk2::ResourceLinkDialog> r = new Nepomuk2::ResourceLinkDialog(nfoResource); + QPointer<Nepomuk::ResourceLinkDialog> r = new Nepomuk::ResourceLinkDialog(nfoResource); r->exec(); r->deleteLater(); @@ -373,7 +373,7 @@ bool BookmarkOwner::deleteBookmark(const KBookmark &bookmark) bmg.deleteBookmark(bookmark); #ifdef HAVE_NEPOMUK - Nepomuk2::Resource nfoResource(bookmark.url()); + Nepomuk::Resource nfoResource(bookmark.url()); nfoResource.remove(); #endif m_manager->emitChanged(bmg); diff --git a/src/bookmarks/bookmarkowner.h b/src/bookmarks/bookmarkowner.h index 5be30853..6a18c237 100644 --- a/src/bookmarks/bookmarkowner.h +++ b/src/bookmarks/bookmarkowner.h @@ -34,6 +34,9 @@ // Rekonq Includes #include "rekonq_defines.h" +// Nepomuk config include +#include <config-nepomuk.h> + // KDE Includes #include <KAction> #include <KBookmarkOwner> diff --git a/src/bookmarks/bookmarkscontextmenu.cpp b/src/bookmarks/bookmarkscontextmenu.cpp index 2ae74b5c..69cde758 100644 --- a/src/bookmarks/bookmarkscontextmenu.cpp +++ b/src/bookmarks/bookmarkscontextmenu.cpp @@ -28,6 +28,9 @@ // Self Includes #include "bookmarkscontextmenu.h" +// Nepomuk config include +#include <config-nepomuk.h> + // Local Includes #include "bookmarkowner.h" #include "bookmarkmanager.h" diff --git a/src/nepomuk/utils/nepomukutils_export.h b/src/nepomuk/utils/nepomukutils_export.h deleted file mode 100644 index 718bd7c3..00000000 --- a/src/nepomuk/utils/nepomukutils_export.h +++ /dev/null @@ -1,40 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2007 David Faure <faure@kde.org> - Copyright (C) 2010 Sebastian Trueg <trueg@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef NEPOMUKUTILS_EXPORT_H -#define NEPOMUKUTILS_EXPORT_H - -/* needed for KDE_EXPORT and KDE_IMPORT macros */ -#include <kdemacros.h> - -#ifndef NEPOMUKUTILS_EXPORT -# if defined(KDELIBS_STATIC_LIBS) - /* No export/import for static libraries */ -# define NEPOMUKUTILS_EXPORT -# elif defined(MAKE_NEPOMUKUTILS_LIB) - /* We are building this library */ -# define NEPOMUKUTILS_EXPORT KDE_EXPORT -# else - /* We are using this library */ -# define NEPOMUKUTILS_EXPORT KDE_IMPORT -# endif -#endif - -#endif diff --git a/src/nepomuk/utils/resourcemodel.cpp b/src/nepomuk/utils/resourcemodel.cpp deleted file mode 100644 index 72c71e9b..00000000 --- a/src/nepomuk/utils/resourcemodel.cpp +++ /dev/null @@ -1,230 +0,0 @@ -/* - This file is part of the Nepomuk KDE project. - Copyright (C) 2007-2010 Sebastian Trueg <trueg@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "resourcemodel.h" - -#include <QtCore/QUrl> -#include <QtCore/QList> -#include <QtCore/QMimeData> - -#include "kurl.h" -#include "kdebug.h" -#include "kcategorizedsortfilterproxymodel.h" -#include "kicon.h" -#include "klocale.h" - -#include <Nepomuk2/Resource> -#include <Nepomuk2/Types/Class> -#include <Nepomuk2/Variant> - -#include <Soprano/Vocabulary/RDFS> -#include <Soprano/Vocabulary/NAO> - - -Q_DECLARE_METATYPE(Nepomuk2::Types::Class) - - -class Nepomuk2::Utils::ResourceModel::Private -{ -public: -}; - - -Nepomuk2::Utils::ResourceModel::ResourceModel( QObject* parent ) - : QAbstractItemModel( parent ), - d( new Private() ) -{ -} - - -Nepomuk2::Utils::ResourceModel::~ResourceModel() -{ - delete d; -} - - -QModelIndex Nepomuk2::Utils::ResourceModel::parent( const QModelIndex& child ) const -{ - Q_UNUSED(child); - return QModelIndex(); -} - - -int Nepomuk2::Utils::ResourceModel::columnCount( const QModelIndex& parent ) const -{ - Q_UNUSED(parent); - return ResourceModelColumnCount; -} - - -QVariant Nepomuk2::Utils::ResourceModel::data( const QModelIndex& index, int role ) const -{ - Nepomuk2::Resource res = resourceForIndex( index ); - if( !res.isValid() ) { - return QVariant(); - } - - // - // Part 1: column specific data - // - switch( index.column() ) { - case ResourceColumn: - switch( role ) { - case Qt::DisplayRole: - case Qt::EditRole: - return res.genericLabel(); - - case Qt::DecorationRole: { - QString iconName = res.genericIcon(); - if( !iconName.isEmpty() ) { - return KIcon( iconName ); - } - else { - QIcon icon = Types::Class(res.type()).icon(); - if( !icon.isNull() ) - return icon; - else - return QVariant(); - } - } - - case Qt::ToolTipRole: - return KUrl( res.uri() ).prettyUrl(); - - } - - case ResourceTypeColumn: - switch( role ) { - case Qt::DisplayRole: - case Qt::EditRole: - return Types::Class( res.type() ).label(); - - case Qt::DecorationRole: { - QIcon icon = Types::Class(res.type()).icon(); - if( !icon.isNull() ) - return icon; - else - return QVariant(); - } - - case Qt::ToolTipRole: - return KUrl(res.type()).prettyUrl(); - } - } - - - // - // Part 2: column-independant data - // - switch( role ) { - case KCategorizedSortFilterProxyModel::CategorySortRole: - // FIXME: sort files before other stuff and so on - - case KCategorizedSortFilterProxyModel::CategoryDisplayRole: { - Q_ASSERT( !res.type().isEmpty() ); - Nepomuk2::Types::Class c( res.type() ); - QString cat = c.label(); - if ( cat.isEmpty() ) { - cat = c.name(); - } - if ( c.uri() == Soprano::Vocabulary::RDFS::Resource() || cat.isEmpty() ) { - cat = i18nc( "@title KCategorizedSortFilterProxyModel grouping for all Nepomukj resources that are of type rdfs:Resource", "Miscellaneous" ); - } - - return cat; - } - - case ResourceRole: - return QVariant::fromValue( res ); - - case ResourceTypeRole: - return QVariant::fromValue( Nepomuk2::Types::Class(res.type()) ); - - case ResourceCreationDateRole: - return res.property( Soprano::Vocabulary::NAO::created() ).toDateTime(); - } - - // fallback - return QVariant(); -} - - -QVariant Nepomuk2::Utils::ResourceModel::headerData(int section, Qt::Orientation orientation, int role) const -{ - if( role == Qt::DisplayRole ) { - switch( section ) { - case ResourceColumn: - return i18nc("@title:column The Nepomuk resource label and icon", "Resource"); - case ResourceTypeColumn: - return i18nc("@title:column The Nepomuk resource's RDF type", "Resource Type"); - } - } - - return QAbstractItemModel::headerData(section, orientation, role); -} - - -Qt::ItemFlags Nepomuk2::Utils::ResourceModel::flags( const QModelIndex& index ) const -{ - if ( index.isValid() ) { - return QAbstractItemModel::flags( index ) | Qt::ItemIsDragEnabled; - } - else { - return QAbstractItemModel::flags( index ); - } -} - - -QMimeData* Nepomuk2::Utils::ResourceModel::mimeData( const QModelIndexList& indexes ) const -{ - KUrl::List uris; - foreach ( const QModelIndex& index, indexes ) { - if (index.isValid()) { - uris << index.data( ResourceRole ).value<Resource>().uri(); - } - } - - QMimeData* mimeData = new QMimeData(); - uris.populateMimeData( mimeData ); - - QByteArray data; - QDataStream s( &data, QIODevice::WriteOnly ); - s << uris; - mimeData->setData( mimeTypes().first(), data ); - - return mimeData; -} - - -QStringList Nepomuk2::Utils::ResourceModel::mimeTypes() const -{ - return( QStringList() - << QLatin1String( "application/x-nepomuk-resource-uri" ) - << KUrl::List::mimeDataTypes() ); -} - - -bool Nepomuk2::Utils::ResourceModel::setData( const QModelIndex& index, const QVariant& value, int role ) -{ - return QAbstractItemModel::setData(index, value, role); -} - -#include "resourcemodel.moc" diff --git a/src/nepomuk/utils/resourcemodel.h b/src/nepomuk/utils/resourcemodel.h deleted file mode 100644 index 526c7ac0..00000000 --- a/src/nepomuk/utils/resourcemodel.h +++ /dev/null @@ -1,177 +0,0 @@ -/* - This file is part of the Nepomuk KDE project. - Copyright (C) 2007-2010 Sebastian Trueg <trueg@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef _NEPOMUK_RESOUCE_MODEL_H_ -#define _NEPOMUK_RESOUCE_MODEL_H_ - -#include <QtCore/QAbstractItemModel> - -#include "nepomukutils_export.h" - -namespace Nepomuk2 { - - class Resource; - - namespace Utils { - /** - * \class ResourceModel resourcemodel.h Nepomuk/Utils/ResourceModel - * - * \brief Base class for all models providing a plain list of resources. - * - * The %ResourceModel is a base class for models that handle a set of - * %Nepomuk Resource instances. This can be a simple list as in SimpleResourceModel - * or a set of query results as in ResultModel. It could also be a dynamic list - * which is updated while the user scrolls it. - * - * %ResourceModel cannot be instanciated by itself. Use one of the subclasses - * or derive your own subclass from it. - * - * At least the following methods need to be implemented in a subclass: - * \li resourceForIndex() - * \li indexForResource(), - * \li QAbstractItemModel::rowCount() - * \li QAbstractItemModel::index() - * - * \author Sebastian Trueg <trueg@kde.org> - * - * \since 4.6 - */ - class NEPOMUKUTILS_EXPORT ResourceModel : public QAbstractItemModel - { - Q_OBJECT - - public: - /** - * Constructor. - */ - ResourceModel( QObject* parent = 0 ); - - /** - * Destructor - */ - virtual ~ResourceModel(); - - /** - * The columns supported by ResourceModel are identified - * by this enumeration. - */ - enum ResourceModelColumns { - /// The first column displays the label of the resource and its icon - ResourceColumn = 0, - - /// The second column displays the resource's type - ResourceTypeColumn = 1, - - /// The number of columns - ResourceModelColumnCount = 2 - }; - - /** - * Custom roles that can be accessed for example in delegates. - */ - enum ResourceRoles { - /** - * The resource itself, provided as a Nepomuk::Resource instance. - */ - ResourceRole = 7766897, - - /** - * The type of the resource, provided as a Nepomuk::Types::Class - * instance. - */ - ResourceTypeRole = 687585, - - /** - * The creation date of the resource. - */ - ResourceCreationDateRole = 7766898 - }; - - /** - * Get the Resource which corresponds to \p index. - * - * \return The Resource which corresponds to \p index or an invalid Resource - * if \p index is invalid. - */ - virtual Resource resourceForIndex( const QModelIndex& index ) const = 0; - - /** - * Get the index for a resource. - * - * \return The index which corresponds to \p res of an invalid QModelIndex - * if \p res is not part of this model. - */ - virtual QModelIndex indexForResource( const Resource& res ) const = 0; - - /** - * The default implementation returns an invalid QModelIndex, thus providing - * a plain list. - */ - virtual QModelIndex parent( const QModelIndex& child ) const; - - /** - * The default implementation returns 2 with the first column representing the resource - * itself and the second one showing the type. - */ - virtual int columnCount( const QModelIndex& parent ) const; - - /** - * Handles most roles typically used in applications like Qt::DisplayRole, Qt::ToolTipRole, - * and Qt::DecorationRole. Additionally KCategorizedSortFilterProxyModel roles are supported - * categorizing by resource types. - */ - virtual QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const; - - /** - * Provides header data for the supported columns. - */ - virtual QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; - - /** - * Reimplemented to support dragging of resources out of the model. - */ - virtual Qt::ItemFlags flags( const QModelIndex& index ) const; - - /** - * Stores the resource URIs via KUrl::List::populateMimeData() and as a specific - * "application/x-nepomuk-resource-uri" mime type to indicate that these are URIs - * corresponding to actual %Nepomuk resources. - */ - virtual QMimeData* mimeData( const QModelIndexList& indexes ) const; - - /** - * \return The KUrl mime types and "application/x-nepomuk-resource-uri". - */ - virtual QStringList mimeTypes() const; - - /** - * Provided for future extensions. - */ - virtual bool setData( const QModelIndex& index, const QVariant& value, int role ); - - private: - class Private; - Private* const d; - }; - } -} - -#endif diff --git a/src/nepomuk/utils/simpleresourcemodel.cpp b/src/nepomuk/utils/simpleresourcemodel.cpp deleted file mode 100644 index f500f648..00000000 --- a/src/nepomuk/utils/simpleresourcemodel.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - This file is part of the Nepomuk KDE project. - Copyright (C) 2008-2010 Sebastian Trueg <trueg@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -#include "simpleresourcemodel.h" - -#include <QtCore/QUrl> -#include <QtCore/QList> - -#include <Nepomuk2/Resource> -#include <Nepomuk2/Query/Result> - -#include "kdebug.h" -#include "kurl.h" - - -class Nepomuk2::Utils::SimpleResourceModel::Private -{ -public: - QList<Nepomuk2::Resource> resources; -}; - - -Nepomuk2::Utils::SimpleResourceModel::SimpleResourceModel( QObject* parent ) - : ResourceModel( parent ), - d( new Private() ) -{ -} - - -Nepomuk2::Utils::SimpleResourceModel::~SimpleResourceModel() -{ - delete d; -} - - -QModelIndex Nepomuk2::Utils::SimpleResourceModel::indexForResource( const Resource& res ) const -{ - Q_ASSERT( res.isValid() ); - // FIXME: performance - int i = 0; - QList<Nepomuk2::Resource>::const_iterator end = d->resources.constEnd(); - for ( QList<Nepomuk2::Resource>::const_iterator it = d->resources.constBegin(); it != end; ++it ) { - if ( *it == res ) { - return index( i, 0 ); - } - ++i; - } - - return QModelIndex(); -} - - -Nepomuk2::Resource Nepomuk2::Utils::SimpleResourceModel::resourceForIndex( const QModelIndex& index ) const -{ - if ( index.isValid() && index.row() < d->resources.count() ) { - return d->resources[index.row()]; - } - else { - return Resource(); - } -} - - -int Nepomuk2::Utils::SimpleResourceModel::rowCount( const QModelIndex& parent ) const -{ - if ( parent.isValid() ) { - return 0; - } - else { - return d->resources.count(); - } -} - - -QModelIndex Nepomuk2::Utils::SimpleResourceModel::index( int row, int column, const QModelIndex& parent ) const -{ - if ( !parent.isValid() && row < d->resources.count() ) { - return createIndex( row, column, 0 ); - } - else { - return QModelIndex(); - } -} - - -bool Nepomuk2::Utils::SimpleResourceModel::removeRows(int row, int count, const QModelIndex& parent) -{ - if( count < 1 || row < 0 || (row + count) > d->resources.size() || parent.isValid() ) - return false; - - beginRemoveRows( parent, row, row + count -1 ); - - QList<Resource>::iterator begin, end; - begin = end = d->resources.begin(); - begin += row; - end += row + count; - d->resources.erase( begin, end ); - - endRemoveRows(); - return true; -} - - -void Nepomuk2::Utils::SimpleResourceModel::setResources( const QList<Nepomuk2::Resource>& resources ) -{ - d->resources = resources; - reset(); -} - - -void Nepomuk2::Utils::SimpleResourceModel::addResources( const QList<Nepomuk2::Resource>& resources ) -{ - if(!resources.isEmpty()) { - beginInsertRows( QModelIndex(), d->resources.count(), d->resources.count() + resources.count() - 1 ); - d->resources << resources; - endInsertRows(); - } -} - - -void Nepomuk2::Utils::SimpleResourceModel::addResource( const Nepomuk2::Resource& resource ) -{ - addResources( QList<Resource>() << resource ); -} - - -void Nepomuk2::Utils::SimpleResourceModel::setResults( const QList<Nepomuk2::Query::Result>& results) -{ - clear(); - addResults( results ); -} - -void Nepomuk2::Utils::SimpleResourceModel::addResults( const QList<Nepomuk2::Query::Result>& results ) -{ - Q_FOREACH( const Query::Result& result, results ) { - addResource( result.resource() ); - } -} - -void Nepomuk2::Utils::SimpleResourceModel::addResult( const Nepomuk2::Query::Result result ) -{ - addResource( result.resource() ); -} - - -void Nepomuk2::Utils::SimpleResourceModel::clear() -{ - d->resources.clear(); - reset(); -} - -#include "simpleresourcemodel.moc" diff --git a/src/nepomuk/utils/simpleresourcemodel.h b/src/nepomuk/utils/simpleresourcemodel.h deleted file mode 100644 index 2f48d930..00000000 --- a/src/nepomuk/utils/simpleresourcemodel.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - This file is part of the Nepomuk KDE project. - Copyright (C) 2008-2010 Sebastian Trueg <trueg@kde.org> - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) version 3, or any - later version accepted by the membership of KDE e.V. (or its - successor approved by the membership of KDE e.V.), which shall - act as a proxy defined in Section 6 of version 3 of the license. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library. If not, see <http://www.gnu.org/licenses/>. - */ - -#ifndef _NEPOMUK_SIMPLE_RESOURCE_MODEL_H_ -#define _NEPOMUK_SIMPLE_RESOURCE_MODEL_H_ - -#include "resourcemodel.h" - -#include "nepomukutils_export.h" - -#include <Nepomuk2/Resource> -#include <Nepomuk2/Query/Result> - -#include <QtCore/QList> - -namespace Nepomuk2 { - namespace Utils { - /** - * \class SimpleResourceModel simpleresourcemodel.h Nepomuk/Utils/SimpleResourceModel - * - * A simple ResourceModel that handles a list of Resource instances which - * can be managed via the setResources(), addResource(), addResources(), and - * clear() methods. - * - * \author Sebastian Trueg <trueg@kde.org> - * - * \since 4.6 - */ - class NEPOMUKUTILS_EXPORT SimpleResourceModel : public ResourceModel - { - Q_OBJECT - - public: - /** - * Creates an empty resource model. - */ - SimpleResourceModel( QObject* parent = 0 ); - - /** - * Destructor - */ - ~SimpleResourceModel(); - - /** - * Get the Resource which corresponds to \p index. - * - * \return The Resource which corresponds to \p index or an invalid Resource - * if \p index is invalid. - */ - QModelIndex indexForResource( const Resource& res ) const; - - /** - * Get the index for a resource. - * - * \return The index which corresponds to \p res of an invalid QModelIndex - * if \p res is not part of this model. - */ - Resource resourceForIndex( const QModelIndex& index ) const; - - /** - * \return The number of resources added to the model for an invalid parent index. - */ - int rowCount( const QModelIndex& parent = QModelIndex() ) const; - - /** - * Creates an index for the cell at \p row and \p column. - */ - QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const; - - /** - * Removes those resources from the model. - */ - bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()); - - public Q_SLOTS: - /** - * Set the resources to be provided by the model to \p resources. - */ - void setResources( const QList<Nepomuk2::Resource>& resources ); - - /** - * Add \p resources to the list of resources being provided by the - * model. - */ - void addResources( const QList<Nepomuk2::Resource>& resources ); - - /** - * Add \p resource to the list of resources being provided by the - * model. - */ - void addResource( const Nepomuk2::Resource& resource ); - - /** - * This method is similar to setResources(). It is provided for - * allowing convenient connections from signals that provide - * Query::Result objects. - */ - void setResults( const QList<Nepomuk2::Query::Result>& results ); - - /** - * This method is similar to addResources(). It is provided for - * allowing convenient connections from signals that provide - * Query::Result objects like Query::QueryServiceClient::newResults(). - */ - void addResults( const QList<Nepomuk2::Query::Result>& results ); - - /** - * This method is similar to addResource(). It is provided for - * allowing convenient connections from signals that provide - * Query::Result objects. - */ - void addResult( const Nepomuk2::Query::Result result ); - - /** - * Clear the model by removing all resources added via setResources() and friends. - */ - void clear(); - - private: - class Private; - Private* const d; - }; - } -} - -#endif diff --git a/src/urlbar/bookmarkwidget.cpp b/src/urlbar/bookmarkwidget.cpp index a0e5cd44..e266a071 100644 --- a/src/urlbar/bookmarkwidget.cpp +++ b/src/urlbar/bookmarkwidget.cpp @@ -153,8 +153,8 @@ BookmarkWidget::BookmarkWidget(const KBookmark &bookmark, QWidget *parent) m_tagLine->setPlaceholderText(i18n("add tags(comma separated)")); - QList<Nepomuk2::Tag> tagList = Nepomuk2::Tag::allTags(); - Q_FOREACH(const Nepomuk2::Tag &t, tagList) + QList<Nepomuk::Tag> tagList = Nepomuk::Tag::allTags(); + Q_FOREACH(const Nepomuk::Tag &t, tagList) { m_tList.append(t.label()); } @@ -287,9 +287,9 @@ void BookmarkWidget::removeBookmark() #ifdef HAVE_NEPOMUK -void BookmarkWidget::addTags(QList<Nepomuk2::Tag> tagList) +void BookmarkWidget::addTags(QList<Nepomuk::Tag> tagList) { - Q_FOREACH(const Nepomuk2::Tag & tag, tagList) + Q_FOREACH(const Nepomuk::Tag & tag, tagList) { if (!m_nfoResource.tags().contains(tag)) { @@ -297,7 +297,7 @@ void BookmarkWidget::addTags(QList<Nepomuk2::Tag> tagList) } } - Q_FOREACH(Nepomuk2::Tag tag, m_nfoResource.tags()) + Q_FOREACH(Nepomuk::Tag tag, m_nfoResource.tags()) { if (!tagList.contains(tag)) { @@ -308,7 +308,7 @@ void BookmarkWidget::addTags(QList<Nepomuk2::Tag> tagList) void BookmarkWidget::parseTags() { - QList<Nepomuk2::Tag> tagList; + QList<Nepomuk::Tag> tagList; if (m_tagLine->text().contains(',')) { QString text = m_tagLine->text(); @@ -334,7 +334,7 @@ void BookmarkWidget::loadTags() QString list; if (!m_nfoResource.tags().isEmpty()) { - Q_FOREACH(const Nepomuk2::Tag & tag, m_nfoResource.tags()) + Q_FOREACH(const Nepomuk::Tag & tag, m_nfoResource.tags()) { list.append(tag.genericLabel()); list.append(","); @@ -358,7 +358,7 @@ void BookmarkWidget::addCommentSlot() void BookmarkWidget::linkToResourceSlot() { - QPointer<Nepomuk2::ResourceLinkDialog> r = new Nepomuk2::ResourceLinkDialog(m_nfoResource); + QPointer<Nepomuk::ResourceLinkDialog> r = new Nepomuk::ResourceLinkDialog(m_nfoResource); r->exec(); r->deleteLater(); diff --git a/src/urlbar/bookmarkwidget.h b/src/urlbar/bookmarkwidget.h index e6021c90..39f6fbd4 100644 --- a/src/urlbar/bookmarkwidget.h +++ b/src/urlbar/bookmarkwidget.h @@ -34,11 +34,14 @@ #include <QGridLayout> #include <QPlainTextEdit> +// Nepomuk config include +#include <config-nepomuk.h> + // Nepomuk Includes #ifdef HAVE_NEPOMUK -#include <Nepomuk2/Resource> -#include <Nepomuk2/Tag> -#include <Nepomuk2/Vocabulary/NFO> +#include <Nepomuk/Resource> +#include <Nepomuk/Tag> +#include <Nepomuk/Vocabulary/NFO> #endif // Forward Declarations @@ -58,7 +61,7 @@ public: void showAt(const QPoint &pos); #ifdef HAVE_NEPOMUK - void addTags(QList<Nepomuk2::Tag>); + void addTags(QList<Nepomuk::Tag>); void parseTags(); void loadTags(); #endif @@ -88,7 +91,7 @@ private: QStringList m_tList; #ifdef HAVE_NEPOMUK - Nepomuk2::Resource m_nfoResource; + Nepomuk::Resource m_nfoResource; bool m_isNepomukEnabled; #endif }; diff --git a/src/urlbar/newresourcedialog.cpp b/src/urlbar/newresourcedialog.cpp index 592d1b31..39cffc36 100644 --- a/src/urlbar/newresourcedialog.cpp +++ b/src/urlbar/newresourcedialog.cpp @@ -29,10 +29,10 @@ #include "newresourcedialog.moc" // Nepomuk Includes -#include <Nepomuk2/Vocabulary/NCO> -#include <Nepomuk2/Vocabulary/PIMO> -#include <Nepomuk2/Resource> -#include <Nepomuk2/Tag> +#include <Nepomuk/Vocabulary/NCO> +#include <Nepomuk/Vocabulary/PIMO> +#include <Nepomuk/Resource> +#include <Nepomuk/Tag> // Qt Includes #include <QPlainTextEdit> @@ -40,20 +40,20 @@ #include <QLabel> -class Nepomuk2::NewResourceDialog::Private +class Nepomuk::NewResourceDialog::Private { public: KLineEdit *m_resourceName; QPlainTextEdit *m_description; QLabel *m_titleResource; QLabel *m_desResource; - Nepomuk2::NewResourceDialog *q; - Nepomuk2::Resource m_nofResource; + Nepomuk::NewResourceDialog *q; + Nepomuk::Resource m_nofResource; int m_index; }; -Nepomuk2::NewResourceDialog::NewResourceDialog(int index, Nepomuk2::Resource& nfoResource, QWidget* parent): +Nepomuk::NewResourceDialog::NewResourceDialog(int index, Nepomuk::Resource& nfoResource, QWidget* parent): KDialog(parent), d(new Private()) { @@ -80,41 +80,41 @@ Nepomuk2::NewResourceDialog::NewResourceDialog(int index, Nepomuk2::Resource& nf } -Nepomuk2::NewResourceDialog::~NewResourceDialog() +Nepomuk::NewResourceDialog::~NewResourceDialog() { delete d; } -void Nepomuk2::NewResourceDialog::newResourceSlot() +void Nepomuk::NewResourceDialog::newResourceSlot() { if (d->m_index == 1) { - Nepomuk2::Resource newResource(d->m_resourceName->text(), Nepomuk2::Vocabulary::PIMO::Person()); + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Person()); newResource.addSymbol("user-identity"); d->m_nofResource.addIsRelated(newResource); } else if (d->m_index == 2) { - Nepomuk2::Resource newResource(d->m_resourceName->text(), Nepomuk2::Vocabulary::PIMO::Project()); + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Project()); newResource.addSymbol("project-development"); d->m_nofResource.addIsRelated(newResource); } else if (d->m_index == 3) { - Nepomuk2::Resource newResource(d->m_resourceName->text(), Nepomuk2::Vocabulary::PIMO::Task()); + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Task()); newResource.addSymbol("view-pim-tasks"); d->m_nofResource.addIsRelated(newResource); } else if (d->m_index == 4) { - Nepomuk2::Resource newResource(d->m_resourceName->text(), Nepomuk2::Vocabulary::PIMO::Location()); + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Location()); newResource.addSymbol("user-location"); d->m_nofResource.addIsRelated(newResource); } else if (d->m_index == 5) { - Nepomuk2::Resource newResource(d->m_resourceName->text(), Nepomuk2::Vocabulary::PIMO::Note()); + Nepomuk::Resource newResource(d->m_resourceName->text(), Nepomuk::Vocabulary::PIMO::Note()); newResource.addSymbol("knotes"); d->m_nofResource.addIsRelated(newResource); } diff --git a/src/urlbar/newresourcedialog.h b/src/urlbar/newresourcedialog.h index 7aacb358..651c631c 100644 --- a/src/urlbar/newresourcedialog.h +++ b/src/urlbar/newresourcedialog.h @@ -32,17 +32,17 @@ #include <KDialog> #include <KLineEdit> -#include <Nepomuk2/Resource> +#include <Nepomuk/Resource> -namespace Nepomuk2 +namespace Nepomuk { class NewResourceDialog : public KDialog { Q_OBJECT public: - explicit NewResourceDialog(int index, Nepomuk2::Resource& nfoResource, QWidget* parent = 0); + explicit NewResourceDialog(int index, Nepomuk::Resource& nfoResource, QWidget* parent = 0); virtual ~NewResourceDialog(); private Q_SLOTS: diff --git a/src/urlbar/resourcelinkdialog.cpp b/src/urlbar/resourcelinkdialog.cpp index dbff77b8..799171f2 100644 --- a/src/urlbar/resourcelinkdialog.cpp +++ b/src/urlbar/resourcelinkdialog.cpp @@ -54,22 +54,18 @@ #include <KIcon> // Nepomuk Includes -#include <Nepomuk2/Query/Term> -#include <Nepomuk2/Query/Result> -#include <Nepomuk2/Query/ResourceTypeTerm> -#include <Nepomuk2/Query/QueryServiceClient> -#include <Nepomuk2/Vocabulary/PIMO> -#include <Nepomuk2/Vocabulary/NCO> -#include <Nepomuk2/Query/QueryParser> -#include <Nepomuk2/Variant> - -// Nepomuk Ported Classes -#include "nepomuk/utils/simpleresourcemodel.h" - -// Soprano Includes -#include <Soprano/Vocabulary/NAO> - -class Nepomuk2::ResourceLinkDialog::Private +#include <Nepomuk/Utils/SimpleResourceModel> +#include <Nepomuk/Query/Term> +#include <Nepomuk/Query/Result> +#include <Nepomuk/Query/ResourceTypeTerm> +#include <Nepomuk/Query/QueryServiceClient> +#include <Nepomuk/Vocabulary/PIMO> +#include <Nepomuk/Vocabulary/NCO> +#include <Nepomuk/Query/QueryParser> +#include <Nepomuk/Variant> + + +class Nepomuk::ResourceLinkDialog::Private { public: void _k_selectionChanged(); @@ -86,20 +82,20 @@ public: QPushButton *m_newResourceButton; Utils::SimpleResourceModel *m_resourceModel; Utils::SimpleResourceModel *m_linkedResourceModel; - Nepomuk2::ResourceLinkDialog *q; + Nepomuk::ResourceLinkDialog *q; - Nepomuk2::Resource m_nfoResource; + Nepomuk::Resource m_nfoResource; }; -void Nepomuk2::ResourceLinkDialog::Private::_k_selectionChanged() +void Nepomuk::ResourceLinkDialog::Private::_k_selectionChanged() { q->enableButton(KDialog::User1, !m_resourceView->selectionModel()->selectedRows().isEmpty()); } -Nepomuk2::ResourceLinkDialog::ResourceLinkDialog(Nepomuk2::Resource &nfoResource, QWidget* parent): +Nepomuk::ResourceLinkDialog::ResourceLinkDialog(Nepomuk::Resource &nfoResource, QWidget* parent): KDialog(parent), d(new Private()) { @@ -186,21 +182,21 @@ Nepomuk2::ResourceLinkDialog::ResourceLinkDialog(Nepomuk2::Resource &nfoResource } -Nepomuk2::ResourceLinkDialog::~ResourceLinkDialog() +Nepomuk::ResourceLinkDialog::~ResourceLinkDialog() { delete d; } -void Nepomuk2::ResourceLinkDialog::setRelatedResources() +void Nepomuk::ResourceLinkDialog::setRelatedResources() { - QList<Nepomuk2::Resource> relatedResourceList = d->m_nfoResource.isRelateds(); + QList<Nepomuk::Resource> relatedResourceList = d->m_nfoResource.isRelateds(); d->m_linkedResourceModel->setResources(relatedResourceList); } -void Nepomuk2::ResourceLinkDialog::linkResourceSlot() +void Nepomuk::ResourceLinkDialog::linkResourceSlot() { QModelIndexList selectedResourceList; selectedResourceList << d->m_resourceView->selectionModel()->selectedIndexes(); @@ -213,16 +209,16 @@ void Nepomuk2::ResourceLinkDialog::linkResourceSlot() } -void Nepomuk2::ResourceLinkDialog::unlinkResourceSlot() +void Nepomuk::ResourceLinkDialog::unlinkResourceSlot() { - d->m_nfoResource.removeProperty(Soprano::Vocabulary::NAO::isRelated().toString(), + d->m_nfoResource.removeProperty(Nepomuk::Resource::isRelatedUri(), d->m_linkedResourceModel->resourceForIndex( d->m_linkedResources->selectionModel()->currentIndex())); setRelatedResources(); } -void Nepomuk2::ResourceLinkDialog::showContextMenu(const QPoint &pos) +void Nepomuk::ResourceLinkDialog::showContextMenu(const QPoint &pos) { d->m_removeResourceAction = new KAction(this); d->m_removeResourceAction->setText(i18n("&Unlink ")); @@ -236,9 +232,9 @@ void Nepomuk2::ResourceLinkDialog::showContextMenu(const QPoint &pos) } -void Nepomuk2::ResourceLinkDialog::createNewResourceSlot() +void Nepomuk::ResourceLinkDialog::createNewResourceSlot() { - QPointer<Nepomuk2::NewResourceDialog> r = new Nepomuk2::NewResourceDialog(d->m_resourceSelect->currentIndex(), d->m_nfoResource); + QPointer<Nepomuk::NewResourceDialog> r = new Nepomuk::NewResourceDialog(d->m_resourceSelect->currentIndex(), d->m_nfoResource); r->exec(); setRelatedResources(); @@ -247,60 +243,60 @@ void Nepomuk2::ResourceLinkDialog::createNewResourceSlot() } -void Nepomuk2::ResourceLinkDialog::dynamicSearchingSlot() +void Nepomuk::ResourceLinkDialog::dynamicSearchingSlot() { - Nepomuk2::Query::Query query; - Nepomuk2::Query::QueryServiceClient *test; + Nepomuk::Query::Query query; + Nepomuk::Query::QueryServiceClient *test; switch (d->m_resourceSelect->currentIndex()) { case 1: - query = Nepomuk2::Query::QueryParser::parseQuery(d->m_searchBox->text()); - query = query && Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Person()); - test = new Nepomuk2::Query::QueryServiceClient(this); + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Person()); + test = new Nepomuk::Query::QueryServiceClient(this); test->query(query); d->m_resourceModel->clear(); - connect(test, SIGNAL(newEntries(QList<Nepomuk2::Query::Result>)), - d->m_resourceModel, SLOT(addResults(QList<Nepomuk2::Query::Result>))); + connect(test, SIGNAL(newEntries(QList<Nepomuk::Query::Result>)), + d->m_resourceModel, SLOT(addResults(QList<Nepomuk::Query::Result>))); break; case 2: - query = Nepomuk2::Query::QueryParser::parseQuery(d->m_searchBox->text()); - query = query && Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Project()); - test = new Nepomuk2::Query::QueryServiceClient(this); + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Project()); + test = new Nepomuk::Query::QueryServiceClient(this); test->query(query); d->m_resourceModel->clear(); - connect(test, SIGNAL(newEntries(QList<Nepomuk2::Query::Result>)), - d->m_resourceModel, SLOT(addResults(QList<Nepomuk2::Query::Result>))); + connect(test, SIGNAL(newEntries(QList<Nepomuk::Query::Result>)), + d->m_resourceModel, SLOT(addResults(QList<Nepomuk::Query::Result>))); break; case 3: - query = Nepomuk2::Query::QueryParser::parseQuery(d->m_searchBox->text()); - query = query && Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Task()); - test = new Nepomuk2::Query::QueryServiceClient(this); + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Task()); + test = new Nepomuk::Query::QueryServiceClient(this); test->query(query); d->m_resourceModel->clear(); - connect(test, SIGNAL(newEntries(QList<Nepomuk2::Query::Result>)), - d->m_resourceModel, SLOT(addResults(QList<Nepomuk2::Query::Result>))); + connect(test, SIGNAL(newEntries(QList<Nepomuk::Query::Result>)), + d->m_resourceModel, SLOT(addResults(QList<Nepomuk::Query::Result>))); break; case 4: - query = Nepomuk2::Query::QueryParser::parseQuery(d->m_searchBox->text()); - query = query && Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Location()); - test = new Nepomuk2::Query::QueryServiceClient(this); + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Location()); + test = new Nepomuk::Query::QueryServiceClient(this); test->query(query); d->m_resourceModel->clear(); - connect(test, SIGNAL(newEntries(QList<Nepomuk2::Query::Result>)), - d->m_resourceModel, SLOT(addResults(QList<Nepomuk2::Query::Result>))); + connect(test, SIGNAL(newEntries(QList<Nepomuk::Query::Result>)), + d->m_resourceModel, SLOT(addResults(QList<Nepomuk::Query::Result>))); break; case 5: - query = Nepomuk2::Query::QueryParser::parseQuery(d->m_searchBox->text()); - query = query && Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Note()); - test = new Nepomuk2::Query::QueryServiceClient(this); + query = Nepomuk::Query::QueryParser::parseQuery(d->m_searchBox->text()); + query = query && Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Note()); + test = new Nepomuk::Query::QueryServiceClient(this); test->query(query); d->m_resourceModel->clear(); - connect(test, SIGNAL(newEntries(QList<Nepomuk2::Query::Result>)), - d->m_resourceModel, SLOT(addResults(QList<Nepomuk2::Query::Result>))); + connect(test, SIGNAL(newEntries(QList<Nepomuk::Query::Result>)), + d->m_resourceModel, SLOT(addResults(QList<Nepomuk::Query::Result>))); break; default: @@ -309,7 +305,7 @@ void Nepomuk2::ResourceLinkDialog::dynamicSearchingSlot() } -void Nepomuk2::ResourceLinkDialog::resourceSelectedSlot(int index) +void Nepomuk::ResourceLinkDialog::resourceSelectedSlot(int index) { enableButton(User1, true); d->m_newResourceButton->setEnabled(true); @@ -321,12 +317,12 @@ void Nepomuk2::ResourceLinkDialog::resourceSelectedSlot(int index) //List Personal Contacts if (index == 1) { - Nepomuk2::Query::Term term = Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Person()); - Nepomuk2::Query::Query query(term); + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Person()); + Nepomuk::Query::Query query(term); query.setLimit(20); - QList<Nepomuk2::Query::Result>results = Nepomuk2::Query::QueryServiceClient::syncQuery(query); - QList <Nepomuk2::Resource> resource; - Q_FOREACH(const Nepomuk2::Query::Result & result, results) + QList<Nepomuk::Query::Result>results = Nepomuk::Query::QueryServiceClient::syncQuery(query); + QList <Nepomuk::Resource> resource; + Q_FOREACH(const Nepomuk::Query::Result & result, results) { resource.append(result.resource()); } @@ -335,12 +331,12 @@ void Nepomuk2::ResourceLinkDialog::resourceSelectedSlot(int index) //List Projects else if (index == 2) { - Nepomuk2::Query::Term term = Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Project()); - Nepomuk2::Query::Query query(term); + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Project()); + Nepomuk::Query::Query query(term); query.setLimit(20); - QList<Nepomuk2::Query::Result>results = Nepomuk2::Query::QueryServiceClient::syncQuery(query); - QList <Nepomuk2::Resource> resource; - Q_FOREACH(const Nepomuk2::Query::Result & result, results) + QList<Nepomuk::Query::Result>results = Nepomuk::Query::QueryServiceClient::syncQuery(query); + QList <Nepomuk::Resource> resource; + Q_FOREACH(const Nepomuk::Query::Result & result, results) { resource.append(result.resource()); } @@ -349,12 +345,12 @@ void Nepomuk2::ResourceLinkDialog::resourceSelectedSlot(int index) //List Tasks else if (index == 3) { - Nepomuk2::Query::Term term = Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Task()); - Nepomuk2::Query::Query query(term); + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Task()); + Nepomuk::Query::Query query(term); query.setLimit(20); - QList<Nepomuk2::Query::Result>results = Nepomuk2::Query::QueryServiceClient::syncQuery(query); - QList <Nepomuk2::Resource> resource; - Q_FOREACH(const Nepomuk2::Query::Result & result, results) + QList<Nepomuk::Query::Result>results = Nepomuk::Query::QueryServiceClient::syncQuery(query); + QList <Nepomuk::Resource> resource; + Q_FOREACH(const Nepomuk::Query::Result & result, results) { resource.append(result.resource()); } @@ -363,12 +359,12 @@ void Nepomuk2::ResourceLinkDialog::resourceSelectedSlot(int index) //List Places else if (index == 4) { - Nepomuk2::Query::Term term = Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Location()); - Nepomuk2::Query::Query query(term); + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Location()); + Nepomuk::Query::Query query(term); query.setLimit(20); - QList<Nepomuk2::Query::Result>results = Nepomuk2::Query::QueryServiceClient::syncQuery(query); - QList <Nepomuk2::Resource> resource; - Q_FOREACH(const Nepomuk2::Query::Result & result, results) + QList<Nepomuk::Query::Result>results = Nepomuk::Query::QueryServiceClient::syncQuery(query); + QList <Nepomuk::Resource> resource; + Q_FOREACH(const Nepomuk::Query::Result & result, results) { resource.append(result.resource()); } @@ -377,12 +373,12 @@ void Nepomuk2::ResourceLinkDialog::resourceSelectedSlot(int index) //List Notes else if (index == 5) { - Nepomuk2::Query::Term term = Nepomuk2::Query::ResourceTypeTerm(Nepomuk2::Vocabulary::PIMO::Note()); - Nepomuk2::Query::Query query(term); + Nepomuk::Query::Term term = Nepomuk::Query::ResourceTypeTerm(Nepomuk::Vocabulary::PIMO::Note()); + Nepomuk::Query::Query query(term); query.setLimit(20); - QList<Nepomuk2::Query::Result>results = Nepomuk2::Query::QueryServiceClient::syncQuery(query); - QList <Nepomuk2::Resource> resource; - Q_FOREACH(const Nepomuk2::Query::Result & result, results) + QList<Nepomuk::Query::Result>results = Nepomuk::Query::QueryServiceClient::syncQuery(query); + QList <Nepomuk::Resource> resource; + Q_FOREACH(const Nepomuk::Query::Result & result, results) { resource.append(result.resource()); } diff --git a/src/urlbar/resourcelinkdialog.h b/src/urlbar/resourcelinkdialog.h index 689ef4fe..e628aa10 100644 --- a/src/urlbar/resourcelinkdialog.h +++ b/src/urlbar/resourcelinkdialog.h @@ -36,7 +36,7 @@ #include <KConfigDialog> -namespace Nepomuk2 +namespace Nepomuk { class Resource; @@ -50,7 +50,7 @@ class ResourceLinkDialog : public KDialog Q_OBJECT public: - explicit ResourceLinkDialog(Nepomuk2::Resource& nfoResource, QWidget* parent = 0); + explicit ResourceLinkDialog(Nepomuk::Resource& nfoResource, QWidget* parent = 0); virtual ~ResourceLinkDialog(); void setRelatedResources(); |