Hello community,

here is the log from the commit of package nepomuk-core for openSUSE:12.3 
checked in at 2013-02-15 18:48:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3/nepomuk-core (Old)
 and      /work/SRC/openSUSE:12.3/.nepomuk-core.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nepomuk-core", Maintainer is ""

Changes:
--------
--- /work/SRC/openSUSE:12.3/nepomuk-core/nepomuk-core.changes   2013-02-12 
12:53:46.000000000 +0100
+++ /work/SRC/openSUSE:12.3/.nepomuk-core.new/nepomuk-core.changes      
2013-02-15 18:48:25.000000000 +0100
@@ -1,0 +2,10 @@
+Thu Feb 14 20:20:49 UTC 2013 - hrvoje.sen...@gmail.com
+
+- Added fileindexer-do-not-use-QDirIterators-in-the-queues.patch,
+  fixes kde#310777 that caused multiple crashes
+- Added initialize-the-m_indexhidden-variable.patch, fixes not 
+  respecting users hidden folders indexing setting
+- Added initialize-m_state-to-its-correct-value.patch, initializes
+  fileindexer state with correct value
+
+-------------------------------------------------------------------

New:
----
  fileindexer-do-not-use-QDirIterators-in-the-queues.patch
  initialize-m_state-to-its-correct-value.patch
  initialize-the-m_indexhidden-variable.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ nepomuk-core.spec ++++++
--- /var/tmp/diff_new_pack.WsqRUp/_old  2013-02-15 18:48:29.000000000 +0100
+++ /var/tmp/diff_new_pack.WsqRUp/_new  2013-02-15 18:48:29.000000000 +0100
@@ -48,6 +48,12 @@
 Patch3:         emit-the-current-signals-in-propertychanged.diff
 # PATCH-FIX-UPSTREAM do-not-auto-update-the-cache-by-default.diff
 Patch4:         do-not-auto-update-the-cache-by-default.diff
+# PATCH-FIX-UPSTREAM fileindexer-do-not-use-QDirIterators-in-the-queues.patch
+Patch5:         fileindexer-do-not-use-QDirIterators-in-the-queues.patch
+# PATCH-FIX-UPSTREAM initialize-the-m_indexhidden-variable.patch
+Patch6:         initialize-the-m_indexhidden-variable.patch
+# PATCH-FIX-UPSTREAM initialize-m_state-to-its-correct-value.patch
+Patch7:         initialize-m_state-to-its-correct-value.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Requires:       kdelibs4 >= %version
 Requires:       soprano-backend-redland
@@ -73,6 +79,9 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
+%patch7 -p1
 
 %build
   %cmake_kde4 -d build -- -DKDE4_ENABLE_FPIE=1

++++++ fileindexer-do-not-use-QDirIterators-in-the-queues.patch ++++++
>From 630939e388beb4eaf6387a4f9bb827a87fdd0478 Mon Sep 17 00:00:00 2001
From: Vishesh Handa <m...@vhanda.in>
Date: Thu, 14 Feb 2013 13:10:05 +0530
Subject: [PATCH 1/5] FileIndexer: Do not use QDirIterators in the queues

A DirIterator works by opening the directory (as a file) and reading its
contents, which are the list of files in that directory. As long as the
dirIterator is open, it consumes one file descriptor.

When iterating over all the folders, by using QDirIterator, we open a
new file descriptor per directory. Since we traverse the file system via
breadth first, the number of valid QDirIterators can get quite high.
This sometimes results in us exceeding the number of file descriptors
required which results in a crash, cause QProcess doesn't handle running
out of file descriptors.

Instead we now just iterate over all the directories and store them as
strings. This may consume more memory, but it is better than a crash.

BUG: 310777
REVIEW: 108950
---
 services/fileindexer/basicindexingqueue.cpp | 39 +++++------------------------
 services/fileindexer/basicindexingqueue.h   |  1 -
 2 files changed, 6 insertions(+), 34 deletions(-)

diff --git a/services/fileindexer/basicindexingqueue.cpp 
b/services/fileindexer/basicindexingqueue.cpp
index b581786..074d021 100644
--- a/services/fileindexer/basicindexingqueue.cpp
+++ b/services/fileindexer/basicindexingqueue.cpp
@@ -44,12 +44,6 @@ void BasicIndexingQueue::clear()
     m_currentUrl.clear();
     m_currentFlags = NoUpdateFlags;
     m_paths.clear();
-
-    typedef QPair<QDirIterator*, UpdateDirFlags> DirPair;
-    foreach( const DirPair& pair, m_iterators )
-        delete pair.first;
-
-    m_iterators.clear();
 }
 
 void BasicIndexingQueue::clear(const QString& path)
@@ -60,16 +54,6 @@ void BasicIndexingQueue::clear(const QString& path)
         if( it.value().first.startsWith( path ) )
             it.remove();
     }
-
-    QMutableListIterator< QPair<QDirIterator*, UpdateDirFlags> > iter( 
m_iterators );
-    while( iter.hasNext() ) {
-        QDirIterator* dirIter =  iter.next().first;
-
-        if( dirIter->path().startsWith( path ) ) {
-            iter.remove();
-            delete dirIter;
-        }
-    }
 }
 
 QUrl BasicIndexingQueue::currentUrl() const
