]> git.pld-linux.org Git - packages/kde4-nepomuk-core.git/blob - nepomuk-core-recursive-indexing.patch
- rel 2; recursive indexing fix
[packages/kde4-nepomuk-core.git] / nepomuk-core-recursive-indexing.patch
1 commit b651f9231ac30072418bb06d602951f0f05da22c
2 Author: Vishesh Handa <me@vhanda.in>
3 Date:   Sat Feb 9 02:28:33 2013 +0530
4
5     Revert "BasicIndexingQueue: Use stacks instead of queues"
6     
7     This reverts commit 2f33141aa6716550e38b11ec9a0b000dd74eea79.
8     
9     The commit breaks recursive indexing. Doh!
10     
11     BUG: 314559
12
13 diff --git a/services/fileindexer/basicindexingqueue.cpp b/services/fileindexer/basicindexingqueue.cpp
14 index a295330..b581786 100644
15 --- a/services/fileindexer/basicindexingqueue.cpp
16 +++ b/services/fileindexer/basicindexingqueue.cpp
17 @@ -54,14 +54,14 @@ void BasicIndexingQueue::clear()
18  
19  void BasicIndexingQueue::clear(const QString& path)
20  {
21 -    QMutableVectorIterator< QPair<QString, UpdateDirFlags> > it( m_paths );
22 +    QMutableListIterator< QPair<QString, UpdateDirFlags> > it( m_paths );
23      while( it.hasNext() ) {
24          it.next();
25          if( it.value().first.startsWith( path ) )
26              it.remove();
27      }
28  
29 -    QMutableVectorIterator< QPair<QDirIterator*, UpdateDirFlags> > iter( m_iterators );
30 +    QMutableListIterator< QPair<QDirIterator*, UpdateDirFlags> > iter( m_iterators );
31      while( iter.hasNext() ) {
32          QDirIterator* dirIter =  iter.next().first;
33  
34 @@ -100,7 +100,7 @@ void BasicIndexingQueue::enqueue(const QString& path, UpdateDirFlags flags)
35  {
36      kDebug() << path;
37      bool wasEmpty = m_paths.empty();
38 -    m_paths.push( qMakePair( path, flags ) );
39 +    m_paths.enqueue( qMakePair( path, flags ) );
40      callForNextIteration();
41  
42      if( wasEmpty )
43 @@ -120,12 +120,12 @@ void BasicIndexingQueue::processNextIteration()
44              processingFile = process( dirIt->next(), pair.second );
45          }
46          else {
47 -            delete m_iterators.pop().first;
48 +            delete m_iterators.dequeue().first;
49          }
50      }
51  
52      else if( !m_paths.isEmpty() ) {
53 -        QPair< QString, UpdateDirFlags > pair = m_paths.pop();
54 +        QPair< QString, UpdateDirFlags > pair = m_paths.dequeue();
55          processingFile = process( pair.first, pair.second );
56      }
57  
58 @@ -161,7 +161,7 @@ bool BasicIndexingQueue::process(const QString& path, UpdateDirFlags flags)
59              QDir::Filters dirFilter = QDir::NoDotAndDotDot|QDir::Readable|QDir::Files|QDir::Dirs;
60  
61              QPair<QDirIterator*, UpdateDirFlags> pair = qMakePair( new QDirIterator( path, dirFilter ), flags );
62 -            m_iterators.push( pair );
63 +            m_iterators.enqueue( pair );
64          }
65      }
66      else if( info.isFile() && (forced || indexingRequired) ) {
67 @@ -259,12 +259,6 @@ void BasicIndexingQueue::slotIndexingFinished(KJob* job)
68  
69      emit endIndexingFile( url );
70  
71 -    // Give back the memory
72 -    if( m_paths.isEmpty() )
73 -        m_paths.clear();
74 -    if( m_iterators.isEmpty() )
75 -        m_iterators.clear();
76 -
77      // Continue the queue
78      finishIteration();
79  }
80 diff --git a/services/fileindexer/basicindexingqueue.h b/services/fileindexer/basicindexingqueue.h
81 index 29dd9fd..5d1c190 100644
82 --- a/services/fileindexer/basicindexingqueue.h
83 +++ b/services/fileindexer/basicindexingqueue.h
84 @@ -23,7 +23,6 @@
85  
86  #include "indexingqueue.h"
87  #include <KJob>
88 -#include <QtCore/QStack>
89  
90  namespace Nepomuk2 {
91  
92 @@ -106,8 +105,8 @@ namespace Nepomuk2 {
93           */
94          bool process(const QString& path, Nepomuk2::UpdateDirFlags flags);
95  
96 -        QStack< QPair<QString, UpdateDirFlags> > m_paths;
97 -        QStack< QPair<QDirIterator*, UpdateDirFlags> > m_iterators;
98 +        QQueue< QPair<QString, UpdateDirFlags> > m_paths;
99 +        QQueue< QPair<QDirIterator*, UpdateDirFlags> > m_iterators;
100  
101          QUrl m_currentUrl;
102          QString m_currentMimeType;
This page took 0.030879 seconds and 3 git commands to generate.