Hello community,

here is the log from the commit of package nepomuk-core for openSUSE:Factory 
checked in at 2013-09-09 11:08:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nepomuk-core (Old)
 and      /work/SRC/openSUSE:Factory/.nepomuk-core.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "nepomuk-core"

Changes:
--------
--- /work/SRC/openSUSE:Factory/nepomuk-core/nepomuk-core.changes        
2013-08-16 13:48:53.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.nepomuk-core.new/nepomuk-core.changes   
2013-09-09 11:08:43.000000000 +0200
@@ -1,0 +2,17 @@
+Tue Sep  3 18:54:32 UTC 2013 - [email protected]
+
+- Added patches from upstream for resolving kde#324307 (Nepomukindexer
+  segfaults then core dumps ad finitum using 100% CPU):
+   0002-Indexer-and-epubextractor-check-more-carefully-that-.patch
+   0003-FileIndexer-Really-do-not-index-file-multiple-times.patch
+   0001-epubextractor-Fix-crash-on-some-invalid-files-where-.patch
+   0004-FileIndexer-Check-for-nepomukindexer-crashing.patch
+
+-------------------------------------------------------------------
+Sun Sep  1 10:07:11 UTC 2013 - [email protected]
+
+- Update to 4.11.1
+   * KDE 4.11.1 bugfix release
+   * See http://www.kde.org/announcements/announce-4.11.1.php
+
+-------------------------------------------------------------------

Old:
----
  nepomuk-core-4.11.0.tar.xz

New:
----
  0001-epubextractor-Fix-crash-on-some-invalid-files-where-.patch
  0002-Indexer-and-epubextractor-check-more-carefully-that-.patch
  0003-FileIndexer-Really-do-not-index-file-multiple-times.patch
  0004-FileIndexer-Check-for-nepomukindexer-crashing.patch
  nepomuk-core-4.11.1.tar.xz

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

Other differences:
------------------
++++++ nepomuk-core.spec ++++++
--- /var/tmp/diff_new_pack.ehSk6O/_old  2013-09-09 11:08:44.000000000 +0200
+++ /var/tmp/diff_new_pack.ehSk6O/_new  2013-09-09 11:08:44.000000000 +0200
@@ -19,7 +19,7 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 
 Name:           nepomuk-core
-Version:        4.11.0
+Version:        4.11.1
 Release:        0
 Summary:        The KDE Nepomuk Core Library
 License:        GPL-2.0+
@@ -29,6 +29,14 @@
 Source99:       nepomuk.png
 # PATCH-FIX-OPENSUSE kauth.patch disable installing of kauth actions until 
bnc#825262 is resolved
 Patch0:         kauth.patch