@@ -85,7 +69,7 @@ UpdateDirFlags BasicIndexingQueue::currentFlags() const
 
 bool BasicIndexingQueue::isEmpty()
 {
-    return m_iterators.isEmpty() && m_paths.isEmpty();
+    return m_paths.isEmpty();
 }
 
 void BasicIndexingQueue::enqueue(const QString& path)
@@ -111,20 +95,7 @@ void BasicIndexingQueue::processNextIteration()
 {
     bool processingFile = false;
 
-    // First process all the iterators and then the paths
-    if( !m_iterators.isEmpty() ) {
-        QPair< QDirIterator*, UpdateDirFlags > pair = m_iterators.first();
-        QDirIterator* dirIt = pair.first;
-
-        if( dirIt->hasNext() ) {
-            processingFile = process( dirIt->next(), pair.second );
-        }
-        else {
-            delete m_iterators.dequeue().first;
-        }
-    }
-
-    else if( !m_paths.isEmpty() ) {
+    if( !m_paths.isEmpty() ) {
         QPair< QString, UpdateDirFlags > pair = m_paths.dequeue();
         processingFile = process( pair.first, pair.second );
     }
@@ -160,8 +131,10 @@ bool BasicIndexingQueue::process(const QString& path, 
UpdateDirFlags flags)
         if( recursive && !info.isSymLink() && shouldIndexContents(path) ) {
             QDir::Filters dirFilter = 
QDir::NoDotAndDotDot|QDir::Readable|QDir::Files|QDir::Dirs;
 
-            QPair<QDirIterator*, UpdateDirFlags> pair = qMakePair( new 
QDirIterator( path, dirFilter ), flags );
-            m_iterators.enqueue( pair );
+            QDirIterator it( path, dirFilter );
+            while( it.hasNext() ) {
+                m_paths.enqueue( qMakePair(it.next(), flags) );
+            }
         }
     }
     else if( info.isFile() && (forced || indexingRequired) ) {
diff --git a/services/fileindexer/basicindexingqueue.h 
b/services/fileindexer/basicindexingqueue.h
index 5d1c190..ca02996 100644
--- a/services/fileindexer/basicindexingqueue.h
+++ b/services/fileindexer/basicindexingqueue.h
@@ -106,7 +106,6 @@ namespace Nepomuk2 {
         bool process(const QString& path, Nepomuk2::UpdateDirFlags flags);
 
         QQueue< QPair<QString, UpdateDirFlags> > m_paths;
-        QQueue< QPair<QDirIterator*, UpdateDirFlags> > m_iterators;
 
         QUrl m_currentUrl;
         QString m_currentMimeType;
-- 
1.8.1.2

++++++ initialize-m_state-to-its-correct-value.patch ++++++
>From e513160f4cf45d7e5967f8f41bd65be26ffd8dcd Mon Sep 17 00:00:00 2001
From: Vishesh Handa <m...@vhanda.in>
Date: Thu, 14 Feb 2013 16:05:06 +0530
Subject: [PATCH 3/5] IndexScheduler: Initialize m_state to its correct value

---
 services/fileindexer/indexscheduler.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/services/fileindexer/indexscheduler.cpp 
b/services/fileindexer/indexscheduler.cpp
index 9831d2d..967d69b 100644
--- a/services/fileindexer/indexscheduler.cpp
+++ b/services/fileindexer/indexscheduler.cpp
@@ -108,6 +108,7 @@ Nepomuk2::IndexScheduler::IndexScheduler( QObject* parent )
     m_cleaner = new IndexCleaner(this);
     connect( m_cleaner, SIGNAL(finished(KJob*)), this, 
SLOT(slotCleaningDone()) );
     m_cleaner->start();
+    m_state = State_Cleaning;
 
     // Special settings for the queues
     KConfig config( "nepomukstrigirc" );
-- 
1.8.1.2

++++++ initialize-the-m_indexhidden-variable.patch ++++++
>From 72fe0a9a09eac0099d43c40798a643e0eee01f77 Mon Sep 17 00:00:00 2001
From: Vishesh Handa <m...@vhanda.in>
Date: Thu, 14 Feb 2013 16:03:56 +0530
Subject: [PATCH 2/5] FileIndexerConfig: Initialize the m_indexHidden variable

---
 services/fileindexer/fileindexerconfig.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/services/fileindexer/fileindexerconfig.cpp 
b/services/fileindexer/fileindexerconfig.cpp
index 801097e..13a14cf 100644
--- a/services/fileindexer/fileindexerconfig.cpp
+++ b/services/fileindexer/fileindexerconfig.cpp
@@ -51,8 +51,9 @@ namespace {
 Nepomuk2::FileIndexerConfig* Nepomuk2::FileIndexerConfig::s_self = 0;
 
 Nepomuk2::FileIndexerConfig::FileIndexerConfig(QObject* parent)
-    : QObject(parent),
-      m_config( "nepomukstrigirc" )
+    : QObject(parent)
+    , m_config( "nepomukstrigirc" )
+    , m_indexHidden(false)
 {
     if(!s_self) {
         s_self = this;
@@ -134,7 +135,6 @@ QStringList Nepomuk2::FileIndexerConfig::excludeFilters() 
const
 bool Nepomuk2::FileIndexerConfig::indexHiddenFilesAndFolders() const
 {
     return m_indexHidden;
-    return m_config.group( "General" ).readEntry( "index hidden folders", 
false );
 }
 
 
-- 
1.8.1.2



-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to