[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [kde-runtime/KDE/4.10] nepomuk/kioslaves/tags: Tags Root Url: Show the tags incrementally
From:       Sebastian TrĂ¼g <sebastian () trueg ! de>
Date:       2013-02-25 9:33:22
Message-ID: 512B2FE2.1010701 () trueg ! de
[Download RAW message or body]



On 02/19/2013 11:09 AM, Vishesh Handa wrote:
> Git commit 7422cacacfeacc92acc7c34559305e34f2cb0375 by Vishesh Handa.
> Committed on 15/02/2013 at 09:12.
> Pushed by vhanda into branch 'KDE/4.10'.
> 
> Tags Root Url: Show the tags incrementally
> 
> Instead of fetching all the tags on startup and then showing all of
> them, we can display them as we are fetching them.
> 
> Also, only load the entire tag list when required.
> 
> M  +8    -3    nepomuk/kioslaves/tags/kio_tags.cpp
> 
> http://commits.kde.org/kde-runtime/7422cacacfeacc92acc7c34559305e34f2cb0375
> 
> diff --git a/nepomuk/kioslaves/tags/kio_tags.cpp \
> b/nepomuk/kioslaves/tags/kio_tags.cpp index 498873f..e64d214 100644
> --- a/nepomuk/kioslaves/tags/kio_tags.cpp
> +++ b/nepomuk/kioslaves/tags/kio_tags.cpp
> @@ -57,8 +57,6 @@ using namespace Soprano::Vocabulary;
> TagsProtocol::TagsProtocol(const QByteArray& pool_socket, const QByteArray& \
> app_socket) : KIO::ForwardingSlaveBase("tags", pool_socket, app_socket)
> {
> -    // Load all the tag uris on start so that they are always there in the cache
> -    m_allTags = Tag::allTags();
> }
> 
> TagsProtocol::~TagsProtocol()
> @@ -109,8 +107,15 @@ void TagsProtocol::listDir(const KUrl& url)
> 
> case RootUrl: {
> kDebug() << "Root Url";
> -            foreach( const Tag& tag, m_allTags ) {
> +
> +            QLatin1String query("select ?r where { ?r a nao:Tag . }");

might want to add a "distinct" here.

> +            Soprano::Model* model = ResourceManager::instance()->mainModel();
> +            Soprano::QueryResultIterator it = model->executeQuery( query, \
> Soprano::Query::QueryLanguageSparql ); +            while( it.next() ) {
> +                Tag tag( it[0].uri() );
> listEntry( createUDSEntryForTag(tag), false );
> +
> +                m_allTags << tag;
> }
> 
> listEntry( KIO::UDSEntry(), true );
> 
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic