~ubuntu-branches/ubuntu/natty/kdebase-runtime/natty-updates

« back to all changes in this revision

Viewing changes to nepomuk/services/strigi/indexscheduler.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-12-07 11:41:36 UTC
  • mfrom: (1.1.47 upstream)
  • Revision ID: james.westby@ubuntu.com-20101207114136-2yocncb7051tmobj
Tags: 4:4.5.85-0ubuntu1
New upstream beta release

Show diffs side-by-side

added added

removed removed

Lines of Context:
242
242
    // initialization
243
243
    queueAllFoldersForUpdate();
244
244
 
 
245
#ifndef NDEBUG
 
246
    QTime timer;
 
247
    timer.start();
 
248
#endif
 
249
 
245
250
    removeOldAndUnwantedEntries();
246
251
 
 
252
#ifndef NDEBUG
 
253
    kDebug() << "Removed old entries:" << timer.elapsed();
 
254
    timer.restart();
 
255
#endif
 
256
 
247
257
    while ( waitForContinue() ) {
248
258
        // wait for more dirs to analyze in case the initial
249
259
        // indexing is done
250
260
        if ( m_dirsToUpdate.isEmpty() ) {
251
261
            setIndexingStarted( false );
252
262
 
 
263
#ifndef NDEBUG
 
264
            kDebug() << "All folders updated:" << timer.elapsed();
 
265
#endif
 
266
 
253
267
            m_dirsToUpdateMutex.lock();
254
268
            m_dirsToUpdateWc.wait( &m_dirsToUpdateMutex );
255
269
            m_dirsToUpdateMutex.unlock();
256
270
 
 
271
#ifndef NDEBUG
 
272
            timer.restart();
 
273
#endif
 
274
 
257
275
            if ( !m_stopped )
258
276
                setIndexingStarted( true );
259
277
        }
619
637
    // Remove data which is useless but still around from before. This could happen due to some buggy version of
620
638
    // the indexer or the filewatch service or even some application messing up the data.
621
639
    // We look for indexed files that do not have a nie:url defined and thus, will never be catched by any of the
622
 
    // other queries.
 
640
    // other queries. In addition we check for an isPartOf relation since strigi produces EmbeddedFileDataObjects
 
641
    // for video and audio streams.
623
642
    //
624
643
    Query::Query q(
625
644
        Strigi::Ontology::indexGraphFor() == ( Soprano::Vocabulary::RDF::type() == Query::ResourceTerm( Nepomuk::Vocabulary::NFO::FileDataObject() ) &&
626
 
                                               !( Nepomuk::Vocabulary::NIE::url() == Query::Term() ) )
 
645
                                               !( Nepomuk::Vocabulary::NIE::url() == Query::Term() ) &&
 
646
                                               !( Nepomuk::Vocabulary::NIE::isPartOf() == Query::Term() ) )
627
647
        );
628
648
    q.setQueryFlags(Query::Query::NoResultRestrictions);
629
649
    query = q.toSparqlQuery();