Hello community,

here is the log from the commit of package nepomuk-core for openSUSE:Factory 
checked in at 2013-02-12 12:53:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/nepomuk-core (Old)
 and      /work/SRC/openSUSE:Factory/.nepomuk-core.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

Changes:
--------
--- /work/SRC/openSUSE:Factory/nepomuk-core/nepomuk-core.changes        
2013-02-10 14:37:34.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.nepomuk-core.new/nepomuk-core.changes   
2013-02-12 12:53:44.000000000 +0100
@@ -1,0 +2,11 @@
+Mon Feb 11 19:41:12 UTC 2013 - [email protected]
+
+- Added initialize-objects-in-correct-order.diff from upstream, 
+  fixes a largely duplicated bug for users that cleaned db after 
+  upgrade to KDE 4.10, kde#314589
+- Also added upstreams connect-both-the-queues-together.diff 
+  do-not-auto-update-the-cache-by-default.diff, and 
+  emit-the-current-signals-in-propertychanged.diff for performance
+  improvement
+
+-------------------------------------------------------------------

New:
----
  connect-both-the-queues-together.diff
  do-not-auto-update-the-cache-by-default.diff
  emit-the-current-signals-in-propertychanged.diff
  initialize-objects-in-correct-order.diff

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

Other differences:
------------------
++++++ nepomuk-core.spec ++++++
--- /var/tmp/diff_new_pack.alWtPN/_old  2013-02-12 12:53:46.000000000 +0100
+++ /var/tmp/diff_new_pack.alWtPN/_new  2013-02-12 12:53:46.000000000 +0100
@@ -40,6 +40,14 @@
 Source99:       nepomuk.png
 # PATCH-FIX-UPSTREAM 
Revert-BasicIndexingQueue-Use-stacks-instead-of-queu.patch fixes indexer not 
working recursively (kde#314559)
 Patch0:         Revert-BasicIndexingQueue-Use-stacks-instead-of-queu.patch
+# PATCH-FIX-UPSTREAM initialize-objects-in-correct-order.diff Object where 
initialized in the wrong order, and this always caused a crash for users that 
enabled nepomuk with clean db (kde#314589)
+Patch1:         initialize-objects-in-correct-order.diff
+# PATCH-FIX-UPSTREAM connect-both-the-queues-together.diff
+Patch2:         connect-both-the-queues-together.diff
+# PATCH-FIX-UPSTREAM emit-the-current-signals-in-propertychanged.diff
+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
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Requires:       kdelibs4 >= %version
 Requires:       soprano-backend-redland
@@ -61,6 +69,10 @@
 %prep
 %setup -q -n %{name}-%{version}
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
   %cmake_kde4 -d build -- -DKDE4_ENABLE_FPIE=1

++++++ connect-both-the-queues-together.diff ++++++
commit 6b0839c1ea03d702d84c55ed6d9ec193dcca702b
Author: Vishesh Handa <[email protected]>
Date:   Mon Feb 4 20:41:14 2013 +0530

    IndexScheduler: Connect both the queues together
    
    This way the fileIQ is notified that it has items when the basicIQ
    finishes and it doesn't need to check the db.

diff --git a/services/fileindexer/fileindexingqueue.cpp 
b/services/fileindexer/fileindexingqueue.cpp
index dfac534..2b11925 100644
--- a/services/fileindexer/fileindexingqueue.cpp
+++ b/services/fileindexer/fileindexingqueue.cpp
@@ -62,6 +62,15 @@ void FileIndexingQueue::fillQueue()
         m_fileQueue.enqueue( it[0].uri() );
 }
 
+void FileIndexingQueue::enqueue(const QUrl& url)
+{
+    if( !m_fileQueue.contains(url) ) {
+        m_fileQueue.enqueue( url );
+        callForNextIteration();
+    }
+}
+
+
 bool FileIndexingQueue::isEmpty()
 {
     return m_fileQueue.isEmpty();
diff --git a/services/fileindexer/fileindexingqueue.h 
b/services/fileindexer/fileindexingqueue.h
index 294b41d..b017f22 100644
--- a/services/fileindexer/fileindexingqueue.h
+++ b/services/fileindexer/fileindexingqueue.h
@@ -46,6 +46,7 @@ namespace Nepomuk2 {
          */
         void start();
 
+        void enqueue( const QUrl& url );
     signals:
         void beginIndexingFile(const QUrl& url);
         void endIndexingFile(const QUrl& url);
diff --git a/services/fileindexer/indexscheduler.cpp 
b/services/fileindexer/indexscheduler.cpp
index 3ad7819..9831d2d 100644
--- a/services/fileindexer/indexscheduler.cpp
+++ b/services/fileindexer/indexscheduler.cpp
@@ -83,6 +83,9 @@ Nepomuk2::IndexScheduler::IndexScheduler( QObject* parent )
     connect( m_fileIQ, SIGNAL(startedIndexing()), this, 
SLOT(slotStartedIndexing()) );
     connect( m_fileIQ, SIGNAL(finishedIndexing()), this, 
SLOT(slotFinishedIndexing()) );
 
+    // Connect both the queues together
+    connect( m_basicIQ, SIGNAL(endIndexingFile(QUrl)), m_fileIQ, 
SLOT(enqueue(QUrl)) );
+
     // Status String
     connect( m_basicIQ, SIGNAL(beginIndexingFile(QUrl)), this, 
SIGNAL(statusStringChanged()) );
     connect( m_basicIQ, SIGNAL(endIndexingFile(QUrl)), this, 
SIGNAL(statusStringChanged()) );
++++++ do-not-auto-update-the-cache-by-default.diff ++++++
commit a398d44788eb4dc17570a61d62a8e22067a2ca77
Author: Vishesh Handa <[email protected]>
Date:   Sun Feb 3 03:34:40 2013 +0530

    Resource: Do not auto update the cache by default
    
    The resource class generally connects to the ResourceWatcher, and
    updates itself whenever any other application changes any data. While,
    this may be desirable at times, most of the times, it is not required.
    
    1. It creates a massive number of watches which increase the number of
       messages that are sent across dbus.
    
    2. It slows down the Resource class because its own changes are also
       propogated back to it.
    
    3. It doesn't really notify anyone that the data has been changed, so
       the ui code doesn't know when it is supposed to refresh.
    
    Added a function setWatchEnabled( bool ), which configures if the
    Resource should be auto-updated.

diff --git a/autotests/test/resourcetests.cpp b/autotests/test/resourcetests.cpp
index 4727846..cf4ddc9 100644
--- a/autotests/test/resourcetests.cpp
+++ b/autotests/test/resourcetests.cpp
@@ -405,6 +405,7 @@ void ResourceTests::tagsUpdate()
     QVERIFY(tag3.exists());
 
     Resource res(resUri);
+    res.setWatchEnabled( true );
 
     QList<Tag> tags;
     tags << tag1 << tag2 << tag3;
@@ -487,6 +488,7 @@ void ResourceTests::newResourcesUpdated()
     QUrl fileUri;
 
     Resource fileRes( fileUrl );
+    fileRes.setWatchEnabled( true );
     QVERIFY(!fileRes.exists());
     QVERIFY(fileRes.uri().isEmpty());
 
@@ -506,6 +508,7 @@ void ResourceTests::newResourcesUpdated()
 void ResourceTests::identifierUpdate()
 {
     Tag tag("Fire");
+    tag.setWatchEnabled( true );
     QVERIFY(!tag.exists());
 
     // Save the tag
@@ -571,6 +574,7 @@ void ResourceTests::resourceDeletion()
 
     Tag tag("Poop");
     Resource fileRes( fileUrl );
+    fileRes.setWatchEnabled(true);
     fileRes.addTag(tag);
 
     const QUrl tagUri = tag.uri();
diff --git a/libnepomukcore/resource/resource.cpp 
b/libnepomukcore/resource/resource.cpp
index 342c0ff..df02be7 100644
--- a/libnepomukcore/resource/resource.cpp
+++ b/libnepomukcore/resource/resource.cpp
@@ -668,6 +668,22 @@ Nepomuk2::File Nepomuk2::Resource::toFile() const
     return File( *this );
 }
 
+void Nepomuk2::Resource::setWatchEnabled(bool status)
+{
+    determineFinalResourceData();
+    if( m_data )
+        return m_data->setWatchEnabled( status );
+}
+
+bool Nepomuk2::Resource::watchEnabled()
+{
+    determineFinalResourceData();
+    if( m_data )
+        return m_data->watchEnabled();
+
+    return false;
+}
+
 
 // static
 Nepomuk2::Resource Nepomuk2::Resource::fromResourceUri( const KUrl& uri, const 
Nepomuk2::Types::Class& type )
diff --git a/libnepomukcore/resource/resource.h 
b/libnepomukcore/resource/resource.h
index 5d99952..114d415 100644
--- a/libnepomukcore/resource/resource.h
+++ b/libnepomukcore/resource/resource.h
@@ -510,6 +510,18 @@ namespace Nepomuk2 {
          */
         static Resource fromResourceUri( const KUrl& uri, const 
Nepomuk2::Types::Class& type = Nepomuk2::Types::Class() );
 
+        /**
+         * Enables automatic updates of the internal cache using a
+         * ResourceWatcher.
+         */
+        void setWatchEnabled( bool status );
+
+        /**
+         * \return \p true if this resource will automatically update its cache
+         * when the data is changed by some other application
+         */
+        bool watchEnabled();
+
     private:
         /**
          * Determines the final ResourceData and updates m_data if
diff --git a/libnepomukcore/resource/resourcedata.cpp 
b/libnepomukcore/resource/resourcedata.cpp
index cb26f97..b4c4bcc 100644
--- a/libnepomukcore/resource/resourcedata.cpp
+++ b/libnepomukcore/resource/resourcedata.cpp
@@ -69,6 +69,7 @@ Nepomuk2::ResourceData::ResourceData( const QUrl& uri, const 
QUrl& kickOffUri, c
       m_modificationMutex(QMutex::Recursive),
       m_cacheDirty(false),
       m_addedToWatcher(false),
+      m_watchEnabled(false),
       m_rm(rm)
 {
     if( !uri.isEmpty() ) {
@@ -170,10 +171,7 @@ void Nepomuk2::ResourceData::resetAll( bool isDelete )
 
     if( !m_uri.isEmpty() ) {
         m_rm->m_initializedData.remove( m_uri );
-        if( m_addedToWatcher ) {
-            m_rm->removeFromWatcher( m_uri );
-            m_addedToWatcher = false;
-        }
+        removeFromWatcher();
     }
     m_rm->mutex.unlock();
 
@@ -313,10 +311,21 @@ bool Nepomuk2::ResourceData::store()
 // Caller must hold m_modificationMutex
 void Nepomuk2::ResourceData::addToWatcher()
 {
-    m_rm->addToWatcher( m_uri );
-    m_addedToWatcher = true;
+    if( m_watchEnabled && !m_addedToWatcher ) {
+        m_rm->addToWatcher( m_uri );
+        m_addedToWatcher = true;
+    }
 }
 
+void Nepomuk2::ResourceData::removeFromWatcher()
+{
+    if( m_addedToWatcher ) {
+        m_rm->removeFromWatcher( m_uri );
+        m_addedToWatcher = false;
+    }
+}
+
+
 bool Nepomuk2::ResourceData::load()
 {
     QMutexLocker rmlock(&m_rm->mutex); // for updateKickOffLists, but must be 
locked first
@@ -758,3 +767,21 @@ void Nepomuk2::ResourceData::propertyAdded( const 
Types::Property &prop, const Q
         m_cache[prop.uri()].append(var);
     }
 }
+
+void Nepomuk2::ResourceData::setWatchEnabled(bool status)
+{
+    QMutexLocker lock(&m_modificationMutex);
+    if( m_watchEnabled != status ) {
+        if( status )
+            addToWatcher();
+        else
+            removeFromWatcher();
+
+        m_watchEnabled = status;
+    }
+}
+
+bool Nepomuk2::ResourceData::watchEnabled()
+{
+    return m_watchEnabled;
+}
diff --git a/libnepomukcore/resource/resourcedata.h 
b/libnepomukcore/resource/resourcedata.h
index 8778af5..2cc36f7 100644
--- a/libnepomukcore/resource/resourcedata.h
+++ b/libnepomukcore/resource/resourcedata.h
@@ -164,6 +164,8 @@ namespace Nepomuk2 {
         void propertyRemoved( const Types::Property &prop, const QVariant 
&value );
         void propertyAdded( const Types::Property &prop, const QVariant &value 
);
 
+        void setWatchEnabled( bool status );
+        bool watchEnabled();
     private:
         ResourceData(const ResourceData&); // = delete
         ResourceData& operator = (const ResourceData&); // = delete
@@ -171,6 +173,7 @@ namespace Nepomuk2 {
         void updateIdentifierLists( const QString& oldIdentifier, const 
QString& newIdentifier );
 
         void addToWatcher();
+        void removeFromWatcher();
 
         /// Will reset this instance to 0 as if constructed without parameters
         /// Used by remove() and deleteData()
@@ -203,6 +206,7 @@ namespace Nepomuk2 {
 
         bool m_cacheDirty;
         bool m_addedToWatcher;
+        bool m_watchEnabled;
 
         ResourceManagerPrivate* m_rm;
     };
++++++ emit-the-current-signals-in-propertychanged.diff ++++++
commit 27605e21e4dd0b6ed3ed4b2ec5ae92af22822b63
Author: Vishesh Handa <[email protected]>
Date:   Tue Feb 5 18:34:43 2013 +0530

    ResourceWatcher: Emit the current signals in propertyChanged
    
    We were accidentally emitting the wrong paramaters for propertyRemoved
    and propertyAdded.

diff --git a/libnepomukcore/datamanagement/resourcewatcher.cpp 
b/libnepomukcore/datamanagement/resourcewatcher.cpp
index 4a741f2..f394ae8 100644
--- a/libnepomukcore/datamanagement/resourcewatcher.cpp
+++ b/libnepomukcore/datamanagement/resourcewatcher.cpp
@@ -318,20 +318,20 @@ namespace {
     }
 }
 
-void Nepomuk2::ResourceWatcher::slotPropertyChanged(const QString& resUri, 
const QString& propUri, const QVariantList& oldObjs, const QVariantList& 
newObjs)
+void Nepomuk2::ResourceWatcher::slotPropertyChanged(const QString& res_, const 
QString& prop_, const QVariantList& addedObjs, const QVariantList& removedObjs)
 {
-    const Resource res = Resource::fromResourceUri(KUrl(resUri));
-    const Types::Property prop = KUrl(propUri);
+    const Resource res = Resource::fromResourceUri(KUrl(res_));
+    const Types::Property prop = KUrl(prop_);
 
-    foreach( const QVariant& v, oldObjs ) {
-        emit propertyRemoved( res, prop, v );
+    foreach( const QVariant& v, addedObjs ) {
+        emit propertyAdded( res, prop, convertType(prop, v) );
     }
 
-    foreach( const QVariant& v, newObjs ) {
-        emit propertyAdded( res, prop, v );
+    foreach( const QVariant& v, removedObjs ) {
+        emit propertyRemoved( res, prop, convertType(prop, v) );
     }
 
-    emit propertyChanged( res, prop, oldObjs, newObjs );
+    emit propertyChanged( res, prop, addedObjs, removedObjs );
 }
 
 #include "resourcewatcher.moc"
diff --git a/libnepomukcore/datamanagement/resourcewatcher.h 
b/libnepomukcore/datamanagement/resourcewatcher.h
index 621fbf6..05e3710 100644
--- a/libnepomukcore/datamanagement/resourcewatcher.h
+++ b/libnepomukcore/datamanagement/resourcewatcher.h
@@ -352,9 +352,7 @@ namespace Nepomuk2 {
         void slotResourceRemoved(const QString& res, const QStringList& types);
         void slotResourceTypesAdded(const QString& res, const QStringList& 
types);
         void slotResourceTypesRemoved(const QString& res, const QStringList& 
types);
-        void slotPropertyChanged(const QString& res, const QString& prop,
-                                 const QVariantList & oldObjs,
-                                 const QVariantList & newObjs);
+        void slotPropertyChanged(const QString& res, const QString& prop_, 
const QVariantList& addedObjs, const QVariantList& removedObjs);
     private:
         class Private;
         Private * d;
++++++ initialize-objects-in-correct-order.diff ++++++
commit b94e9f73bd86593928988e5626511acea805b7be
Author: Edward Toroshchin <[email protected]>
Date:   Sun Feb 3 17:57:23 2013 +0100

    fileindexer: initialize objects in correct order
    
    The IndexCleaner job created in IndexScheduler could complete before
    m_eventMonitor is initialized, which leads to crash in slotCleaningDone.
    
    REVIEW: 108754

diff --git a/services/fileindexer/indexscheduler.cpp 
b/services/fileindexer/indexscheduler.cpp
index a13de1b..3ad7819 100644
--- a/services/fileindexer/indexscheduler.cpp
+++ b/services/fileindexer/indexscheduler.cpp
@@ -51,10 +51,6 @@ Nepomuk2::IndexScheduler::IndexScheduler( QObject* parent )
         QFile::remove(KStandardDirs::locateLocal("data", 
QLatin1String("nepomuk/file-indexer-error-log")));
     }
 
-    m_cleaner = new IndexCleaner(this);
-    connect( m_cleaner, SIGNAL(finished(KJob*)), this, 
SLOT(slotCleaningDone()) );
-    m_cleaner->start();
-
     FileIndexerConfig* indexConfig = FileIndexerConfig::self();
     connect( indexConfig, 
SIGNAL(includeFolderListChanged(QStringList,QStringList)),
              this, SLOT(slotIncludeFolderListChanged(QStringList,QStringList)) 
);
@@ -106,6 +102,10 @@ Nepomuk2::IndexScheduler::IndexScheduler( QObject* parent )
     connect( m_eventMonitor, SIGNAL(powerManagementStatusChanged(bool)),
              this, SLOT(slotScheduleIndexing()) );
 
+    m_cleaner = new IndexCleaner(this);
+    connect( m_cleaner, SIGNAL(finished(KJob*)), this, 
SLOT(slotCleaningDone()) );
+    m_cleaner->start();
+
     // Special settings for the queues
     KConfig config( "nepomukstrigirc" );
     KConfigGroup cfg = config.group( "Indexing" );


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

Reply via email to