+# PATCH-FIX-UPSTREAM 
0001-epubextractor-Fix-crash-on-some-invalid-files-where-.patch (kde#324307)
+Patch1000:      0001-epubextractor-Fix-crash-on-some-invalid-files-where-.patch
+# PATCH-FIX-UPSTREAM 
0002-Indexer-and-epubextractor-check-more-carefully-that-.patch (kde#324307)
+Patch1001:      0002-Indexer-and-epubextractor-check-more-carefully-that-.patch
+# PATCH-FIX-UPSTREAM 
0003-FileIndexer-Really-do-not-index-file-multiple-times.patch (kde#324307)
+Patch1002:      0003-FileIndexer-Really-do-not-index-file-multiple-times.patch
+# PATCH-FIX-UPSTREAM 0004-FileIndexer-Check-for-nepomukindexer-crashing.patch 
(kde#324307)
+Patch1003:      0004-FileIndexer-Check-for-nepomukindexer-crashing.patch
 BuildRequires:  fdupes
 BuildRequires:  libepub-devel
 BuildRequires:  libexiv2-devel
@@ -62,6 +70,10 @@
 %prep
 %setup -q -n %{name}-%{version}
 %patch0 -p1
+%patch1000 -p1
+%patch1001 -p1
+%patch1002 -p1
+%patch1003 -p1
 
 %build
   %cmake_kde4 -d build -- -DKDE4_ENABLE_FPIE=1

++++++ 0001-epubextractor-Fix-crash-on-some-invalid-files-where-.patch ++++++
>From 37f5c9df266e93e4257dfd4c39bdcb3061a837a1 Mon Sep 17 00:00:00 2001
From: Simeon Bird <[email protected]>
Date: Tue, 3 Sep 2013 00:08:23 -0400
Subject: [PATCH 1/4] epubextractor: Fix crash on some invalid files where
 epub_get_data returns an error.

BUG: 324307
---
 services/fileindexer/indexer/epubextractor.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/services/fileindexer/indexer/epubextractor.cpp 
b/services/fileindexer/indexer/epubextractor.cpp
index 38fb0d8..363f9b8 100644
--- a/services/fileindexer/indexer/epubextractor.cpp
+++ b/services/fileindexer/indexer/epubextractor.cpp
@@ -188,7 +188,7 @@ SimpleResourceGraph EPubExtractor::extract(const QUrl& 
resUri, const QUrl& fileU
         tit = epub_get_titerator(ePubDoc, TITERATOR_GUIDE, 0 );
     }
 
-    if( tit ) {
+    if( epub_tit_curr_valid(tit) ) {
         do {
             char *clink = epub_tit_get_curr_link(tit);
 
@@ -196,7 +196,8 @@ SimpleResourceGraph EPubExtractor::extract(const QUrl& 
resUri, const QUrl& fileU
             int size = epub_get_data(ePubDoc, clink, &data);
             free(clink);
 
-            if( data ) {
+            // epub_get_data returns -1 on failure
+            if( size > 0 && data ) {
                 QString html = QString::fromUtf8(data, size);
 
                 QTextDocument doc;
-- 
1.8.4

++++++ 0002-Indexer-and-epubextractor-check-more-carefully-that-.patch ++++++
>From 9a4dcb1bffaef6c70a256fb3c2a759e6586e0da5 Mon Sep 17 00:00:00 2001
From: Simeon Bird <[email protected]>
Date: Tue, 3 Sep 2013 00:43:25 -0400
Subject: [PATCH 2/4] Indexer and epubextractor: check more carefully that
 graphs are not empty.

In particular, in the indexer we check that the graph is
non-empty, but then we remove the plain text content, so we need to
check again.

BUG: 324307
REVIEW: 112476
---
 services/fileindexer/indexer/epubextractor.cpp |  3 ++-
 services/fileindexer/indexer/indexer.cpp       | 31 ++++++++++++++++----------
 2 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/services/fileindexer/indexer/epubextractor.cpp 
b/services/fileindexer/indexer/epubextractor.cpp
index 363f9b8..cd1d0a5 100644
--- a/services/fileindexer/indexer/epubextractor.cpp
+++ b/services/fileindexer/indexer/epubextractor.cpp
@@ -215,7 +215,8 @@ SimpleResourceGraph EPubExtractor::extract(const QUrl& 
resUri, const QUrl& fileU
     if( !plainText.isEmpty() )
         fileRes.addProperty( NIE::plainTextContent(), plainText );
 
-    graph << fileRes;
+    if( fileRes.isValid() )
+        graph << fileRes;
     return graph;
 }
 
diff --git a/services/fileindexer/indexer/indexer.cpp 
b/services/fileindexer/indexer/indexer.cpp
index 46b5cfe..d188ef7 100644
--- a/services/fileindexer/indexer/indexer.cpp
+++ b/services/fileindexer/indexer/indexer.cpp
@@ -154,20 +154,27 @@ bool Nepomuk2::Indexer::fileIndex(const QUrl& uri, const 
QUrl& url, const QStrin
         if( vl.size() == 1 ) {
             plainText = vl.first().toString();
             graph[uri].remove( NIE::plainTextContent() );
+            // Check that the SimpleResource is still valid:
+            // if it only contained text it may not be.
+            if ( !graph[uri].isValid() )
+                graph.remove(uri);
         }
 
-        QHash<QUrl, QVariant> additionalMetadata;
-        additionalMetadata.insert( RDF::type(), NRL::DiscardableInstanceBase() 
);
-
-        // we do not have an event loop - thus, we need to delete the job 
ourselves
-        QScopedPointer<StoreResourcesJob> job( Nepomuk2::storeResources( 
graph, IdentifyNew,
-                                                                         
NoStoreResourcesFlags, additionalMetadata ) );
-        job->setAutoDelete(false);
-        job->exec();
-        if( job->error() ) {
-            m_lastError = job->errorString();
-            kError() << "SimpleIndexerError: " << m_lastError;
-            return false;
+        // Check again that the graph is not empty: it may have only contained 
text
+        if( !graph.isEmpty() ) {
+            QHash<QUrl, QVariant> additionalMetadata;
+            additionalMetadata.insert( RDF::type(), 
NRL::DiscardableInstanceBase() );
+
+            // we do not have an event loop - thus, we need to delete the job 
ourselves
+            QScopedPointer<StoreResourcesJob> job( Nepomuk2::storeResources( 
graph, IdentifyNew,
+                                                                             
NoStoreResourcesFlags, additionalMetadata ) );
+            job->setAutoDelete(false);
+            job->exec();
+            if( job->error() ) {
+                m_lastError = job->errorString();
+                kError() << "SimpleIndexerError: " << m_lastError;
+                return false;
+            }
         }
 
         if( plainText.length() ) {
-- 
1.8.4

++++++ 0003-FileIndexer-Really-do-not-index-file-multiple-times.patch ++++++
>From d14700f5a02653260aa1129eb718f69d33e5c8a5 Mon Sep 17 00:00:00 2001
From: Simeon Bird <[email protected]>
Date: Tue, 3 Sep 2013 02:05:34 -0400
Subject: [PATCH 3/4] FileIndexer: Really do not index file multiple times

In commit c441198286562924ad3980527913b4888bdcb7a6
I attempted to implement not re-indexing files which failed to index.

However, my code made no sense!

It attempted to set kext::indexingLevel to -1 if the nepomukindexer job
returned with an error. But, the KJob never set an error even if the
indexer returned 1, so nothing happened.

Even when this was fixed, it still didn't work, because I was updating
the indexingLevel of the current filename, not the resource URI of the
current filename.

So, to summarise, I was silly. This one works, and an easy way to test
it is to replace /usr/bin/nepomukindexer with:

 #!/bin/bash
 exit 1

BUG: 324307
---
 services/fileindexer/fileindexingjob.cpp   | 17 +++++++++++------
 services/fileindexer/fileindexingqueue.cpp | 14 +++++++++++---
 2 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/services/fileindexer/fileindexingjob.cpp 
b/services/fileindexer/fileindexingjob.cpp
index 5878e7b..b344596 100644
--- a/services/fileindexer/fileindexingjob.cpp
+++ b/services/fileindexer/fileindexingjob.cpp
@@ -100,11 +100,15 @@ void Nepomuk2::FileIndexingJob::slotIndexedFile(int 
exitCode)
     m_processTimer->stop();
 
     //kDebug() << "Indexing of " << m_url.toLocalFile() << "finished with exit 
code" << exitCode;
-    if(exitCode == 1 && FileIndexerConfig::self()->isDebugModeEnabled()) {
-        QFile errorLogFile(KStandardDirs::locateLocal("data", 
QLatin1String("nepomuk/file-indexer-error-log"), true));
-        if(errorLogFile.open(QIODevice::Append)) {
-            QTextStream s(&errorLogFile);
-            s << m_url.toLocalFile() << ": " << 
QString::fromLocal8Bit(m_process->readAllStandardOutput()) << endl;
+    if(exitCode == 1) {
+        setError( KJob::UserDefinedError );
+        setErrorText( QLatin1String( "Indexer process returned with an error 
for" ) + m_url.toLocalFile() );
+        if(FileIndexerConfig::self()->isDebugModeEnabled()) {
+            QFile errorLogFile(KStandardDirs::locateLocal("data", 
QLatin1String("nepomuk/file-indexer-error-log"), true));
+            if(errorLogFile.open(QIODevice::Append)) {
+                QTextStream s(&errorLogFile);
+                s << m_url.toLocalFile() << ": " << 
QString::fromLocal8Bit(m_process->readAllStandardOutput()) << endl;
+            }
         }
     }
     emitResult();
@@ -112,10 +116,11 @@ void Nepomuk2::FileIndexingJob::slotIndexedFile(int 
exitCode)
 
 void Nepomuk2::FileIndexingJob::slotProcessTimerTimeout()
 {
-    kDebug() << "Killing the indexer process which seems stuck for" << m_url;
     m_process->disconnect(this);
     m_process->kill();
     m_process->waitForFinished();
+    setError( KJob::KilledJobError );
+    setErrorText( QLatin1String("Indexer process got stuck for") + 
m_url.toLocalFile() );
     emitResult();
 }
 
diff --git a/services/fileindexer/fileindexingqueue.cpp 
b/services/fileindexer/fileindexingqueue.cpp
index 7a2d6cb..0a66746 100644
--- a/services/fileindexer/fileindexingqueue.cpp
+++ b/services/fileindexer/fileindexingqueue.cpp
@@ -97,9 +97,17 @@ void FileIndexingQueue::slotFinishedIndexingFile(KJob* job)
 {
     if( job->error() ) {
         kDebug() << job->errorString();
-        // Update the indexing level to -1, signalling an error,
-        // so the next round of the queue doesn't try to index it again.
-        updateIndexingLevel(m_currentUrl, -1);
+        // Get the uri of the current file
+        QString query = QString::fromLatin1("select ?r where { ?r nie:url %1 . 
}")
+                        .arg( Soprano::Node::resourceToN3( m_currentUrl ) );
+        Soprano::Model* model = ResourceManager::instance()->mainModel();
+        Soprano::QueryResultIterator it = model->executeQuery( query, 
Soprano::Query::QueryLanguageSparqlNoInference );
+
+        if( it.next() ) {
+            // Update the indexing level to -1, signalling an error,
+            // so the next round of the queue doesn't try to index it again.
+            updateIndexingLevel(it[0].uri(), -1);
+        }
     }
 
     QUrl url = m_currentUrl;
-- 
1.8.4

++++++ 0004-FileIndexer-Check-for-nepomukindexer-crashing.patch ++++++
>From 6e6e676bc519eae62d66a6b69c1a83788c7a570a Mon Sep 17 00:00:00 2001
From: Simeon Bird <[email protected]>
Date: Tue, 3 Sep 2013 02:29:02 -0400
Subject: [PATCH 4/4] FileIndexer: Check for nepomukindexer crashing.

It is not enough to check that the indexer returns 0.
We must also check that it did not crash, and, if it did,
return an error.

This patch also defines an error enum for FileIndexingJob.

BUG: 324307
REVIEW: 112475
---
 services/fileindexer/fileindexingjob.cpp | 12 ++++++++----
 services/fileindexer/fileindexingjob.h   | 13 +++++++++++--
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/services/fileindexer/fileindexingjob.cpp 
b/services/fileindexer/fileindexingjob.cpp
index b344596..44c76cf 100644
--- a/services/fileindexer/fileindexingjob.cpp
+++ b/services/fileindexer/fileindexingjob.cpp
@@ -69,7 +69,7 @@ void Nepomuk2::FileIndexingJob::start()
 
     m_process->setProgram( exe, args );
     m_process->setOutputChannelMode(KProcess::OnlyStdoutChannel);
-    connect( m_process, SIGNAL(finished(int)), this, 
SLOT(slotIndexedFile(int)) );
+    connect( m_process, SIGNAL(finished(int, QProcess::ExitStatus)), this, 
SLOT(slotIndexedFile(int, QProcess::ExitStatus)) );
     m_process->start();
 
     // start the timer which will kill the process if it does not terminate 
after 5 minutes
@@ -94,15 +94,19 @@ void Nepomuk2::FileIndexingJob::slotProcessNonExistingFile()
 }
 
 
-void Nepomuk2::FileIndexingJob::slotIndexedFile(int exitCode)
+void Nepomuk2::FileIndexingJob::slotIndexedFile(int exitCode, 
QProcess::ExitStatus exitStatus)
 {
     // stop the timer since there is no need to kill the process anymore
     m_processTimer->stop();
 
     //kDebug() << "Indexing of " << m_url.toLocalFile() << "finished with exit 
code" << exitCode;
+    if(exitStatus != QProcess::NormalExit) {
+        setError( IndexerCrashed );
+        setErrorText( QLatin1String( "Indexer process crashed on " ) + 
m_url.toLocalFile() );
+    }
     if(exitCode == 1) {
-        setError( KJob::UserDefinedError );
-        setErrorText( QLatin1String( "Indexer process returned with an error 
for" ) + m_url.toLocalFile() );
+        setError( IndexerFailed );
+        setErrorText( QLatin1String( "Indexer process returned with an error 
for " ) + m_url.toLocalFile() );
         if(FileIndexerConfig::self()->isDebugModeEnabled()) {
             QFile errorLogFile(KStandardDirs::locateLocal("data", 
QLatin1String("nepomuk/file-indexer-error-log"), true));
             if(errorLogFile.open(QIODevice::Append)) {
diff --git a/services/fileindexer/fileindexingjob.h 
b/services/fileindexer/fileindexingjob.h
index bd1fd94..1432af1 100644
--- a/services/fileindexer/fileindexingjob.h
+++ b/services/fileindexer/fileindexingjob.h
@@ -24,8 +24,8 @@
 
 #include <KJob>
 #include <KUrl>
+#include <KProcess>
 
-class KProcess;
 class QFileInfo;
 class QTimer;
 
@@ -59,6 +59,15 @@ namespace Nepomuk2 {
 
         virtual void start();
 
+        /**
+         * Error codes: IndexerFailed is emitted when the indexer returns 1
+         *              IndexerCrashed is emitted when the indexer crashed
+         */
+        enum {
+            IndexerFailed = UserDefinedError,
+            IndexerCrashed
+        };
+
     Q_SIGNALS:
         /**
          * Emitted once the indexing for a file or resource has finished.
@@ -73,7 +82,7 @@ namespace Nepomuk2 {
         // TODO: actually emit the indexingDone signal
 
     private slots:
-        void slotIndexedFile(int exitCode);
+        void slotIndexedFile(int exitCode, QProcess::ExitStatus exitStatus);
         void slotProcessTimerTimeout();
         void slotProcessNonExistingFile();
 
-- 
1.8.4

++++++ nepomuk-core-4.11.0.tar.xz -> nepomuk-core-4.11.1.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/libnepomukcore/query/querybuilderdata_p.h 
new/nepomuk-core-4.11.1/libnepomukcore/query/querybuilderdata_p.h
--- old/nepomuk-core-4.11.0/libnepomukcore/query/querybuilderdata_p.h   
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/libnepomukcore/query/querybuilderdata_p.h   
2013-08-30 01:09:34.000000000 +0200
@@ -151,7 +151,7 @@
             /// cardinality of 1. This reduces the number of match candidates 
for Virtuoso, thus, significantly
             /// speeding up the query.
             inline QString uniqueVarName( const Types::Property& property = 
Types::Property(), bool* firstUse = 0 ) {
-                if( property.isValid() &&
+                /*if( property.isValid() &&
                     property.maxCardinality() == 1 &&
                     !m_groupTermStack.isEmpty() ) {
                     // use only one variable name for all occurrences of this 
property
@@ -170,11 +170,11 @@
                         return *it;
                     }
                 }
-                else {
+                else { */
                     if(firstUse)
                         *firstUse = true;
                     return QLatin1String( "?v" ) + QString::number( 
++m_varNameCnt );
-                }
+               // }
             }
 
             /// used by ComparisonTerm to add variable names set via 
ComparisonTerm::setVariableName
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/fileindexer/indexer/CMakeLists.txt 
new/nepomuk-core-4.11.1/services/fileindexer/indexer/CMakeLists.txt
--- old/nepomuk-core-4.11.0/services/fileindexer/indexer/CMakeLists.txt 
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/fileindexer/indexer/CMakeLists.txt 
2013-08-28 18:57:31.000000000 +0200
@@ -34,6 +34,7 @@
   nepomukcore
   nepomukextractor
   ${KDE4_KDECORE_LIBS}
+  ${KDE4_KDEUI_LIBS}
   ${SOPRANO_LIBRARIES}
   )
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/fileindexer/indexer/epubextractor.cpp 
new/nepomuk-core-4.11.1/services/fileindexer/indexer/epubextractor.cpp
--- old/nepomuk-core-4.11.0/services/fileindexer/indexer/epubextractor.cpp      
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/fileindexer/indexer/epubextractor.cpp      
2013-08-28 18:57:31.000000000 +0200
@@ -148,6 +148,10 @@
         if( value.startsWith("Unspecified:", Qt::CaseInsensitive) ) {
             value = value.mid( QString("Unspecified:").size() ).simplified();
         }
+        int ind = value.indexOf("publication:", Qt::CaseInsensitive);
+        if( ind != -1) {
+            value = value.mid( ind + QString("publication:").size() 
).simplified();
+        }
         QDateTime dt = ExtractorPlugin::dateTimeFromString(value);
         if( !dt.isNull() )
             fileRes.addProperty( NIE::contentCreated(), dt );
@@ -161,7 +165,10 @@
 
     struct eiterator* iter = epub_get_iterator(ePubDoc, EITERATOR_SPINE, 0 );
     do {
-        QString html = QString::fromUtf8(epub_it_get_curr(iter));
+        char * curr = epub_it_get_curr(iter);
+        if (!curr)
+            continue;
+        QString html = QString::fromUtf8(curr);
 
         QTextDocument doc;
         doc.setHtml( html );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/fileindexer/indexer/main.cpp 
new/nepomuk-core-4.11.1/services/fileindexer/indexer/main.cpp
--- old/nepomuk-core-4.11.0/services/fileindexer/indexer/main.cpp       
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/fileindexer/indexer/main.cpp       
2013-08-28 18:57:31.000000000 +0200
@@ -34,7 +34,7 @@
 #include <KComponentData>
 #include <KApplication>
 
-#include <QtCore/QCoreApplication>
+#include <QApplication>
 #include <QtCore/QDir>
 #include <QtCore/QTextStream>
 
@@ -70,7 +70,7 @@
     const KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
 
     // Application
-    QCoreApplication app( argc, argv );
+    QApplication app( argc, argv );
     KComponentData data( aboutData, KComponentData::RegisterAsMainComponent );
 
     if( args->count() == 0 ) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/fileindexer/indexer/office2007extractor.cpp 
new/nepomuk-core-4.11.1/services/fileindexer/indexer/office2007extractor.cpp
--- 
old/nepomuk-core-4.11.0/services/fileindexer/indexer/office2007extractor.cpp    
    2013-07-10 00:38:26.000000000 +0200
+++ 
new/nepomuk-core-4.11.1/services/fileindexer/indexer/office2007extractor.cpp    
    2013-08-28 18:57:31.000000000 +0200
@@ -255,7 +255,7 @@
                 stream << QLatin1Char(' ');
         }
 
-        if( xml.isEndDocument() )
+        if( xml.isEndDocument() || xml.hasError() )
             break;
     }
 }
@@ -304,7 +304,7 @@
             }
         }
 
-        if( xml.isEndDocument() )
+        if( xml.isEndDocument() || xml.hasError() )
             break;
     }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/fileindexer/indexer/taglibextractor.cpp 
new/nepomuk-core-4.11.1/services/fileindexer/indexer/taglibextractor.cpp
--- old/nepomuk-core-4.11.0/services/fileindexer/indexer/taglibextractor.cpp    
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/fileindexer/indexer/taglibextractor.cpp    
2013-08-29 20:30:59.000000000 +0200
@@ -104,7 +104,7 @@
     // Handling multiple tags in mpeg files.
     if( (mimeType == "audio/mpeg") || (mimeType == "audio/mpeg3") || (mimeType 
== "audio/x-mpeg") ) {
         TagLib::MPEG::File mpegFile( fileUrl.toLocalFile().toUtf8().data(), 
true );
-        if( !mpegFile.ID3v2Tag()->isEmpty() ) {
+        if( mpegFile.ID3v2Tag() && !mpegFile.ID3v2Tag()->isEmpty() ) {
             TagLib::ID3v2::FrameList lstID3v2;
 
             // Artist.
@@ -165,7 +165,7 @@
     // Handling multiple tags in FLAC files.
     if( mimeType == "audio/flac" ) {
         TagLib::FLAC::File flacFile( fileUrl.toLocalFile().toUtf8().data(), 
true );
-        if( !flacFile.xiphComment()->isEmpty() ) {
+        if( flacFile.xiphComment() && !flacFile.xiphComment()->isEmpty() ) {
             TagLib::Ogg::FieldListMap lstFLAC = 
flacFile.xiphComment()->fieldListMap();
             TagLib::Ogg::FieldListMap::ConstIterator itFLAC;
 
@@ -216,7 +216,7 @@
     // Handling multiple tags in OGG files.
     if( mimeType == "audio/ogg" || mimeType == "audio/x-vorbis+ogg" ) {
         TagLib::Ogg::Vorbis::File oggFile( 
fileUrl.toLocalFile().toUtf8().data(), true );
-        if( !oggFile.tag()->isEmpty() ) {
+        if( oggFile.tag() && !oggFile.tag()->isEmpty() ) {
             TagLib::Ogg::FieldListMap lstOGG = oggFile.tag()->fieldListMap();
             TagLib::Ogg::FieldListMap::ConstIterator itOGG;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/backup/backupmanager.cpp 
new/nepomuk-core-4.11.1/services/storage/backup/backupmanager.cpp
--- old/nepomuk-core-4.11.0/services/storage/backup/backupmanager.cpp   
2013-08-07 16:59:42.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/backup/backupmanager.cpp   
2013-08-28 18:57:31.000000000 +0200
@@ -27,7 +27,6 @@
 #include "backupgenerationjob.h"
 #include "backuprestorationjob.h"
 
-#include <QtDBus/QDBusConnection>
 #include <QtCore/QListIterator>
 #include <QtCore/QTimer>
 #include <QtCore/QDir>
@@ -41,6 +40,7 @@
 #include <KGlobal>
 #include <KLocale>
 #include <KCalendarSystem>
+#include <kdbusconnectionpool.h>
 
 
 Nepomuk2::BackupManager::BackupManager(Nepomuk2::Storage* storageService)
@@ -51,7 +51,7 @@
 {
     new BackupManagerAdaptor( this );
     // Register via DBUs
-    QDBusConnection con = QDBusConnection::sessionBus();
+    QDBusConnection con = KDBusConnectionPool::threadConnection();
     con.registerObject( QLatin1String("/backupmanager"), this );
 
     m_backupLocation = KStandardDirs::locateLocal( "data", 
"nepomuk/backupsync/backups/" );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/backup/gui/nepomukbackup.desktop 
new/nepomuk-core-4.11.1/services/storage/backup/gui/nepomukbackup.desktop
--- old/nepomuk-core-4.11.0/services/storage/backup/gui/nepomukbackup.desktop   
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/backup/gui/nepomukbackup.desktop   
2013-08-28 18:57:31.000000000 +0200
@@ -10,7 +10,7 @@
 Name[es]=Copia de respaldo de Nepomuk
 Name[et]=Nepomuki varundamine
 Name[eu]=Nepomuk babeskopia
-Name[fi]=Nepomuk-varmuuskopio
+Name[fi]=Nepomuk-varmuuskopiointi
 Name[fr]=Sauvegarde de Nepomuk
 Name[ga]=CĂșltaca Nepomuk
 Name[gl]=Copia de seguranza de Nepomuk
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/datamanagementadaptor.cpp 
new/nepomuk-core-4.11.1/services/storage/datamanagementadaptor.cpp
--- old/nepomuk-core-4.11.0/services/storage/datamanagementadaptor.cpp  
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/datamanagementadaptor.cpp  
2013-08-29 20:30:59.000000000 +0200
@@ -56,6 +56,13 @@
 
     // N threads means N connections to Virtuoso
     m_threadPool->setMaxThreadCount(10);
+
+    // This is hack to slow down the indexing. A lot of processes seem to be 
indexing things
+    // at the same time, and this leads of very high cpu usage along with 
occasional transaction
+    // failures. As a temporary measure, it would be best to only allow one 
storeResource at a
+    // time for 4.11.1
+    m_storeResourcesThreadPool = new QThreadPool(this);
+    m_storeResourcesThreadPool->setMaxThreadCount(1);
 }
 
 Nepomuk2::DataManagementAdaptor::~DataManagementAdaptor()
@@ -103,7 +110,8 @@
 {
     Q_ASSERT(calledFromDBus());
     setDelayedReply(true);
-    enqueueCommand(new StoreResourcesCommand(resources, app, 
identificationMode, flags, additionalMetadata, m_model, message()));
+    StoreResourcesCommand* command = new StoreResourcesCommand(resources, app, 
identificationMode, flags, additionalMetadata, m_model, message());
+    m_storeResourcesThreadPool->start(command);
     // QtDBus will ignore this return value
     return QHash<QString, QString>();
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/datamanagementadaptor.h 
new/nepomuk-core-4.11.1/services/storage/datamanagementadaptor.h
--- old/nepomuk-core-4.11.0/services/storage/datamanagementadaptor.h    
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/datamanagementadaptor.h    
2013-08-29 20:30:59.000000000 +0200
@@ -100,6 +100,7 @@
 
     Nepomuk2::DataManagementModel* m_model;
     QThreadPool* m_threadPool;
+    QThreadPool* m_storeResourcesThreadPool;
     QHash<QString, QString> m_namespaces;
     QRegExp m_namespacePrefixRx;
 };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/datamanagementcommand.cpp 
new/nepomuk-core-4.11.1/services/storage/datamanagementcommand.cpp
--- old/nepomuk-core-4.11.0/services/storage/datamanagementcommand.cpp  
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/datamanagementcommand.cpp  
2013-08-28 18:57:31.000000000 +0200
@@ -25,7 +25,7 @@
 #include <Soprano/Error/Error>
 #include <Soprano/Error/ErrorCode>
 
-#include <QtDBus/QDBusConnection>
+#include <kdbusconnectionpool.h>
 
 #include <QtCore/QStringList>
 #include <QtCore/QEventLoop>
@@ -61,9 +61,10 @@
 {
     QVariant result = runCommand();
     Soprano::Error::Error error = model()->lastError();
+    QDBusConnection con = KDBusConnectionPool::threadConnection();
     if(error) {
         // send error reply
-        
QDBusConnection::sessionBus().send(m_msg.createErrorReply(convertSopranoErrorCode(error.code()),
 error.message()));
+        con.send(m_msg.createErrorReply(convertSopranoErrorCode(error.code()), 
error.message()));
     }
     else {
         // encode result (ie. convert QUrl to QString)
@@ -71,10 +72,10 @@
             if(result.type() == QVariant::Url) {
                 result = encodeUrl(result.toUrl());
             }
-            QDBusConnection::sessionBus().send(m_msg.createReply(result));
+            con.send(m_msg.createReply(result));
         }
         else {
-            QDBusConnection::sessionBus().send(m_msg.createReply());
+            con.send(m_msg.createReply());
         }
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/ontologyloader.cpp 
new/nepomuk-core-4.11.1/services/storage/ontologyloader.cpp
--- old/nepomuk-core-4.11.0/services/storage/ontologyloader.cpp 2013-07-10 
00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/ontologyloader.cpp 2013-08-28 
18:57:31.000000000 +0200
@@ -36,6 +36,7 @@
 #include <KStandardDirs>
 #include <KLocale>
 #include <KDirWatch>
+#include <kdbusconnectionpool.h>
 
 #include <QtCore/QFileInfo>
 #include <QtCore/QTimer>
@@ -156,12 +157,12 @@
 
     // export ourselves on DBus
     ( void )new OntologyManagerAdaptor( this );
-    QDBusConnection::sessionBus().registerObject( 
QLatin1String("/nepomukontologyloader"),
-                                                  this,
-                                                  
QDBusConnection::ExportAdaptors );
+    QDBusConnection con = KDBusConnectionPool::threadConnection();
+    con.registerObject( QLatin1String("/nepomukontologyloader"), this,
+                        QDBusConnection::ExportAdaptors );
 
     // be backwards compatible
-    QDBusConnection::sessionBus().registerService( 
QLatin1String("org.kde.nepomuk.services.nepomukontologyloader") );
+    con.registerService( 
QLatin1String("org.kde.nepomuk.services.nepomukontologyloader") );
 
     d->model = new OntologyManagerModel( model, this );
     connect( &d->updateTimer, SIGNAL(timeout()), this, 
SLOT(updateNextOntology()) );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/query/folderconnection.cpp 
new/nepomuk-core-4.11.1/services/storage/query/folderconnection.cpp
--- old/nepomuk-core-4.11.0/services/storage/query/folderconnection.cpp 
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/query/folderconnection.cpp 
2013-08-28 18:57:31.000000000 +0200
@@ -25,9 +25,9 @@
 
 #include <QtCore/QStringList>
 #include <QtDBus/QDBusServiceWatcher>
-#include <QtDBus/QDBusConnection>
 
 #include <KDebug>
+#include <kdbusconnectionpool.h>
 
 Nepomuk2::Query::FolderConnection::FolderConnection( Folder* folder )
     : QObject( folder ),
@@ -153,11 +153,12 @@
 
     // build the dbus object path from the id and register the connection as a 
Query dbus object
     const QString dbusObjectPath = QString( "/nepomukqueryservice/query%1" 
).arg( id );
-    QDBusConnection::sessionBus().registerObject( dbusObjectPath, this );
+    QDBusConnection con = KDBusConnectionPool::threadConnection();
+    con.registerObject( dbusObjectPath, this );
 
     // watch the dbus client for unregistration for auto-cleanup
     m_serviceWatcher = new QDBusServiceWatcher( dbusClient,
-                                                QDBusConnection::sessionBus(),
+                                                con,
                                                 
QDBusServiceWatcher::WatchForUnregistration,
                                                 this );
     connect( m_serviceWatcher, SIGNAL(serviceUnregistered(QString)),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/query/queryservice.cpp 
new/nepomuk-core-4.11.1/services/storage/query/queryservice.cpp
--- old/nepomuk-core-4.11.0/services/storage/query/queryservice.cpp     
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/query/queryservice.cpp     
2013-08-28 18:57:31.000000000 +0200
@@ -30,6 +30,7 @@
 #include <KPluginFactory>
 #include <KUrl>
 #include <KDebug>
+#include <kdbusconnectionpool.h>
 
 #include "resourcemanager.h"
 #include "types/property.h"
@@ -60,7 +61,7 @@
     QLatin1String serviceName("nepomukqueryservice");
     QString dbusName = QString::fromLatin1("org.kde.nepomuk.services.%1").arg( 
serviceName );
 
-    QDBusConnection bus = QDBusConnection::sessionBus();
+    QDBusConnection bus = KDBusConnectionPool::threadConnection();
     if( !bus.registerService( dbusName ) ) {
         kDebug() << "Failed to register the QueryService .. ";
     }
@@ -112,7 +113,8 @@
     Query q = QueryParser::parseQuery( query );
     if( !q.isValid() ) {
         kDebug() << "Invalid desktop query:" << query;
-        QDBusConnection::sessionBus().send( msg.createErrorReply( 
QDBusError::InvalidArgs, i18n("Invalid desktop query: '%1'", query) ) );
+        QDBusConnection con = KDBusConnectionPool::threadConnection();
+        con.send( msg.createErrorReply( QDBusError::InvalidArgs, i18n("Invalid 
desktop query: '%1'", query) ) );
         return QDBusObjectPath(QLatin1String("/non/existing/path"));
     }
     else {
@@ -140,7 +142,8 @@
 
     if( sparql.isEmpty() ) {
         kDebug() << "Invalid SPARQL query:" << sparql;
-        QDBusConnection::sessionBus().send( msg.createErrorReply( 
QDBusError::InvalidArgs, i18n("Invalid SPARQL query: '%1'", sparql) ) );
+        QDBusConnection con = KDBusConnectionPool::threadConnection();
+        con.send( msg.createErrorReply( QDBusError::InvalidArgs, i18n("Invalid 
SPARQL query: '%1'", sparql) ) );
         return QDBusObjectPath(QLatin1String("/non/existing/path"));
     }
     else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nepomuk-core-4.11.0/services/storage/repository.cpp 
new/nepomuk-core-4.11.1/services/storage/repository.cpp
--- old/nepomuk-core-4.11.0/services/storage/repository.cpp     2013-08-06 
14:43:38.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/repository.cpp     2013-08-28 
18:57:31.000000000 +0200
@@ -39,6 +39,7 @@
 #include <KNotification>
 #include <KIcon>
 #include <KIO/DeleteJob>
+#include <kdbusconnectionpool.h>
 
 #include <QtCore/QTimer>
 #include <QtCore/QFile>
@@ -194,7 +195,7 @@
     }
 
     // We accept virtuoso version 6.1.6+ Nepomuk hasn't really been tested 
with 7
-    QRegExp regex("(6\.1\.[6789])");
+    QRegExp regex("(6\\.1\\.[6789])");
     if( !m_virtuosoVersion.contains(regex) ) {
         kError() << "NepomukStorage only works with virtuoso 6.1.6 and beyond";
         return;
@@ -379,7 +380,7 @@
 
     m_dataManagementAdaptor = new 
Nepomuk2::DataManagementAdaptor(m_dataManagementModel);
 
-    QDBusConnection con = QDBusConnection::sessionBus();
+    QDBusConnection con = KDBusConnectionPool::threadConnection();
     con.registerObject(QLatin1String("/datamanagement"), 
m_dataManagementAdaptor,
                        QDBusConnection::ExportScriptableContents);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/resourcewatcherconnection.cpp 
new/nepomuk-core-4.11.1/services/storage/resourcewatcherconnection.cpp
--- old/nepomuk-core-4.11.0/services/storage/resourcewatcherconnection.cpp      
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/resourcewatcherconnection.cpp      
2013-08-28 18:57:31.000000000 +0200
@@ -22,10 +22,11 @@
 #include "resourcewatcherconnectionadaptor.h"
 #include "resourcewatchermanager.h"
 
-#include <QtDBus/QDBusConnection>
 #include <QtDBus/QDBusObjectPath>
 #include <QtDBus/QDBusServiceWatcher>
 
+#include <kdbusconnectionpool.h>
+
 Nepomuk2::ResourceWatcherConnection::ResourceWatcherConnection( 
ResourceWatcherManager* parent )
     : QObject( parent ),
       m_manager(parent)
@@ -42,11 +43,12 @@
     // build the dbus object path from the id and register the connection as a 
Query dbus object
     new ResourceWatcherConnectionAdaptor( this );
     const QString dbusObjectPath = QString::fromLatin1( 
"/resourcewatcher/watch%1" ).arg( id );
-    QDBusConnection::sessionBus().registerObject( dbusObjectPath, this );
+    QDBusConnection con = KDBusConnectionPool::threadConnection();
+    con.registerObject( dbusObjectPath, this );
 
     // watch the dbus client for unregistration for auto-cleanup
     m_serviceWatcher = new QDBusServiceWatcher( dbusClient,
-                                                QDBusConnection::sessionBus(),
+                                                con,
                                                 
QDBusServiceWatcher::WatchForUnregistration,
                                                 this );
     connect( m_serviceWatcher, SIGNAL(serviceUnregistered(QString)),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/resourcewatchermanager.cpp 
new/nepomuk-core-4.11.1/services/storage/resourcewatchermanager.cpp
--- old/nepomuk-core-4.11.0/services/storage/resourcewatchermanager.cpp 
2013-08-06 14:43:38.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/resourcewatchermanager.cpp 
2013-08-28 18:57:31.000000000 +0200
@@ -29,11 +29,11 @@
 #include <Soprano/NodeIterator>
 #include <Soprano/Vocabulary/RDF>
 
-#include <QtDBus/QDBusConnection>
 #include <QtDBus/QDBusMessage>
 
 #include <KUrl>
 #include <KDebug>
+#include <kdbusconnectionpool.h>
 
 #include <QtCore/QStringList>
 #include <QtCore/QSet>
@@ -104,7 +104,8 @@
       m_mutex( QMutex::Recursive ),
       m_connectionCount(0)
 {
-    QDBusConnection::sessionBus().registerObject("/resourcewatcher", this, 
QDBusConnection::ExportScriptableSlots|QDBusConnection::ExportScriptableSignals);
+    QDBusConnection con = KDBusConnectionPool::threadConnection();
+    con.registerObject("/resourcewatcher", this, 
QDBusConnection::ExportScriptableSlots|QDBusConnection::ExportScriptableSignals);
 }
 
 Nepomuk2::ResourceWatcherManager::~ResourceWatcherManager()
@@ -320,7 +321,8 @@
         return con->registerDBusObject(message().service(), 
++m_connectionCount);
     }
     else {
-        
QDBusConnection::sessionBus().send(message().createErrorReply(QDBusError::InvalidArgs,
 QLatin1String("Failed to create watch for given arguments.")));
+        QDBusConnection bus = KDBusConnectionPool::threadConnection();
+        bus.send(message().createErrorReply(QDBusError::InvalidArgs, 
QLatin1String("Failed to create watch for given arguments.")));
         return QDBusObjectPath();
     }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/nepomuk-core-4.11.0/services/storage/storage.cpp 
new/nepomuk-core-4.11.1/services/storage/storage.cpp
--- old/nepomuk-core-4.11.0/services/storage/storage.cpp        2013-07-10 
00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/storage.cpp        2013-08-29 
20:30:59.000000000 +0200
@@ -24,7 +24,6 @@
 #include "resourcemanager.h"
 #include "graphmigrationjob.h"
 
-#include <QtDBus/QDBusConnection>
 #include <QtCore/QFile>
 #include <QtCore/QCoreApplication>
 #include <QtCore/QTimer>
@@ -36,6 +35,7 @@
 #include <KStandardDirs>
 #include <KConfigGroup>
 #include <KProcess>
+#include <kdbusconnectionpool.h>
 #include <Soprano/QueryResultIterator>
 
 namespace {
@@ -50,7 +50,8 @@
     , m_resetInProgress( false )
 {
     // register the fancier name for this important service
-    QDBusConnection::sessionBus().registerService( "org.kde.NepomukStorage" );
+    QDBusConnection con = KDBusConnectionPool::threadConnection();
+    con.registerService( "org.kde.NepomukStorage" );
 
     m_repository = new Repository( QLatin1String( s_repositoryName ) );
     connect( m_repository, SIGNAL( loaded( Repository*, bool ) ),
@@ -136,7 +137,7 @@
 
     bool removeDir(const QString & dirName)
     {
-        bool result;
+        bool result = false;
         QDir dir(dirName);
 
         if (dir.exists(dirName)) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/nepomuk-core-4.11.0/services/storage/syncresourceidentifier.cpp 
new/nepomuk-core-4.11.1/services/storage/syncresourceidentifier.cpp
--- old/nepomuk-core-4.11.0/services/storage/syncresourceidentifier.cpp 
2013-07-10 00:38:26.000000000 +0200
+++ new/nepomuk-core-4.11.1/services/storage/syncresourceidentifier.cpp 
2013-08-28 18:57:31.000000000 +0200
@@ -226,12 +226,15 @@
         }
 
 
-        const int score = m_model->executeQuery(QString::fromLatin1("select 
count(?p) as ?cnt where { "
+        QList<Soprano::BindingSet> bindings = 
m_model->executeQuery(QString::fromLatin1("select count(?p) as ?cnt where { "
                                                                        "%1 ?p 
?o. filter( ?p in (%2) ) . }")
                                                    .arg( r.toN3(),
                                                          
identifyingProperties.join(",") ),
-                                                   
Soprano::Query::QueryLanguageSparqlNoInference)
-                          .allBindings().first()["cnt"].literal().toInt();
+                                                   
Soprano::Query::QueryLanguageSparqlNoInference).allBindings();
+        if(bindings.isEmpty())
+            continue;
+
+        const int score = bindings.first()["cnt"].literal().toInt();
 
         if( maxScore < score ) {
             maxScore = score;


-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to